From 9580c2b13ef3833486cc6fc4f95fab7f0c40c3b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Tue, 9 Jul 2019 09:13:00 +0200 Subject: TreeItem: Rename new button disable method to set_button_disabled Follow-up to #30408. Also sync classref with current source. --- doc/classes/Button.xml | 4 ++-- doc/classes/CheckBox.xml | 4 ++-- doc/classes/CheckButton.xml | 4 ++-- doc/classes/ItemList.xml | 2 +- doc/classes/LineEdit.xml | 10 +++++----- doc/classes/LinkButton.xml | 4 ++-- doc/classes/MenuButton.xml | 4 ++-- doc/classes/OptionButton.xml | 4 ++-- doc/classes/PopupMenu.xml | 4 ++-- doc/classes/ProgressBar.xml | 2 +- doc/classes/ProjectSettings.xml | 4 +++- doc/classes/RichTextLabel.xml | 2 +- doc/classes/TabContainer.xml | 4 ++-- doc/classes/Tabs.xml | 4 ++-- doc/classes/TextEdit.xml | 30 +++++++++++++++--------------- doc/classes/ToolButton.xml | 4 ++-- doc/classes/Tree.xml | 8 ++++---- doc/classes/TreeItem.xml | 12 ++++++++++++ scene/gui/tree.cpp | 33 ++++++++++++++++++--------------- scene/gui/tree.h | 4 ++-- 20 files changed, 82 insertions(+), 65 deletions(-) diff --git a/doc/classes/Button.xml b/doc/classes/Button.xml index 3d8730b588..f92cf8fabc 100644 --- a/doc/classes/Button.xml +++ b/doc/classes/Button.xml @@ -45,11 +45,11 @@ - + - + diff --git a/doc/classes/CheckBox.xml b/doc/classes/CheckBox.xml index 5583775f95..80b5e90717 100644 --- a/doc/classes/CheckBox.xml +++ b/doc/classes/CheckBox.xml @@ -23,11 +23,11 @@ - + - + diff --git a/doc/classes/CheckButton.xml b/doc/classes/CheckButton.xml index daed9128a9..f4d0e0657b 100644 --- a/doc/classes/CheckButton.xml +++ b/doc/classes/CheckButton.xml @@ -21,11 +21,11 @@ - + - + diff --git a/doc/classes/ItemList.xml b/doc/classes/ItemList.xml index 95c0e663ce..8515d1063d 100644 --- a/doc/classes/ItemList.xml +++ b/doc/classes/ItemList.xml @@ -505,7 +505,7 @@ - + diff --git a/doc/classes/LineEdit.xml b/doc/classes/LineEdit.xml index 482ec28c56..d90a290fdc 100644 --- a/doc/classes/LineEdit.xml +++ b/doc/classes/LineEdit.xml @@ -187,21 +187,21 @@ - + - + - + - + @@ -209,7 +209,7 @@ - + diff --git a/doc/classes/LinkButton.xml b/doc/classes/LinkButton.xml index 5dfb55a8dd..3e6b5e8c1a 100644 --- a/doc/classes/LinkButton.xml +++ b/doc/classes/LinkButton.xml @@ -32,9 +32,9 @@ - + - + diff --git a/doc/classes/MenuButton.xml b/doc/classes/MenuButton.xml index 609bf6317a..40d2160baa 100644 --- a/doc/classes/MenuButton.xml +++ b/doc/classes/MenuButton.xml @@ -46,11 +46,11 @@ - + - + diff --git a/doc/classes/OptionButton.xml b/doc/classes/OptionButton.xml index c44495ead9..0c2566e845 100644 --- a/doc/classes/OptionButton.xml +++ b/doc/classes/OptionButton.xml @@ -229,11 +229,11 @@ - + - + diff --git a/doc/classes/PopupMenu.xml b/doc/classes/PopupMenu.xml index a05aff9a59..3d6693da15 100644 --- a/doc/classes/PopupMenu.xml +++ b/doc/classes/PopupMenu.xml @@ -598,7 +598,7 @@ Sets a custom [Font]. - + Sets a custom [Color] for the [Font]. @@ -606,7 +606,7 @@ Sets a custom [Color] for disabled text. - + Sets a custom [Color] for the hovered text. diff --git a/doc/classes/ProgressBar.xml b/doc/classes/ProgressBar.xml index a8168958cf..96d377fd5e 100644 --- a/doc/classes/ProgressBar.xml +++ b/doc/classes/ProgressBar.xml @@ -24,7 +24,7 @@ - + diff --git a/doc/classes/ProjectSettings.xml b/doc/classes/ProjectSettings.xml index 3e9e063c0c..22dae4fe71 100644 --- a/doc/classes/ProjectSettings.xml +++ b/doc/classes/ProjectSettings.xml @@ -164,7 +164,7 @@ Comma-separated list of custom Android modules (which must have been built in the Android export templates) using their Java package path, e.g. [code]org/godotengine/org/GodotPaymentV3,org/godotengine/godot/MyCustomSingleton"[/code]. - + Background color for the boot splash. @@ -720,6 +720,8 @@ Default size of packet peer stream for deserializing Godot data. Over this size, data is dropped. + + diff --git a/doc/classes/RichTextLabel.xml b/doc/classes/RichTextLabel.xml index 405eb59563..81f5f44866 100644 --- a/doc/classes/RichTextLabel.xml +++ b/doc/classes/RichTextLabel.xml @@ -331,7 +331,7 @@ - + diff --git a/doc/classes/TabContainer.xml b/doc/classes/TabContainer.xml index 2eb8411078..22b009a15a 100644 --- a/doc/classes/TabContainer.xml +++ b/doc/classes/TabContainer.xml @@ -189,11 +189,11 @@ - + - + diff --git a/doc/classes/Tabs.xml b/doc/classes/Tabs.xml index b6d702ba45..6bd7b8c2c3 100644 --- a/doc/classes/Tabs.xml +++ b/doc/classes/Tabs.xml @@ -260,11 +260,11 @@ - + - + diff --git a/doc/classes/TextEdit.xml b/doc/classes/TextEdit.xml index e665178809..22c769330d 100644 --- a/doc/classes/TextEdit.xml +++ b/doc/classes/TextEdit.xml @@ -520,7 +520,7 @@ - + Sets the background [Color] of this [TextEdit]. [member syntax_highlighting] has to be enabled. @@ -533,17 +533,17 @@ - + - + - + - + @@ -553,7 +553,7 @@ - + Sets the [Color] of the breakpoints. [member breakpoint_gutter] has to be enabled. @@ -569,16 +569,16 @@ Sets the default [Font]. - + Sets the font [Color]. - + - + - + Sets the [Color] of the line numbers. [member show_line_numbers] has to be enabled. @@ -587,24 +587,24 @@ Sets the [Color] of marked text. - + Sets the [StyleBox] of this [TextEdit]. - + Sets the [StyleBox] of this [TextEdit] when [member readonly] is enabled. - + - + Sets the highlight [Color] of text selections. - + Sets a custom [Texture] for tab text characters. diff --git a/doc/classes/ToolButton.xml b/doc/classes/ToolButton.xml index 3511987474..f617c2a94f 100644 --- a/doc/classes/ToolButton.xml +++ b/doc/classes/ToolButton.xml @@ -23,11 +23,11 @@ - + - + diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml index 416a9eb656..22c74d4ca5 100644 --- a/doc/classes/Tree.xml +++ b/doc/classes/Tree.xml @@ -382,7 +382,7 @@ - + @@ -396,7 +396,7 @@ - + @@ -408,7 +408,7 @@ - + @@ -422,7 +422,7 @@ - + diff --git a/doc/classes/TreeItem.xml b/doc/classes/TreeItem.xml index d9c7013d34..3a4acb351d 100644 --- a/doc/classes/TreeItem.xml +++ b/doc/classes/TreeItem.xml @@ -337,6 +337,18 @@ Sets the given column's button [Texture] at index [code]button_idx[/code] to [code]button[/code]. + + + + + + + + + + + + diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp index 8624baa005..4005505830 100644 --- a/scene/gui/tree.cpp +++ b/scene/gui/tree.cpp @@ -571,21 +571,7 @@ int TreeItem::get_button_by_id(int p_column, int p_id) const { return -1; } -void TreeItem::set_disable_button(int p_column, int p_idx, bool p_disabled) { - ERR_FAIL_INDEX(p_column, cells.size()); - ERR_FAIL_INDEX(p_idx, cells[p_column].buttons.size()); - - cells.write[p_column].buttons.write[p_idx].disabled = p_disabled; - _changed_notify(p_column); -} -bool TreeItem::is_button_disabled(int p_column, int p_idx) const { - - ERR_FAIL_INDEX_V(p_column, cells.size(), false); - ERR_FAIL_INDEX_V(p_idx, cells[p_column].buttons.size(), false); - - return cells[p_column].buttons[p_idx].disabled; -} void TreeItem::set_button(int p_column, int p_idx, const Ref &p_button) { ERR_FAIL_COND(p_button.is_null()); @@ -603,6 +589,23 @@ void TreeItem::set_button_color(int p_column, int p_idx, const Color &p_color) { _changed_notify(p_column); } +void TreeItem::set_button_disabled(int p_column, int p_idx, bool p_disabled) { + + ERR_FAIL_INDEX(p_column, cells.size()); + ERR_FAIL_INDEX(p_idx, cells[p_column].buttons.size()); + + cells.write[p_column].buttons.write[p_idx].disabled = p_disabled; + _changed_notify(p_column); +} + +bool TreeItem::is_button_disabled(int p_column, int p_idx) const { + + ERR_FAIL_INDEX_V(p_column, cells.size(), false); + ERR_FAIL_INDEX_V(p_idx, cells[p_column].buttons.size(), false); + + return cells[p_column].buttons[p_idx].disabled; +} + void TreeItem::set_editable(int p_column, bool p_editable) { ERR_FAIL_INDEX(p_column, cells.size()); @@ -792,8 +795,8 @@ void TreeItem::_bind_methods() { ClassDB::bind_method(D_METHOD("get_button", "column", "button_idx"), &TreeItem::get_button); ClassDB::bind_method(D_METHOD("set_button", "column", "button_idx", "button"), &TreeItem::set_button); ClassDB::bind_method(D_METHOD("erase_button", "column", "button_idx"), &TreeItem::erase_button); + ClassDB::bind_method(D_METHOD("set_button_disabled", "column", "button_idx", "disabled"), &TreeItem::set_button_disabled); ClassDB::bind_method(D_METHOD("is_button_disabled", "column", "button_idx"), &TreeItem::is_button_disabled); - ClassDB::bind_method(D_METHOD("set_disable_button", "column", "button_idx", "disabled"), &TreeItem::set_disable_button); ClassDB::bind_method(D_METHOD("set_expand_right", "column", "enable"), &TreeItem::set_expand_right); ClassDB::bind_method(D_METHOD("get_expand_right", "column"), &TreeItem::get_expand_right); diff --git a/scene/gui/tree.h b/scene/gui/tree.h index 6e5e2c1eba..b6cdab766f 100644 --- a/scene/gui/tree.h +++ b/scene/gui/tree.h @@ -209,10 +209,10 @@ public: int get_button_id(int p_column, int p_idx) const; void erase_button(int p_column, int p_idx); int get_button_by_id(int p_column, int p_id) const; - bool is_button_disabled(int p_column, int p_idx) const; void set_button(int p_column, int p_idx, const Ref &p_button); void set_button_color(int p_column, int p_idx, const Color &p_color); - void set_disable_button(int p_column, int p_idx, bool p_disabled); + void set_button_disabled(int p_column, int p_idx, bool p_disabled); + bool is_button_disabled(int p_column, int p_idx) const; /* range works for mode number or mode combo */ -- cgit v1.2.3