Merge pull request #80285 from YeldhamDev/just_a_little_bit

Further separate icon from text of buttons in both editor and default themes
This commit is contained in:
Rémi Verschelde 2023-08-09 15:20:25 +02:00
commit f6b9d445b5
No known key found for this signature in database
GPG key ID: C3336907360768E1
8 changed files with 13 additions and 18 deletions

View file

@ -115,7 +115,7 @@
<theme_item name="icon_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
Icon modulate [Color] used when the [Button] is being pressed.
</theme_item>
<theme_item name="h_separation" data_type="constant" type="int" default="2">
<theme_item name="h_separation" data_type="constant" type="int" default="4">
The horizontal space between [Button]'s icon and text. Negative values will be treated as [code]0[/code] when used.
</theme_item>
<theme_item name="icon_max_width" data_type="constant" type="int" default="0">

View file

@ -74,7 +74,7 @@
<theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(0.8, 0.8, 0.8, 1)">
Text [Color] used when the [ColorPickerButton] is being pressed.
</theme_item>
<theme_item name="h_separation" data_type="constant" type="int" default="2">
<theme_item name="h_separation" data_type="constant" type="int" default="4">
The horizontal space between [ColorPickerButton]'s icon and text.
</theme_item>
<theme_item name="outline_size" data_type="constant" type="int" default="0">

View file

@ -69,7 +69,7 @@
<theme_item name="font_pressed_color" data_type="color" type="Color" default="Color(1, 1, 1, 1)">
Text [Color] used when the [MenuButton] is being pressed.
</theme_item>
<theme_item name="h_separation" data_type="constant" type="int" default="3">
<theme_item name="h_separation" data_type="constant" type="int" default="4">
The horizontal space between [MenuButton]'s icon and text. Negative values will be treated as [code]0[/code] when used.
</theme_item>
<theme_item name="outline_size" data_type="constant" type="int" default="0">

View file

@ -262,7 +262,7 @@
<theme_item name="arrow_margin" data_type="constant" type="int" default="4">
The horizontal space between the arrow icon and the right edge of the button.
</theme_item>
<theme_item name="h_separation" data_type="constant" type="int" default="2">
<theme_item name="h_separation" data_type="constant" type="int" default="4">
The horizontal space between [OptionButton]'s icon and text. Negative values will be treated as [code]0[/code] when used.
</theme_item>
<theme_item name="modulate_arrow" data_type="constant" type="int" default="0">

View file

@ -7856,7 +7856,6 @@ EditorNode::EditorNode() {
log = memnew(EditorLog);
Button *output_button = add_bottom_panel_item(TTR("Output"), log);
output_button->set_theme_type_variation("BottomPanelButton");
log->set_tool_button(output_button);
center_split->connect("resized", callable_mp(this, &EditorNode::_vp_resized));

View file

@ -914,7 +914,7 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("icon_pressed_color", "Button", icon_pressed_color);
theme->set_color("icon_disabled_color", "Button", icon_disabled_color);
theme->set_constant("h_separation", "Button", 2 * EDSCALE);
theme->set_constant("h_separation", "Button", 4 * EDSCALE);
theme->set_constant("outline_size", "Button", 0);
const float ACTION_BUTTON_EXTRA_MARGIN = 32 * EDSCALE;
@ -1479,9 +1479,6 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_stylebox("panel", "TabContainer", style_content_panel);
// Bottom panel.
theme->set_type_variation("BottomPanelButton", "Button");
// Add separation for the warning/error icon.
theme->set_constant("h_separation", "BottomPanelButton", 6 * EDSCALE);
Ref<StyleBoxFlat> style_bottom_panel = style_content_panel->duplicate();
style_bottom_panel->set_corner_radius_all(corner_radius * EDSCALE);
theme->set_stylebox("BottomPanel", "EditorStyles", style_bottom_panel);

View file

@ -54,7 +54,6 @@ DebuggerEditorPlugin::DebuggerEditorPlugin(PopupMenu *p_debug_menu) {
EditorDebuggerNode *debugger = memnew(EditorDebuggerNode);
Button *db = EditorNode::get_singleton()->add_bottom_panel_item(TTR("Debugger"), debugger);
db->set_theme_type_variation("BottomPanelButton");
debugger->set_tool_button(db);
// Main editor debug menu.

View file

@ -183,7 +183,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_color("icon_focus_color", "Button", Color(1, 1, 1, 1));
theme->set_color("icon_disabled_color", "Button", Color(1, 1, 1, 0.4));
theme->set_constant("h_separation", "Button", Math::round(2 * scale));
theme->set_constant("h_separation", "Button", Math::round(4 * scale));
theme->set_constant("icon_max_width", "Button", 0);
// MenuBar
@ -259,7 +259,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_color("font_disabled_color", "OptionButton", control_font_disabled_color);
theme->set_color("font_outline_color", "OptionButton", Color(1, 1, 1));
theme->set_constant("h_separation", "OptionButton", Math::round(2 * scale));
theme->set_constant("h_separation", "OptionButton", Math::round(4 * scale));
theme->set_constant("arrow_margin", "OptionButton", Math::round(4 * scale));
theme->set_constant("outline_size", "OptionButton", 0);
theme->set_constant("modulate_arrow", "OptionButton", false);
@ -282,7 +282,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_color("font_disabled_color", "MenuButton", Color(1, 1, 1, 0.3));
theme->set_color("font_outline_color", "MenuButton", Color(1, 1, 1));
theme->set_constant("h_separation", "MenuButton", Math::round(3 * scale));
theme->set_constant("h_separation", "MenuButton", Math::round(4 * scale));
theme->set_constant("outline_size", "MenuButton", 0);
// CheckBox
@ -788,7 +788,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_constant("children_hl_line_width", "Tree", 1);
theme->set_constant("parent_hl_line_margin", "Tree", 0);
theme->set_constant("draw_guides", "Tree", 1);
theme->set_constant("scroll_border", "Tree", 4);
theme->set_constant("scroll_border", "Tree", Math::round(4 * scale));
theme->set_constant("scroll_speed", "Tree", 12);
theme->set_constant("outline_size", "Tree", 0);
theme->set_constant("icon_max_width", "Tree", 0);
@ -803,9 +803,9 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_stylebox("panel", "ItemList", make_flat_stylebox(style_normal_color));
theme->set_stylebox("focus", "ItemList", focus);
theme->set_constant("h_separation", "ItemList", 4);
theme->set_constant("v_separation", "ItemList", 2);
theme->set_constant("icon_margin", "ItemList", 4);
theme->set_constant("h_separation", "ItemList", Math::round(4 * scale));
theme->set_constant("v_separation", "ItemList", Math::round(2 * scale));
theme->set_constant("icon_margin", "ItemList", Math::round(4 * scale));
theme->set_constant("line_separation", "ItemList", Math::round(2 * scale));
theme->set_font("font", "ItemList", Ref<Font>());
@ -1005,7 +1005,7 @@ void fill_default_theme(Ref<Theme> &theme, const Ref<Font> &default_font, const
theme->set_color("font_disabled_color", "ColorPickerButton", Color(0.9, 0.9, 0.9, 0.3));
theme->set_color("font_outline_color", "ColorPickerButton", Color(1, 1, 1));
theme->set_constant("h_separation", "ColorPickerButton", Math::round(2 * scale));
theme->set_constant("h_separation", "ColorPickerButton", Math::round(4 * scale));
theme->set_constant("outline_size", "ColorPickerButton", 0);
// ColorPresetButton