forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update
ColorPicker
, FoldableContainer
and add a new ColorButton
…
… node. (#248) * Improve Editor Inspector/Theme item lookup performance Changes to reduce the latency between changing node selection in the editor and seeing the new node reflected in the Inspector tab - Use Vector instead of List for ThemeOwner::get_theme_type_dependencies and related functions - Use Vector instead of List for ThemeContext::themes, set_themes(), and get_themes() - Add ClassDB:get_inheritance_chain_nocheck to get all parent/ancestor classes at once, to avoid repeated ClassDB locking overhead - Update BIND_THEME_ITEM macros and ThemeDB::update_class_instance_items to use provided StringNames for call to ThemeItemSetter, instead of creating a new StringName in each call These changes reduce the time taken by EditorInspector::update_tree by around 30-35% * Add new `ColorButton` node. * Update `FoldableContainer` Allow adding empty buttons. Rename the arrow theme items. * Update `ColorPicker` --------- Co-authored-by: aaronp64 <aaronp.code@gmail.com>
- Loading branch information
1 parent
a6b0ca3
commit e9d3187
Showing
34 changed files
with
769 additions
and
575 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<class name="ColorButton" inherits="BaseButton" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd"> | ||
<brief_description> | ||
A Button That displays a color. | ||
</brief_description> | ||
<description> | ||
A Button That displays a color. | ||
</description> | ||
<tutorials> | ||
</tutorials> | ||
<methods> | ||
<method name="set_color"> | ||
<return type="void" /> | ||
<param index="0" name="color" type="Color" /> | ||
<description> | ||
Changes the button's color and emits [signal color_changed]. | ||
</description> | ||
</method> | ||
</methods> | ||
<members> | ||
<member name="color" type="Color" setter="set_color_no_signal" getter="get_color" default="Color(1, 1, 1, 1)"> | ||
The button's display color. | ||
</member> | ||
<member name="flat" type="bool" setter="set_flat" getter="is_flat" default="false"> | ||
Draws the buttons without the styles. | ||
</member> | ||
</members> | ||
<signals> | ||
<signal name="color_changed"> | ||
<param index="0" name="color" type="Color" /> | ||
<description> | ||
Emitted when the color is changed. | ||
</description> | ||
</signal> | ||
</signals> | ||
<theme_items> | ||
<theme_item name="bg" data_type="icon" type="Texture2D"> | ||
The background image displayed behind the color when the color alpha is less than one. | ||
</theme_item> | ||
<theme_item name="overbright_indicator" data_type="icon" type="Texture2D"> | ||
The indicator used to signalize that the color value is outside the 0-1 range. | ||
</theme_item> | ||
<theme_item name="disabled" data_type="style" type="StyleBox"> | ||
[StyleBox] used when the [Button] is disabled. | ||
</theme_item> | ||
<theme_item name="focus" data_type="style" type="StyleBox"> | ||
[StyleBox] used when the [Button] is focused. The [theme_item focus] [StyleBox] is displayed [i]over[/i] the base [StyleBox], so a partially transparent [StyleBox] should be used to ensure the base [StyleBox] remains visible. A [StyleBox] that represents an outline or an underline works well for this purpose. To disable the focus visual effect, assign a [StyleBoxEmpty] resource. Note that disabling the focus visual effect will harm keyboard/controller navigation usability, so this is not recommended for accessibility reasons. | ||
</theme_item> | ||
<theme_item name="hover" data_type="style" type="StyleBox"> | ||
[StyleBox] used when the [Button] is being hovered. | ||
</theme_item> | ||
<theme_item name="hover_pressed" data_type="style" type="StyleBox"> | ||
[StyleBox] used when the [Button] is being pressed and hovered at the same time. | ||
</theme_item> | ||
<theme_item name="normal" data_type="style" type="StyleBox"> | ||
Default [StyleBox] for the [Button]. | ||
</theme_item> | ||
<theme_item name="pressed" data_type="style" type="StyleBox"> | ||
[StyleBox] used when the [Button] is being pressed. | ||
</theme_item> | ||
</theme_items> | ||
</class> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.