summaryrefslogtreecommitdiff
path: root/Servers/WindowServer/WSWindowFrame.cpp
AgeCommit message (Collapse)Author
2019-12-24LibGUI+LibDraw: Add "Palette" concept for scoped color themingAndreas Kling
GApplication now has a palette. This palette contains all the system theme colors by default, and is inherited by a new top-level GWidget. New child widgets inherit their parents palette. It is possible to override the GApplication palette, and the palette of any GWidget. The Palette object contains a bunch of colors, each corresponding to a ColorRole. Each role has a convenience getter as well. Each GWidget now has a background_role() and foreground_role(), which are then looked up in their current palette when painting. This means that you no longer alter the background color of a widget by setting it directly, rather you alter either its background role, or the widget's palette.
2019-12-24LibDraw: Add Button and ButtonText system theme colorsAndreas Kling
These are now separate from the Window and WindowText colors.
2019-12-23WindowServer+LibGUI: Implement basic color themingAndreas Kling
Color themes are loaded from .ini files in /res/themes/ The theme can be switched from the "Themes" section in the system menu. The basic mechanism is that WindowServer broadcasts a SharedBuffer with all of the color values of the current theme. Clients receive this with the response to their initial WindowServer::Greet handshake. When the theme is changed, WindowServer tells everyone by sending out an UpdateSystemTheme message with a new SharedBuffer to use. This does feel somewhat bloated somehow, but I'm sure we can iterate on it over time and improve things. To get one of the theme colors, use the Color(SystemColor) constructor: painter.fill_rect(rect, SystemColor::HoverHighlight); Some things don't work 100% right without a reboot. Specifically, when constructing a GWidget, it will set its own background and foreground colors based on the current SystemColor::Window and SystemColor::Text. The widget is then stuck with these values, and they don't update on system theme change, only on app restart. All in all though, this is pretty cool. Merry Christmas! :^)
2019-12-08WindowServer: Disambiguate "dragging" a bit, use "moving" more insteadAndreas Kling
Windows that are being moved around by the user are now called "moving" windows instead of "dragging" windows, to avoid confusion with the drag and drop stuff.
2019-09-06WindowServer: Elide window titles that don't fitAndreas Kling
Also skip painting the titlebar stripes and/or title entirely if we don't have enough space for them. Fixes #524.
2019-07-24WindowServer: Convert Vector<OwnPtr> to NonnullOwnPtrVector.Andreas Kling
2019-07-18LibDraw: Introduce (formerly known as SharedGraphics.)Andreas Kling
Instead of LibGUI and WindowServer building their own copies of the drawing and graphics code, let's it in a separate LibDraw library. This avoids building the code twice, and will encourage better separation of concerns. :^)
2019-06-30GUI: Use Win2K-like "warm gray" color instead of the older colder gray.Andreas Kling
Someone suggested this a long time ago and I never got around to it. So here we go, here's the warm gray! I have to admit I like it better. :^)
2019-06-21WindowServer+Taskbar: Let WindowServer manage the "window menus".Andreas Kling
Taskbar now simply asks the WindowServer to popup a window menu when right clicking on a taskbar button. This patch also implements the "close" menu item, and furthermore makes the window menu show up when you left-click a window's titlebar icon. :^)
2019-06-07WindowServer: Run clang-format on everything.Andreas Kling
2019-06-02WindowServer: Always update the maximize button icon when we should.Andreas Kling
We were only updating it in the WSButton callback, not when changing the maximized state by calling WSWindow::set_maximized(). Fixes #119.
2019-05-25WindowServer: Tweak window titlebar look somewhat.Andreas Kling
Add a subtle shadow to the titlebar text. Also make the titlebar one pixel taller to fully accomodate the 90s "3D frame" effect. :^)
2019-05-25WindowServer: Remove unused old "middle border" color.Andreas Kling
2019-05-25WindowServer: Don't draw titlebar separator for titlebar-less windows.Andreas Kling
2019-05-24WindowServer: Make it possible to turn off window title bars (#88)Christopher Dumas
Also, Launcher now does not use titlebars. Only check if titlebar should be shown if the window type works with that.
2019-05-24WindowServer: Factor out compositing from WSWindowManager into WSCompositor.Andreas Kling
This is far from finished and the two classes are awkwardly grabbing at each other's innards, but here's a first step in the right direction.
2019-05-20WindowServer: Don't start window resize for MouseUp or MouseMove.Andreas Kling
2019-05-17WindowServer: Add support for fullscreen windows.Andreas Kling
Fullscreen windows are rendered alone and above everything else when they are active, and as part of the regular window stack order when something else is active. Currently windows cannot be made fullscreen after-the-fact, but must have the fullscreen flag included in their CreateWindow message. It should not possible to interact with the menu, taskbar or window frame while the active window is fullscreened. :^)
2019-05-16WindowServer: Don't treat bottom titlebar edge as part of the border.Andreas Kling
We were allowing initiation of resize from the bottom titlebar edge since everything inside the window frame that's not either inside the title bar, or inside the window content, is considered the border.
2019-05-13WindowServer: Don't add maximize button to non-resizable windows.Andreas Kling
The minimize button can stay though, since it doesn't change the window size, just the visibility. :^)
2019-05-12WindowServer: Rearrange minimize/maximize/close buttons (in that order.)Andreas Kling
2019-05-12WindowServer: Add a maximize/unmaximize button to windows.Andreas Kling
2019-05-11WindowServer: Improve window frames by giving them a raised frame look. :^)Andreas Kling
2019-04-30WindowServer: Tweak window minimize button appearance.Andreas Kling
2019-04-22WindowServer+LibGUI: Allow arbitrary number of rects in messages.Andreas Kling
To get truly atomic updates, add a mechanism for passing arbitrary amounts of extra data along with WindowServer messages. This allows us to pass all the rects in a single message.
2019-04-18WindowServer: Tweak window icon placement again.Andreas Kling
2019-04-18WindowServer: Make window title bars slightly thicker. :^)Andreas Kling
2019-04-16WindowServer: Tweak window icon placement.Andreas Kling
2019-04-16WindowServer: Improve the look of menus.Andreas Kling
This patch makes menus stand out a bit more from their background by using the same kind of shading that Windows 2000 had.
2019-04-14WindowServer: Rename WSMessage* => WSEvent*.Andreas Kling
Since I'm on a roll here, I'll just rename WSMessageFoo to WSEventFoo now that these inherit from CEventFoo anyway.
2019-04-14WindowServer: Port WindowServer to LibCore.Andreas Kling
This was pretty straightforward thanks to the work I did separating out LibCore from LibGUI already. :^) - WSMessageLoop now inherits from CEventLoop. - WSMessage now inherits from CEvent. - WSMessageReceiver goes away. Now there is only one event loop in Serenity. Very nice!
2019-04-14AK: Improve smart pointer ergonomics a bit.Andreas Kling
2019-04-11WindowServer: Tweak window title positioning.Andreas Kling
2019-04-08LibGUI+WindowServer: Add support for GWidget tooltips.Andreas Kling
Any GWidget can have a tooltip and it will automatically pop up below the center of the widget when hovered. GActions added to GToolBars will use the action text() as their tooltip automagically. :^)
2019-04-06WindowServer: Add ability to initiate window resize from window edges.Andreas Kling
2019-04-06Add a slight hover highlight to GButton and WSButton. :^)Andreas Kling
2019-04-05WindowServer: Add a window minimization button.Andreas Kling
The window is simply ignored in the painting and hit testing traversal when in minimized state, same as we do for invisible windows. The WM_SetActiveWindow message (sent by Taskbar) brings it back into the non-minimized state. :^)
2019-04-05WindowServer: Make WSButton behave more like a normal button.Andreas Kling
Previously it would just close the window on MouseDown. Now we do the normal thing where we require a MouseUp inside the button rect before committing.
2019-04-05WindowServer: Make WSWindowFrame and WSButton deal in relative coordinates.Andreas Kling
This was a bit painful to get right. The code is a lot more pleasant to deal with now that all coordinates are relative to their local system instead of being absolute screen coordinates.
2019-04-05WindowServer: Add a WSButton class and make the window close buttons use it.Andreas Kling
2019-04-05WindowServer: Factor out window frame logic into a WSWindowFrame class.Andreas Kling
The window frame is an object that contains a window, its title bar and window border. This way WSWindowManager doesn't have to know about all the different types of window borders, titlebar rects, etc.