summaryrefslogtreecommitdiff
path: root/src/gui/widgets/window.h
AgeCommit message (Collapse)AuthorFilesLines
2025-04-25GUI: Added support for multiple color palettes to ThemeThorbjørn Lindeijer1-0/+5
Each Skin can point to a different palette, which can be used to tweak text colors where necessary. For now there is no generic solution for this, instead a number of locations have been adjusted to take the palette into account: * ChatWindow sets its palette on the BrowserBox used in its tabs. * Popup sets its palette on child widgets when they are added (covering BrowserBox, Label and TextBox). * ItemPopup now uses its palette when looking up colors. The BrowserBox now retrieves its numbered text colors from the theme. Also added OLDCHAT, AWAYCHAT and GLOBAL theme colors, with ##g, ##o and ##a to choose these colors respectively. Fixed ImageRect move constructor. TextPreview class was cleaned up from unused functionality. Being name colors are no longer different between the name shown on the being and the name shown in the SpeechDialog.
2025-04-25GUI: Allow customizing the SkinType used by a WindowThorbjørn Lindeijer1-2/+13
Now different windows can use different skin types. This also introduces a new ToolWindow skin type, which is generally a window without title bar nor close button. Customized windows are: * Chat -> Popup skin * MiniMap -> Popup skin * ShortcutWindow (items and emotes) -> ToolWindow skin Even though the MiniMap now appears as a Popup, it does have a title, so appropriate attributes have been added to this skin type.
2025-04-02Fixed minimum width of the Social windowThorbjørn Lindeijer1-0/+5
Needs to allow space for all three buttons, especially since they are no longer clipped to the window.
2025-03-31GUI: De-hardcode the window title offsetsThorbjørn Lindeijer1-7/+0
2025-03-24Expanded GUI theming capabilitiesThorbjørn Lindeijer1-1/+10
* Moved previously hardcoded values for frame size, padding and title bar height to the Skin. * Added support for rendering colored rectangles (used for scroll bar background). * Scroll bar width is now determined by its skin. * Added separate skins for horizontal and vertical scroll bars and horizontal and vertical scroll markers and added a skin for the shortcut box. * Added support for hovered state on window close button.
2025-03-24Define the GUI theme in XMLThorbjørn Lindeijer1-4/+1
Now all images used by the various UI widgets are defined in a `theme.xml`, removing hardcoded requirements on the size of images, borders and sub-images and their locations. The `colors.xml` file was merged into this new file as well. The `<img>` element defines either a plain image, or a 9-scale that is automatically rendered at the size of the widget when any of the `left`, `right`, `top` or `bottom` attributes are given. The `x`, `y`, `width` and `height` attributes determine the sub-rectangle within the image referenced by `src`. `x` and `y` default to 0 and `width` and `height` default to the imge size. The `<state>` element defines in which state its images are used by setting its `selected`, `disabled`, `hovered` or `focused` attributes to either `true` or `false`. Only the first matching state is rendered. The `Text` and `SpeechBubble` classes now use the same skin to draw the bubble, as well as using a newly introduced `BUBBLE_TEXT` color from the theme palette.
2025-01-21Replaced include guards with #pragma onceThorbjørn Lindeijer1-4/+1
Thanks to https://github.com/cgmb/guardonce and a follow-up replace to remove duplicated newlines at end of file: find src -type f -name '*.h' -exec \ sed --in-place -e :a -e '/^\n*$/{$d;N;};/\n$/ba' {} \; Source: https://unix.stackexchange.com/questions/81685/how-to-remove-multiple-newlines-at-eof Fixes compile on macOS, which appears to have been due to the EVENT_H include guard.
2025-01-20Made client config statically typedThorbjørn Lindeijer1-2/+2
This makes accessing the config values much faster, since it no longer needs to do a lookup nor string conversion, which means we could remove some needless copying of the values. Overall it makes it easier to find out where settings are used and it puts the defaults along with the declaration. Options with default values are no longer saved to the config file. This does not include unrecognized options, which are kept around to provide some compatibility with older clients. While most basic options have kept the same name, more complicated settings like window geometry, shortcuts, outfits, etc. now have their own XML elements. Older clients will ignore these and erase them when saving the configuration.
2024-06-09Enable resizing windows from all sidesThorbjørn Lindeijer1-1/+3
Previously, the top edge of windows could not be dragged. Now you can also resize windows by their top edge, as well as the top-left and top-right corners.
2024-02-13General code cleanupsThorbjørn Lindeijer1-13/+13
* Removing unused includes * Use member initialization * Use range-based for loops * Use nullptr * Removed no longer used aliases * Use override * Don't use else after return * Use '= delete' to remove implicit members * Use std::string::empty instead of comparing to ""
2024-01-26Apply C++11 fixitsThorbjørn Lindeijer1-10/+10
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
2012-01-26Updated copyrights to 2012Thorbjørn Lindeijer1-1/+1
2012-01-22Allow resizing of the game in windowed modeThorbjørn Lindeijer1-4/+11
Window positions are semi-smartly corrected as a result of the resize. Not supported when using OpenGL on Windows for now. Reviewed-by: Yohann Ferreira
2011-09-29Fixed item popup still visible after closing inventory window.Erik Schilling1-1/+1
Reviewed-by: Bertram.
2010-05-06Fixed some copy/pasted documentationThorbjørn Lindeijer1-3/+3
2010-03-31Removed the ability to assign custom skins to windows/popupsThorbjørn Lindeijer1-1/+0
Old settings are causing it to fall back on the wrong combination of files if old data is in the search path. Reviewed-by: Jared Adams
2010-03-02Revert "Merge WindowContainer into Viewport and remove extra members"Jared Adams1-0/+6
This reverts commit 67e678094b9fddd21fb3c690130e772937ab2746. Conflicts: src/gui/gui.cpp src/gui/viewport.cpp
2010-03-01Merge WindowContainer into Viewport and remove extra membersJared Adams1-6/+0
Reviewed-by: Chuck Miller
2010-02-28Rename gui.xml to window.xmlJared Adams1-1/+1
2010-02-28Make the gui more themeable and distribute two themesJared Adams1-1/+1
The older gray theme and the new wood theme are available as themes. The gray theme needs some new graphics for hilights. Add a theme option for branding and add path/to/branding/data to the PhysFS search path. Reviewed-by: Thorbjørn Lindeijer Reviewed-by: Chuck Miller
2010-02-22Modify copyright headersFreeyorp1-1/+2
2010-02-20License header update for The Mana ClientThorbjørn Lindeijer1-4/+3
2010-02-14Remove focus from a window's internal widgets on hiding.Tametomo1-1/+1
Signed-off-by: Tametomo <irarice@gmail.com>
2010-02-13Make NPC dialogs instance instead of globalJared Adams1-1/+1
This change allows players to talk to multiple NPCs at a time (if the server agrees). Manaserv's netcode allows multiple commerce instances too. eAthena's is limited to one commerce instance, due to protocol limitations.
2010-02-07Updated Copyright year to 2010!Bertram1-1/+1
Also added the update copyright tool from the Wormux Team. ( And not forgetting credit's due. :P )
2009-12-04Reset the cursor when a window is hiddenJared Adams1-0/+5
2009-07-30Fixed windows loss when changing to a lowered resolution. (Mantis 776)Bertram1-1/+8
2009-05-10Fixed the resize grip of the party windowBjørn Lindeijer1-5/+4
It wasn't re-added after doing a clear. Also, don't leak all the PartyMember and Avatar instances.
2009-05-09Increased the distance between head and overhead text a bitBjørn Lindeijer1-2/+1
Plus some small code cleanups.
2009-05-09Fix some memory leaksJared Adams1-2/+5
In doing so, NPC Dialogs now show the resize grip again.
2009-05-01Merge the NPC dialogs into oneJared Adams1-0/+7
Also add support for the new TMWServ NPC packets
2009-04-20Fix up window visibility saving/restoringJared Adams1-0/+22
2009-04-15Made the PopupMenu a Popup subclassBjørn Lindeijer1-1/+0
It's a natural better fit. The SkinLoader was changed into a singleton, since it's used by both Window and Popup classes.
2009-04-07Moved basic widgets into the gui/widgets directoryBjørn Lindeijer1-0/+363
In an attempt to make the GUI code a little more structured, basic widgets are now put in gui/widgets. Many includes were also cleaned up.