summaryrefslogtreecommitdiff
path: root/src/gui/widgets/popup.cpp
AgeCommit message (Collapse)AuthorFilesLines
2025-04-26GUI: Added support for explicit outline color per palette entryThorbjørn Lindeijer1-2/+12
This enables customized outlines for each text color as well as adding outlines for specific palettes, as done by the Jewelry theme. Merged PARTY_CHAT_TAB and PARTY_SOCIAL_TAB into just PARTY_TAB since we should probably be using the same color there anyway. Split off WHISPER_TAB as separate color from WHISPER.
2025-04-25GUI: Added support for multiple color palettes to ThemeThorbjørn Lindeijer1-6/+37
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 theme to skin item slots and equipment boxesThorbjørn Lindeijer1-2/+4
* Added EquipmentBox and ItemSlot skin types. * Allowed rectangles drawn by the theme to be not filled. * Added width/height attributes to skin element since we needed a way to specify the size of the item slots and equipment boxes.
2025-03-24Expanded GUI theming capabilitiesThorbjørn Lindeijer1-2/+14
* 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-17/+8
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-03-14Moved widget drawing code into ThemeThorbjørn Lindeijer1-2/+2
This is cleaner overall since now each widget type no longer needs to keep track of its own instances and updating of the GUI alpha. It also introduces a single point from where the GUI theme support can be enhanced. Theme is no longer a singleton, though for now there is a single instance owned by the Gui singleton. Widgets adjusted to delegate their painting to the Theme: * Button * Tab * TextField * CheckBox * RadioButton * Slider * DropDown * ProgressBar * ScrollArea * ResizeGrip * PlayerBox (by subclassing ScrollArea) The Window and Popup widgets already use the theme through the Skin class. They can actually use a different skin per instance, though this feature is only used by the SpeechBubble.
2024-03-28Fixed size and child positions for various popupsThorbjørn Lindeijer1-4/+5
Most prominently, fixes the tooltips on the window buttons being clipped due to their position being slightly outside of the clipping children area. And fixes NPC tooltips from having a lot of empty space below the NPC name. Also reduced the space between texts in the item tooltip to match the padding rather than being an entire empty line.
2024-02-13General code cleanupsThorbjørn Lindeijer1-7/+5
* 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-1/+1
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
2012-01-26Updated copyrights to 2012Thorbjørn Lindeijer1-1/+1
2010-08-03Move Theme and UserPalette to the resources folderJared Adams1-1/+1
Reviewed-by: Yohann Ferreira
2010-03-31Removed the ability to assign custom skins to windows/popupsThorbjørn Lindeijer1-32/+1
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-05Rename SkinLoader to ThemeJared Adams1-3/+3
Also merge the guialpha ConfigListener into Theme. Reviewed-by: Thorbjørn Lindeijer
2010-03-02Revert "Merge WindowContainer into Viewport and remove extra members"Jared Adams1-5/+18
This reverts commit 67e678094b9fddd21fb3c690130e772937ab2746. Conflicts: src/gui/gui.cpp src/gui/viewport.cpp
2010-03-01Merge WindowContainer into Viewport and remove extra membersJared Adams1-18/+5
Reviewed-by: Chuck Miller
2010-03-01Hide BeingPopup when mouseover WindowsJared Adams1-0/+7
Reviewed-by: Thorbjørn Lindeijer Reviewed-by: Chuck Miller
2010-02-22Cleanup some popup-related code and make sure BeingPopup is includedJared Adams1-0/+16
2010-02-22Modify copyright headersFreeyorp1-1/+2
2010-02-20License header update for The Mana ClientThorbjørn Lindeijer1-4/+3
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 )
2010-01-11Cleanup GUI classesJared Adams1-4/+4
Moved remaining widgets into widgets folder, standardized include order, moved TextRenderer out.
2009-04-15Made the PopupMenu a Popup subclassBjørn Lindeijer1-2/+2
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-10Reduced the GCContainer to be even more trivialBjørn Lindeijer1-7/+0
A container that deletes all its children on destruction doesn't have to be so complicated. Also renamed it to simply Container, since I think it should simply be default behavior. WindowContainer and Popup classes now inherit from this Container.
2009-04-07Moved basic widgets into the gui/widgets directoryBjørn Lindeijer1-0/+179
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.