TreeItem: Rename new button disable method to set_button_disabled

Follow-up to #30408.

Also sync classref with current source.
This commit is contained in:
Rémi Verschelde 2019-07-09 09:13:00 +02:00
parent 2633efd55b
commit 9580c2b13e
20 changed files with 82 additions and 65 deletions

View file

@ -45,11 +45,11 @@
</theme_item>
<theme_item name="font" type="Font">
</theme_item>
<theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )">
<theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
</theme_item>
<theme_item name="font_color_disabled" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )">
</theme_item>
<theme_item name="font_color_hover" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )">
<theme_item name="font_color_hover" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
</theme_item>
<theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
</theme_item>

View file

@ -23,11 +23,11 @@
</theme_item>
<theme_item name="font" type="Font">
</theme_item>
<theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )">
<theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
</theme_item>
<theme_item name="font_color_disabled" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )">
</theme_item>
<theme_item name="font_color_hover" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )">
<theme_item name="font_color_hover" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
</theme_item>
<theme_item name="font_color_hover_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
</theme_item>

View file

@ -21,11 +21,11 @@
</theme_item>
<theme_item name="font" type="Font">
</theme_item>
<theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )">
<theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
</theme_item>
<theme_item name="font_color_disabled" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )">
</theme_item>
<theme_item name="font_color_hover" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )">
<theme_item name="font_color_hover" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
</theme_item>
<theme_item name="font_color_hover_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
</theme_item>

View file

@ -505,7 +505,7 @@
</theme_item>
<theme_item name="font" type="Font">
</theme_item>
<theme_item name="font_color" type="Color" default="Color( 0.627451, 0.627451, 0.627451, 1 )">
<theme_item name="font_color" type="Color" default="Color( 0.63, 0.63, 0.63, 1 )">
</theme_item>
<theme_item name="font_color_selected" type="Color" default="Color( 1, 1, 1, 1 )">
</theme_item>

View file

@ -187,21 +187,21 @@
<theme_items>
<theme_item name="clear" type="Texture">
</theme_item>
<theme_item name="clear_button_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )">
<theme_item name="clear_button_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
</theme_item>
<theme_item name="clear_button_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
</theme_item>
<theme_item name="cursor_color" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )">
<theme_item name="cursor_color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
</theme_item>
<theme_item name="focus" type="StyleBox">
</theme_item>
<theme_item name="font" type="Font">
</theme_item>
<theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )">
<theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
</theme_item>
<theme_item name="font_color_selected" type="Color" default="Color( 0, 0, 0, 1 )">
</theme_item>
<theme_item name="font_color_uneditable" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 0.5 )">
<theme_item name="font_color_uneditable" type="Color" default="Color( 0.88, 0.88, 0.88, 0.5 )">
</theme_item>
<theme_item name="minimum_spaces" type="int" default="12">
</theme_item>
@ -209,7 +209,7 @@
</theme_item>
<theme_item name="read_only" type="StyleBox">
</theme_item>
<theme_item name="selection_color" type="Color" default="Color( 0.490196, 0.490196, 0.490196, 1 )">
<theme_item name="selection_color" type="Color" default="Color( 0.49, 0.49, 0.49, 1 )">
</theme_item>
</theme_items>
</class>

View file

@ -32,9 +32,9 @@
</theme_item>
<theme_item name="font" type="Font">
</theme_item>
<theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )">
<theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
</theme_item>
<theme_item name="font_color_hover" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )">
<theme_item name="font_color_hover" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
</theme_item>
<theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
</theme_item>

View file

@ -46,11 +46,11 @@
</theme_item>
<theme_item name="font" type="Font">
</theme_item>
<theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )">
<theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
</theme_item>
<theme_item name="font_color_disabled" type="Color" default="Color( 1, 1, 1, 0.3 )">
</theme_item>
<theme_item name="font_color_hover" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )">
<theme_item name="font_color_hover" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
</theme_item>
<theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
</theme_item>

View file

@ -229,11 +229,11 @@
</theme_item>
<theme_item name="font" type="Font">
</theme_item>
<theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )">
<theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
</theme_item>
<theme_item name="font_color_disabled" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )">
</theme_item>
<theme_item name="font_color_hover" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )">
<theme_item name="font_color_hover" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
</theme_item>
<theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
</theme_item>

View file

@ -598,7 +598,7 @@
<theme_item name="font" type="Font">
Sets a custom [Font].
</theme_item>
<theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )">
<theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
Sets a custom [Color] for the [Font].
</theme_item>
<theme_item name="font_color_accel" type="Color" default="Color( 0.7, 0.7, 0.7, 0.8 )">
@ -606,7 +606,7 @@
<theme_item name="font_color_disabled" type="Color" default="Color( 0.4, 0.4, 0.4, 0.8 )">
Sets a custom [Color] for disabled text.
</theme_item>
<theme_item name="font_color_hover" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )">
<theme_item name="font_color_hover" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
Sets a custom [Color] for the hovered text.
</theme_item>
<theme_item name="hover" type="StyleBox">

View file

@ -24,7 +24,7 @@
</theme_item>
<theme_item name="font" type="Font">
</theme_item>
<theme_item name="font_color" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )">
<theme_item name="font_color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
</theme_item>
<theme_item name="font_color_shadow" type="Color" default="Color( 0, 0, 0, 1 )">
</theme_item>

View file

@ -164,7 +164,7 @@
<member name="android/modules" type="String" setter="" getter="" default="&quot;&quot;">
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].
</member>
<member name="application/boot_splash/bg_color" type="Color" setter="" getter="" default="Color( 0.137255, 0.137255, 0.137255, 1 )">
<member name="application/boot_splash/bg_color" type="Color" setter="" getter="" default="Color( 0.14, 0.14, 0.14, 1 )">
Background color for the boot splash.
</member>
<member name="application/boot_splash/fullsize" type="bool" setter="" getter="" default="true">
@ -720,6 +720,8 @@
<member name="network/limits/packet_peer_stream/max_buffer_po2" type="int" setter="" getter="" default="16">
Default size of packet peer stream for deserializing Godot data. Over this size, data is dropped.
</member>
<member name="network/limits/tcp/connect_timeout_seconds" type="int" setter="" getter="" default="30">
</member>
<member name="network/limits/websocket_client/max_in_buffer_kb" type="int" setter="" getter="" default="64">
</member>
<member name="network/limits/websocket_client/max_in_packets" type="int" setter="" getter="" default="1024">

View file

@ -331,7 +331,7 @@
</theme_item>
<theme_item name="focus" type="StyleBox">
</theme_item>
<theme_item name="font_color_selected" type="Color" default="Color( 0.490196, 0.490196, 0.490196, 1 )">
<theme_item name="font_color_selected" type="Color" default="Color( 0.49, 0.49, 0.49, 1 )">
</theme_item>
<theme_item name="font_color_shadow" type="Color" default="Color( 0, 0, 0, 0 )">
</theme_item>

View file

@ -189,11 +189,11 @@
</theme_item>
<theme_item name="font" type="Font">
</theme_item>
<theme_item name="font_color_bg" type="Color" default="Color( 0.690196, 0.690196, 0.690196, 1 )">
<theme_item name="font_color_bg" type="Color" default="Color( 0.69, 0.69, 0.69, 1 )">
</theme_item>
<theme_item name="font_color_disabled" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )">
</theme_item>
<theme_item name="font_color_fg" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )">
<theme_item name="font_color_fg" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
</theme_item>
<theme_item name="hseparation" type="int" default="4">
</theme_item>

View file

@ -260,11 +260,11 @@
</theme_item>
<theme_item name="font" type="Font">
</theme_item>
<theme_item name="font_color_bg" type="Color" default="Color( 0.690196, 0.690196, 0.690196, 1 )">
<theme_item name="font_color_bg" type="Color" default="Color( 0.69, 0.69, 0.69, 1 )">
</theme_item>
<theme_item name="font_color_disabled" type="Color" default="Color( 0.9, 0.9, 0.9, 0.2 )">
</theme_item>
<theme_item name="font_color_fg" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )">
<theme_item name="font_color_fg" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
</theme_item>
<theme_item name="hseparation" type="int" default="4">
</theme_item>

