Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Color match editor log toggles and flat pressed buttons #82365

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions editor/editor_log.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,9 @@ EditorLog::EditorLog() {
copy_button->connect("pressed", callable_mp(this, &EditorLog::_copy_request));
hb_tools->add_child(copy_button);

// Separate toggle buttons from normal buttons.
vb_right->add_child(memnew(HSeparator));

// A second hbox to make a 2x2 grid of buttons.
HBoxContainer *hb_tools2 = memnew(HBoxContainer);
hb_tools2->set_h_size_flags(SIZE_SHRINK_CENTER);
Expand Down
7 changes: 4 additions & 3 deletions editor/editor_themes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1030,9 +1030,9 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
}

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

Expand Down Expand Up @@ -1074,7 +1074,8 @@ Ref<Theme> create_editor_theme(const Ref<Theme> p_theme) {
theme->set_color("icon_normal_color", "EditorLogFilterButton", icon_disabled_color);
// When pressed, add a small bottom border to the buttons to better show their active state,
// similar to active tabs.
Ref<StyleBoxFlat> editor_log_button_pressed = style_widget_pressed->duplicate();

Ref<StyleBoxFlat> editor_log_button_pressed = style_flat_button_pressed->duplicate();
editor_log_button_pressed->set_border_width(SIDE_BOTTOM, 2 * EDSCALE);
editor_log_button_pressed->set_border_color(accent_color);
theme->set_stylebox("pressed", "EditorLogFilterButton", editor_log_button_pressed);
Expand Down
Loading