mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
LibGfx+WindowServer: Add theme flag TitleButtonsIconOnly
With this flag set to true only the icon of the title button is painted. This is useful for themes with a more non-serenity look such as Coffee and Cupertino (that currently try to hide the button).
This commit is contained in:
parent
5998e7f8a2
commit
9b30fe9864
Notes:
sideshowbarker
2024-07-17 11:33:02 +09:00
Author: https://github.com/MacDue
Commit: 9b30fe9864
Pull-request: https://github.com/SerenityOS/serenity/pull/13782
Reviewed-by: https://github.com/linusg
5 changed files with 27 additions and 5 deletions
|
@ -120,12 +120,22 @@ void WindowFrame::set_button_icons()
|
|||
if (m_window.is_frameless())
|
||||
return;
|
||||
|
||||
if (m_window.is_closeable())
|
||||
auto button_style = WindowManager::the().palette().title_buttons_icon_only()
|
||||
? Button::Style::IconOnly
|
||||
: Button::Style::Normal;
|
||||
|
||||
if (m_window.is_closeable()) {
|
||||
m_close_button->set_icon(m_window.is_modified() ? *s_close_modified_icon : *s_close_icon);
|
||||
if (m_window.is_minimizable())
|
||||
m_close_button->set_style(button_style);
|
||||
}
|
||||
if (m_window.is_minimizable()) {
|
||||
m_minimize_button->set_icon(s_minimize_icon);
|
||||
if (m_window.is_resizable())
|
||||
m_minimize_button->set_style(button_style);
|
||||
}
|
||||
if (m_window.is_resizable()) {
|
||||
m_maximize_button->set_icon(m_window.is_maximized() ? *s_restore_icon : *s_maximize_icon);
|
||||
m_maximize_button->set_style(button_style);
|
||||
}
|
||||
}
|
||||
|
||||
void WindowFrame::reload_config()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue