Skip to content

Commit f0d86f3

Browse files
committedSep 26, 2023
Merge pull request #82365 from YuriSizov/editor-colormatch-pressed-buttons
Color match editor log toggles and flat pressed buttons
2 parents 1a7ea4b + cdec1ee commit f0d86f3

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed
 

‎editor/editor_log.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -442,6 +442,9 @@ EditorLog::EditorLog() {
442442
copy_button->connect("pressed", callable_mp(this, &EditorLog::_copy_request));
443443
hb_tools->add_child(copy_button);
444444

445+
// Separate toggle buttons from normal buttons.
446+
vb_right->add_child(memnew(HSeparator));
447+
445448
// A second hbox to make a 2x2 grid of buttons.
446449
HBoxContainer *hb_tools2 = memnew(HBoxContainer);
447450
hb_tools2->set_h_size_flags(SIZE_SHRINK_CENTER);

‎editor/editor_themes.cpp

+4-3
Original file line numberDiff line numberDiff line change
@@ -1030,9 +1030,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
10301030
}
10311031

10321032
Ref<StyleBoxFlat> style_flat_button_pressed = style_widget_pressed->duplicate();
1033-
Color flat_pressed_color = dark_color_1.lerp(accent_color, 0.2) * Color(0.8, 0.8, 0.8, 0.85);
1033+
Color flat_pressed_color = dark_color_1.lightened(0.24).lerp(accent_color, 0.2) * Color(0.8, 0.8, 0.8, 0.85);
10341034
if (dark_theme) {
1035-
flat_pressed_color = dark_color_1.lerp(accent_color, 0.2) * Color(0.6, 0.6, 0.6, 0.85);
1035+
flat_pressed_color = dark_color_1.lerp(accent_color, 0.12) * Color(0.6, 0.6, 0.6, 0.85);
10361036
}
10371037
style_flat_button_pressed->set_bg_color(flat_pressed_color);
10381038

@@ -1074,7 +1074,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
10741074
theme->set_color("icon_normal_color", "EditorLogFilterButton", icon_disabled_color);
10751075
// When pressed, add a small bottom border to the buttons to better show their active state,
10761076
// similar to active tabs.
1077-
Ref<StyleBoxFlat> editor_log_button_pressed = style_widget_pressed->duplicate();
1077+
1078+
Ref<StyleBoxFlat> editor_log_button_pressed = style_flat_button_pressed->duplicate();
10781079
editor_log_button_pressed->set_border_width(SIDE_BOTTOM, 2 * EDSCALE);
10791080
editor_log_button_pressed->set_border_color(accent_color);
10801081
theme->set_stylebox("pressed", "EditorLogFilterButton", editor_log_button_pressed);

0 commit comments

Comments
 (0)
Please sign in to comment.