summaryrefslogtreecommitdiff
path: root/Servers
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-23 22:01:33 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-23 22:01:33 +0200
commite2cd572e60364882aa12226212144ae73d399b57 (patch)
tree1710d3151bccfe2353b272c016c0850753215acd /Servers
parent0c898e3c2cad9a5b2c7a4caf41bd9b544d31ba19 (diff)
downloadserenity-e2cd572e60364882aa12226212144ae73d399b57.zip
WindowServer: Add some padding to the window switcher items.
Diffstat (limited to 'Servers')
-rw-r--r--Servers/WindowServer/WSWindowSwitcher.cpp3
-rw-r--r--Servers/WindowServer/WSWindowSwitcher.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/Servers/WindowServer/WSWindowSwitcher.cpp b/Servers/WindowServer/WSWindowSwitcher.cpp
index 395bb77279..1ed206d9d8 100644
--- a/Servers/WindowServer/WSWindowSwitcher.cpp
+++ b/Servers/WindowServer/WSWindowSwitcher.cpp
@@ -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)
diff --git a/Servers/WindowServer/WSWindowSwitcher.h b/Servers/WindowServer/WSWindowSwitcher.h
index e2c8fcb1bf..1702513085 100644
--- a/Servers/WindowServer/WSWindowSwitcher.h
+++ b/Servers/WindowServer/WSWindowSwitcher.h
@@ -27,6 +27,7 @@ public:
int item_height() { return 20; }
int padding() { return 8; }
+ int item_padding() { return 8; }
WSWindow* selected_window();