mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
WindowServer: Use user-defined background color, if defined
Use the configured desktop background color, if defined, otherwise default to the current theme's background color. If a user chooses a background color via "desktop settings", then this new color will always be used. Switching themes will delete the user-defined background color, so the background color resets to the theme's defined color.
This commit is contained in:
parent
f02d976ed7
commit
33eb9a6ddc
Notes:
sideshowbarker
2024-07-18 17:01:52 +09:00
Author: https://github.com/matthewbjones 🔰 Commit: https://github.com/SerenityOS/serenity/commit/33eb9a6ddcd Pull-request: https://github.com/SerenityOS/serenity/pull/7680 Issue: https://github.com/SerenityOS/serenity/issues/7382
@ -1545,7 +1545,7 @@ Gfx::IntRect WindowManager::dnd_rect() const
|
|||||||
|
|
||||||
void WindowManager::invalidate_after_theme_or_font_change()
|
void WindowManager::invalidate_after_theme_or_font_change()
|
||||||
{
|
{
|
||||||
Compositor::the().set_background_color(palette().desktop_background().to_string());
|
Compositor::the().set_background_color(m_config->read_entry("Background", "Color", palette().desktop_background().to_string()));
|
||||||
WindowFrame::reload_config();
|
WindowFrame::reload_config();
|
||||||
for_each_window([&](Window& window) {
|
for_each_window([&](Window& window) {
|
||||||
window.frame().theme_changed();
|
window.frame().theme_changed();
|
||||||
@ -1569,6 +1569,7 @@ bool WindowManager::update_theme(String theme_path, String theme_name)
|
|||||||
m_palette = Gfx::PaletteImpl::create_with_anonymous_buffer(new_theme);
|
m_palette = Gfx::PaletteImpl::create_with_anonymous_buffer(new_theme);
|
||||||
auto wm_config = Core::ConfigFile::open("/etc/WindowServer.ini");
|
auto wm_config = Core::ConfigFile::open("/etc/WindowServer.ini");
|
||||||
wm_config->write_entry("Theme", "Name", theme_name);
|
wm_config->write_entry("Theme", "Name", theme_name);
|
||||||
|
wm_config->remove_entry("Background", "Color");
|
||||||
wm_config->sync();
|
wm_config->sync();
|
||||||
invalidate_after_theme_or_font_change();
|
invalidate_after_theme_or_font_change();
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user