Skip to content

Commit 0af7559

Browse files
committed
Merge pull request godotengine#91236 from ckaiser/audio_bus_contrast
Improve Audio Bus button pressed state visibility
2 parents bf00e1e + 0c8ff88 commit 0af7559

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

editor/editor_audio_buses.cpp

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,14 @@ void EditorAudioBus::_notification(int p_what) {
8787

8888
disabled_vu = get_editor_theme_icon(SNAME("BusVuFrozen"));
8989

90-
Color solo_color = EditorThemeManager::is_dark_theme() ? Color(1.0, 0.89, 0.22) : Color(1.0, 0.92, 0.44);
91-
Color mute_color = EditorThemeManager::is_dark_theme() ? Color(1.0, 0.16, 0.16) : Color(1.0, 0.44, 0.44);
92-
Color bypass_color = EditorThemeManager::is_dark_theme() ? Color(0.13, 0.8, 1.0) : Color(0.44, 0.87, 1.0);
90+
Color solo_color = EditorThemeManager::is_dark_theme() ? Color(1.0, 0.89, 0.22) : Color(1.9, 1.74, 0.83);
91+
Color mute_color = EditorThemeManager::is_dark_theme() ? Color(1.0, 0.16, 0.16) : Color(2.35, 1.03, 1.03);
92+
Color bypass_color = EditorThemeManager::is_dark_theme() ? Color(0.13, 0.8, 1.0) : Color(1.03, 2.04, 2.35);
93+
float darkening_factor = EditorThemeManager::is_dark_theme() ? 0.15 : 0.65;
94+
95+
Ref<StyleBoxFlat>(solo->get_theme_stylebox("pressed"))->set_border_color(solo_color.darkened(darkening_factor));
96+
Ref<StyleBoxFlat>(mute->get_theme_stylebox("pressed"))->set_border_color(mute_color.darkened(darkening_factor));
97+
Ref<StyleBoxFlat>(bypass->get_theme_stylebox("pressed"))->set_border_color(bypass_color.darkened(darkening_factor));
9398

9499
solo->set_icon(get_editor_theme_icon(SNAME("AudioBusSolo")));
95100
solo->add_theme_color_override("icon_pressed_color", solo_color);
@@ -835,7 +840,13 @@ EditorAudioBus::EditorAudioBus(EditorAudioBuses *p_buses, bool p_is_master) {
835840
child->add_theme_style_override("normal", sbempty);
836841
child->add_theme_style_override("hover", sbempty);
837842
child->add_theme_style_override("focus", sbempty);
838-
child->add_theme_style_override("pressed", sbempty);
843+
844+
Ref<StyleBoxFlat> sbflat = memnew(StyleBoxFlat);
845+
sbflat->set_content_margin_all(0);
846+
sbflat->set_bg_color(Color(1, 1, 1, 0));
847+
sbflat->set_border_width(Side::SIDE_BOTTOM, Math::round(3 * EDSCALE));
848+
child->add_theme_style_override("pressed", sbflat);
849+
839850
child->end_bulk_theme_override();
840851
}
841852

0 commit comments

Comments
 (0)