View file

@ -520,7 +520,7 @@
</constant>
</constants>
<theme_items>
<theme_item name="background_color" type="Color" default="Color( 0, 0, 0, 0 )">
<theme_item name="background_color" type="Color" default="Color( 0, 0, 0, 1 )">
Sets the background [Color] of this [TextEdit]. [member syntax_highlighting] has to be enabled.
</theme_item>
<theme_item name="bookmark_color" type="Color" default="Color( 0.08, 0.49, 0.98, 1 )">
@ -533,17 +533,17 @@
</theme_item>
<theme_item name="caret_background_color" type="Color" default="Color( 0, 0, 0, 1 )">
</theme_item>
<theme_item name="caret_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )">
<theme_item name="caret_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
</theme_item>
<theme_item name="code_folding_color" type="Color" default="Color( 0.8, 0.8, 0.8, 0.8 )">
</theme_item>
<theme_item name="completion" type="StyleBox">
</theme_item>
<theme_item name="completion_background_color" type="Color" default="Color( 0.172549, 0.164706, 0.196078, 1 )">
<theme_item name="completion_background_color" type="Color" default="Color( 0.17, 0.16, 0.2, 1 )">
</theme_item>
<theme_item name="completion_existing_color" type="Color" default="Color( 0.87451, 0.87451, 0.87451, 0.129412 )">
<theme_item name="completion_existing_color" type="Color" default="Color( 0.87, 0.87, 0.87, 0.13 )">
</theme_item>
<theme_item name="completion_font_color" type="Color" default="Color( 0.666667, 0.666667, 0.666667, 1 )">
<theme_item name="completion_font_color" type="Color" default="Color( 0.67, 0.67, 0.67, 1 )">
</theme_item>
<theme_item name="completion_lines" type="int" default="7">
</theme_item>
@ -553,7 +553,7 @@
</theme_item>
<theme_item name="completion_scroll_width" type="int" default="3">
</theme_item>
<theme_item name="completion_selected_color" type="Color" default="Color( 0.262745, 0.258824, 0.266667, 1 )">
<theme_item name="completion_selected_color" type="Color" default="Color( 0.26, 0.26, 0.27, 1 )">
</theme_item>
<theme_item name="current_line_color" type="Color" default="Color( 0.25, 0.25, 0.26, 0.8 )">
Sets the [Color] of the breakpoints. [member breakpoint_gutter] has to be enabled.
@ -569,16 +569,16 @@
<theme_item name="font" type="Font">
Sets the default [Font].
</theme_item>
<theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )">
<theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
Sets the font [Color].
</theme_item>
<theme_item name="font_color_readonly" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 0.5 )">
<theme_item name="font_color_readonly" type="Color" default="Color( 0.88, 0.88, 0.88, 0.5 )">
</theme_item>
<theme_item name="font_color_selected" type="Color" default="Color( 0, 0, 0, 1 )">
</theme_item>
<theme_item name="function_color" type="Color" default="Color( 0.4, 0.635294, 0.807843, 1 )">
<theme_item name="function_color" type="Color" default="Color( 0.4, 0.64, 0.81, 1 )">
</theme_item>
<theme_item name="line_number_color" type="Color" default="Color( 0.666667, 0.666667, 0.666667, 0.4 )">
<theme_item name="line_number_color" type="Color" default="Color( 0.67, 0.67, 0.67, 0.4 )">
Sets the [Color] of the line numbers. [member show_line_numbers] has to be enabled.
</theme_item>
<theme_item name="line_spacing" type="int" default="4">
@ -587,24 +587,24 @@
<theme_item name="mark_color" type="Color" default="Color( 1, 0.4, 0.4, 0.4 )">
Sets the [Color] of marked text.
</theme_item>
<theme_item name="member_variable_color" type="Color" default="Color( 0.901961, 0.305882, 0.34902, 1 )">
<theme_item name="member_variable_color" type="Color" default="Color( 0.9, 0.31, 0.35, 1 )">
</theme_item>
<theme_item name="normal" type="StyleBox">
Sets the [StyleBox] of this [TextEdit].
</theme_item>
<theme_item name="number_color" type="Color" default="Color( 0.921569, 0.584314, 0.196078, 1 )">
<theme_item name="number_color" type="Color" default="Color( 0.92, 0.58, 0.2, 1 )">
</theme_item>
<theme_item name="read_only" type="StyleBox">
Sets the [StyleBox] of this [TextEdit] when [member readonly] is enabled.
</theme_item>
<theme_item name="safe_line_number_color" type="Color" default="Color( 0.666667, 0.784314, 0.666667, 0.6 )">
<theme_item name="safe_line_number_color" type="Color" default="Color( 0.67, 0.78, 0.67, 0.6 )">
</theme_item>
<theme_item name="selection_color" type="Color" default="Color( 0.490196, 0.490196, 0.490196, 1 )">
<theme_item name="selection_color" type="Color" default="Color( 0.49, 0.49, 0.49, 1 )">
Sets the highlight [Color] of text selections.
</theme_item>
<theme_item name="space" type="Texture">
</theme_item>
<theme_item name="symbol_color" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )">
<theme_item name="symbol_color" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
</theme_item>
<theme_item name="tab" type="Texture">
Sets a custom [Texture] for tab text characters.

View file

@ -23,11 +23,11 @@
</theme_item>
<theme_item name="font" type="Font">
</theme_item>
<theme_item name="font_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )">
<theme_item name="font_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
</theme_item>
<theme_item name="font_color_disabled" type="Color" default="Color( 0.9, 0.95, 1, 0.3 )">
</theme_item>
<theme_item name="font_color_hover" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )">
<theme_item name="font_color_hover" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
</theme_item>
<theme_item name="font_color_pressed" type="Color" default="Color( 1, 1, 1, 1 )">
</theme_item>

View file

@ -382,7 +382,7 @@
</theme_item>
<theme_item name="custom_button" type="StyleBox">
</theme_item>
<theme_item name="custom_button_font_highlight" type="Color" default="Color( 0.941176, 0.941176, 0.941176, 1 )">
<theme_item name="custom_button_font_highlight" type="Color" default="Color( 0.94, 0.94, 0.94, 1 )">
</theme_item>
<theme_item name="custom_button_hover" type="StyleBox">
</theme_item>
@ -396,7 +396,7 @@
</theme_item>
<theme_item name="font" type="Font">
</theme_item>
<theme_item name="font_color" type="Color" default="Color( 0.690196, 0.690196, 0.690196, 1 )">
<theme_item name="font_color" type="Color" default="Color( 0.69, 0.69, 0.69, 1 )">
</theme_item>
<theme_item name="font_color_selected" type="Color" default="Color( 1, 1, 1, 1 )">
</theme_item>
@ -408,7 +408,7 @@
</theme_item>
<theme_item name="item_margin" type="int" default="12">
</theme_item>
<theme_item name="relationship_line_color" type="Color" default="Color( 0.27451, 0.27451, 0.27451, 1 )">
<theme_item name="relationship_line_color" type="Color" default="Color( 0.27, 0.27, 0.27, 1 )">
</theme_item>
<theme_item name="scroll_border" type="int" default="4">
</theme_item>
@ -422,7 +422,7 @@
</theme_item>
<theme_item name="selection_color" type="Color" default="Color( 0.1, 0.1, 1, 0.8 )">
</theme_item>
<theme_item name="title_button_color" type="Color" default="Color( 0.878431, 0.878431, 0.878431, 1 )">
<theme_item name="title_button_color" type="Color" default="Color( 0.88, 0.88, 0.88, 1 )">
</theme_item>
<theme_item name="title_button_font" type="Font">
</theme_item>

View file

@ -337,6 +337,18 @@
Sets the given column's button [Texture] at index [code]button_idx[/code] to [code]button[/code].
</description>
</method>
<method name="set_button_disabled">
<return type="void">
</return>
<argument index="0" name="column" type="int">
</argument>
<argument index="1" name="button_idx" type="int">
</argument>
<argument index="2" name="disabled" type="bool">
</argument>
<description>
</description>
</method>
<method name="set_cell_mode">
<return type="void">
</return>

View file

@ -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<Texture> &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);

View file

@ -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<Texture> &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 */