WindowServer: Add some padding to the window switcher items.

This commit is contained in:
Andreas Kling 2019-04-23 22:01:33 +02:00
parent 0c898e3c2c
commit e2cd572e60
Notes: sideshowbarker 2024-07-19 14:36:39 +09:00
2 changed files with 3 additions and 1 deletions

View file

@ -79,6 +79,7 @@ void WSWindowSwitcher::draw()
text_color = Color::Black;
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.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);
@ -107,7 +108,7 @@ void WSWindowSwitcher::refresh()
return;
}
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.center_within(WSWindowManager::the().m_screen_rect);
if (!m_switcher_window)

View file

@ -27,6 +27,7 @@ public:
int item_height() { return 20; }
int padding() { return 8; }
int item_padding() { return 8; }
WSWindow* selected_window();