summaryrefslogtreecommitdiff
path: root/Servers/WindowServer/WSWindowFrame.cpp
AgeCommit message (Collapse)Author
2020-02-06LibGfx: Unpublish Gfx::Rect from global namespaceAndreas Kling
2020-02-06LibGfx: Rename from LibDraw :^)Andreas Kling
2020-02-06LibDraw: Put all classes in the Gfx namespaceAndreas Kling
I started adding things to a Draw namespace, but it somehow felt really wrong seeing Draw::Rect and Draw::Bitmap, etc. So instead, let's rename the library to LibGfx. :^)
2020-01-25WindowServer: Don't allow minimize/maximize of windows while modal upAndreas Kling
While one window is blocked by another modal one, just ignore events on the window frame, and also ignore set_minimized() and set_maximized(). The only thing you're allowed to do with a blocked window is moving it. Fixes #1111.
2020-01-18Meta: Add license header to source filesAndreas Kling
As suggested by Joshua, this commit adds the 2-clause BSD license as a comment block to the top of every source file. For the first pass, I've just added myself for simplicity. I encourage everyone to add themselves as copyright holders of any file they've added or modified in some significant way. If I've added myself in error somewhere, feel free to replace it with the appropriate copyright holder instead. Going forward, all new source files should include a license header.
2020-01-04WindowServer: Various window pop-up menu fixes & QoL tweaksJami Kettunen
2020-01-04WindowServer+LibGUI: Implement minimizable property to windowsJami Kettunen
2019-12-29LibDraw+LibGUI: Allow changing individual colors in a PaletteAndreas Kling
Palette is now a value wrapper around a NonnullRefPtr<PaletteImpl>. A new function, set_color(ColorRole, Color) implements a simple copy-on-write mechanism so that we're sharing the PaletteImpl in the common case, but allowing you to create custom palettes if you like, by getting a GWidget's palette, modifying it, and then assigning the modified palette to the widget via GWidget::set_palette(). Use this to make PaintBrush show its palette colors once again. Fixes #943.
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.