diff --git a/Base/res/icons/16x16/window-close-modified-2x.png b/Base/res/icons/16x16/window-close-modified-2x.png new file mode 100644 index 00000000000..f714d1a2e63 Binary files /dev/null and b/Base/res/icons/16x16/window-close-modified-2x.png differ diff --git a/Base/res/icons/16x16/window-close-modified.png b/Base/res/icons/16x16/window-close-modified.png new file mode 100644 index 00000000000..95657d3e4c4 Binary files /dev/null and b/Base/res/icons/16x16/window-close-modified.png differ diff --git a/Base/res/icons/themes/Coffee/16x16/window-close-modified.png b/Base/res/icons/themes/Coffee/16x16/window-close-modified.png new file mode 100644 index 00000000000..aa16575f356 Binary files /dev/null and b/Base/res/icons/themes/Coffee/16x16/window-close-modified.png differ diff --git a/Base/res/icons/themes/Redmond/16x16/window-close-modified.png b/Base/res/icons/themes/Redmond/16x16/window-close-modified.png new file mode 100644 index 00000000000..7eaaf706770 Binary files /dev/null and b/Base/res/icons/themes/Redmond/16x16/window-close-modified.png differ diff --git a/Base/res/icons/themes/Sunshine/16x16/window-close-modified.png b/Base/res/icons/themes/Sunshine/16x16/window-close-modified.png new file mode 100644 index 00000000000..4e79eba6d36 Binary files /dev/null and b/Base/res/icons/themes/Sunshine/16x16/window-close-modified.png differ diff --git a/Userland/Services/WindowServer/Window.cpp b/Userland/Services/WindowServer/Window.cpp index 1d7a6687419..8ffc784d5e9 100644 --- a/Userland/Services/WindowServer/Window.cpp +++ b/Userland/Services/WindowServer/Window.cpp @@ -998,6 +998,7 @@ void Window::set_modified(bool modified) return; m_modified = modified; + frame().set_button_icons(); frame().invalidate_titlebar(); } diff --git a/Userland/Services/WindowServer/Window.h b/Userland/Services/WindowServer/Window.h index c2db7b8bb3b..a1785bf6482 100644 --- a/Userland/Services/WindowServer/Window.h +++ b/Userland/Services/WindowServer/Window.h @@ -371,6 +371,7 @@ private: bool m_invalidated_all { true }; bool m_invalidated_frame { true }; bool m_hit_testing_enabled { true }; + bool m_modified { false }; WindowTileType m_tiled { WindowTileType::None }; Gfx::IntRect m_untiled_rect; bool m_occluded { false }; @@ -400,7 +401,6 @@ private: int m_minimize_animation_step { -1 }; Optional m_progress; bool m_should_show_menubar { true }; - bool m_modified { false }; }; } diff --git a/Userland/Services/WindowServer/WindowFrame.cpp b/Userland/Services/WindowServer/WindowFrame.cpp index 21e4136b1fa..167890fef20 100644 --- a/Userland/Services/WindowServer/WindowFrame.cpp +++ b/Userland/Services/WindowServer/WindowFrame.cpp @@ -38,6 +38,7 @@ static Gfx::Bitmap* s_minimize_icon; static Gfx::Bitmap* s_maximize_icon; static Gfx::Bitmap* s_restore_icon; static Gfx::Bitmap* s_close_icon; +static Gfx::Bitmap* s_close_modified_icon; static String s_last_title_button_icons_path; static int s_last_title_button_icons_scale; @@ -102,7 +103,7 @@ void WindowFrame::set_button_icons() if (m_window.is_frameless()) return; - m_close_button->set_icon(*s_close_icon); + m_close_button->set_icon(m_window.is_modified() ? *s_close_modified_icon : *s_close_icon); if (m_window.is_minimizable()) m_minimize_button->set_icon(*s_minimize_icon); if (m_window.is_resizable()) @@ -151,6 +152,15 @@ void WindowFrame::reload_config() s_close_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/window-close.png", icons_scale).leak_ref(); full_path.clear(); } + if (!s_close_modified_icon || s_last_title_button_icons_path != icons_path || s_last_title_button_icons_scale != icons_scale) { + full_path.append(icons_path); + full_path.append("window-close-modified.png"); + if (s_close_modified_icon) + s_close_modified_icon->unref(); + if (!(s_close_modified_icon = Gfx::Bitmap::load_from_file(full_path.to_string(), icons_scale).leak_ref())) + s_close_modified_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/window-close-modified.png", icons_scale).leak_ref(); + full_path.clear(); + } s_last_title_button_icons_path = icons_path; s_last_title_button_icons_scale = icons_scale;