mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 10:27:35 +00:00
WindowServer+LibGfx: Move normal window frame painting to a WindowTheme
This patch introduces the ClassicWindowTheme, which is our default theme implemented as a Gfx::WindowTheme subclass. In this initial cut, we move normal window frame painting and title bar metrics helpers out of WindowServer and into LibGfx. This will eventually allow us much greater flexibility with theming windows, and also makes it easier to build applications that want to render a window with a specific style for some reason. :^)
This commit is contained in:
parent
a94be95e27
commit
e7460b6fb4
5 changed files with 210 additions and 73 deletions
|
@ -29,6 +29,7 @@
|
|||
#include <AK/Forward.h>
|
||||
#include <AK/NonnullOwnPtrVector.h>
|
||||
#include <LibGfx/Forward.h>
|
||||
#include <LibGfx/WindowTheme.h>
|
||||
|
||||
namespace WindowServer {
|
||||
|
||||
|
@ -60,15 +61,7 @@ private:
|
|||
void paint_notification_frame(Gfx::Painter&);
|
||||
void paint_normal_frame(Gfx::Painter&);
|
||||
|
||||
struct FrameColors {
|
||||
Color title_color;
|
||||
Color border_color;
|
||||
Color border_color2;
|
||||
Color title_stripes_color;
|
||||
Color title_shadow_color;
|
||||
};
|
||||
|
||||
FrameColors compute_frame_colors() const;
|
||||
Gfx::WindowTheme::WindowState window_state_for_theme() const;
|
||||
|
||||
Window& m_window;
|
||||
NonnullOwnPtrVector<Button> m_buttons;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue