mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:57:45 +00:00
WindowServer: Add some padding to the window switcher items.
This commit is contained in:
parent
0c898e3c2c
commit
e2cd572e60
2 changed files with 3 additions and 1 deletions
|
@ -79,6 +79,7 @@ void WSWindowSwitcher::draw()
|
||||||
text_color = Color::Black;
|
text_color = Color::Black;
|
||||||
rect_text_color = Color::MidGray;
|
rect_text_color = Color::MidGray;
|
||||||
}
|
}
|
||||||
|
item_rect.shrink(item_padding(), 0);
|
||||||
painter.blit(item_rect.location().translated(0, (item_rect.height() - window.icon().height()) / 2), window.icon(), window.icon().rect());
|
painter.blit(item_rect.location().translated(0, (item_rect.height() - window.icon().height()) / 2), window.icon(), window.icon().rect());
|
||||||
painter.draw_text(item_rect.translated(window.icon().width() + 4, 0), window.title(), WSWindowManager::the().window_title_font(), TextAlignment::CenterLeft, text_color);
|
painter.draw_text(item_rect.translated(window.icon().width() + 4, 0), window.title(), WSWindowManager::the().window_title_font(), TextAlignment::CenterLeft, text_color);
|
||||||
painter.draw_text(item_rect, window.rect().to_string(), TextAlignment::CenterRight, rect_text_color);
|
painter.draw_text(item_rect, window.rect().to_string(), TextAlignment::CenterRight, rect_text_color);
|
||||||
|
@ -107,7 +108,7 @@ void WSWindowSwitcher::refresh()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int space_for_window_rect = 180;
|
int space_for_window_rect = 180;
|
||||||
m_rect.set_width(longest_title_width + space_for_window_rect + padding() * 2);
|
m_rect.set_width(longest_title_width + space_for_window_rect + padding() * 2 + item_padding() * 2);
|
||||||
m_rect.set_height(window_count * item_height() + padding() * 2);
|
m_rect.set_height(window_count * item_height() + padding() * 2);
|
||||||
m_rect.center_within(WSWindowManager::the().m_screen_rect);
|
m_rect.center_within(WSWindowManager::the().m_screen_rect);
|
||||||
if (!m_switcher_window)
|
if (!m_switcher_window)
|
||||||
|
|
|
@ -27,6 +27,7 @@ public:
|
||||||
|
|
||||||
int item_height() { return 20; }
|
int item_height() { return 20; }
|
||||||
int padding() { return 8; }
|
int padding() { return 8; }
|
||||||
|
int item_padding() { return 8; }
|
||||||
|
|
||||||
WSWindow* selected_window();
|
WSWindow* selected_window();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue