mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 08:00:20 +00:00
WindowServer: Make dragging window frames look kinda cool.
This commit is contained in:
parent
d39f585f35
commit
5f14e22a31
Notes:
sideshowbarker
2024-07-19 15:57:10 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/5f14e22a318
1 changed files with 5 additions and 1 deletions
|
@ -165,23 +165,27 @@ void WSWindowManager::paint_window_frame(WSWindow& window)
|
|||
Color title_color;
|
||||
Color border_color;
|
||||
Color border_color2;
|
||||
Color middle_border_color;
|
||||
|
||||
if (&window == m_drag_window.ptr()) {
|
||||
border_color = m_dragging_window_border_color;
|
||||
border_color2 = m_dragging_window_border_color2;
|
||||
title_color = m_dragging_window_title_color;
|
||||
middle_border_color = Color::White;
|
||||
} else if (&window == m_active_window.ptr()) {
|
||||
border_color = m_active_window_border_color;
|
||||
border_color2 = m_active_window_border_color2;
|
||||
title_color = m_active_window_title_color;
|
||||
middle_border_color = Color::MidGray;
|
||||
} else {
|
||||
border_color = m_inactive_window_border_color;
|
||||
border_color2 = m_inactive_window_border_color2;
|
||||
title_color = m_inactive_window_title_color;
|
||||
middle_border_color = Color::MidGray;
|
||||
}
|
||||
|
||||
m_back_painter->fill_rect_with_gradient(titleBarRect, border_color, border_color2);
|
||||
m_back_painter->draw_rect(borderRect, Color::MidGray);
|
||||
m_back_painter->draw_rect(borderRect, middle_border_color);
|
||||
m_back_painter->draw_rect(outerRect, border_color);
|
||||
m_back_painter->draw_rect(inner_border_rect, border_color);
|
||||
m_back_painter->draw_text(titleBarTitleRect, window.title(), Painter::TextAlignment::CenterLeft, title_color);
|
||||
|
|
Loading…
Reference in a new issue