summaryrefslogtreecommitdiff
path: root/src/gui/widgets/scrollarea.cpp
AgeCommit message (Collapse)AuthorFilesLines
2025-04-25Introduced theme dropdown in interface setupThorbjørn Lindeijer1-12/+12
* Added Theme dropdown to Interface setup * Added CARET theme color * Fixed issue with logging errors in `check` function in `theme.cpp` * Fixed XML::Children::Iterator to iterate only element nodes * Changed default theme to "jewelry" Changing the theme (or font size) shows a dialog that points out a restart is required to apply these changes. This is necessary at the moment because many things, like default or minimum window sizes, are only calculated once.
2025-04-25GUI: Added support for hiding the scroll area buttonsThorbjørn Lindeijer1-9/+120
And made the Jewelry theme hide those buttons.
2025-04-25GUI: Added support for fixed-size scrollarea markersThorbjørn Lindeijer1-3/+319
Due to getVerticalMarkerDimension and getHorizontalMarkerDimension not being virtual, this unfortunately required copying a lot of code from Guichan to make sure it calls our versions of these functions. Also addressed a small issue where gcn::ScrollArea::checkPolicies was not taking the frame size of the content into account.
2025-03-31GUI: Apply clipping only where necessaryThorbjørn Lindeijer1-0/+10
Clipping has been disabled globally by taking it out of Graphics::pushClipArea. Now its name is a little confusing, but it can't just be changed since it is part of Guichan. Widgets that do need to clip their children use the new Graphics::pushClipRect, which pushes a clipping rectangle without affecting the local coordinates. These are: * ScrollArea * TextField * TabbedArea (scrolling tabs) * MiniMap While it might count as a small optimization, I'm actually disabling clipping because it is not always desired. For example it gets in the way of rendering the complete ResizeGrip in the Jewelry theme because that's a child widget.
2025-03-24Expanded GUI theming capabilitiesThorbjørn Lindeijer1-45/+50
* 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-33/+43
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-180/+44
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.
2025-03-07Reuse gcn::ScrollArea::drawThorbjørn Lindeijer1-27/+6
Code appeared duplicated just because we don't draw the background, but this could be done by overriding drawBackground instead.
2025-02-26Use ResourceRef for all resource typesThorbjørn Lindeijer1-17/+12
All ResourceManager functions that load resources now return respective ResourceRef values, which helps to make sure resources are properly cleaned up. The Sound class was cleaned up and now also allows SoundEffect resources to be unloaded. The Animation class now keeps its ImageSet loaded only as long as necessary. Previously, SimpleAnimation and ParticleEmitter would keep the ImageSet loaded indefinitely by never decreasing its reference count. Reduced duplicated animation loading code between SimpleAnimation and ParticleEmitter.
2025-01-20Made client config statically typedThorbjørn Lindeijer1-5/+5
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-10-18Added small grabbable margin to Shortcuts windowThorbjørn Lindeijer1-1/+0
The Shortcuts window could no longer be moved since adding support for resizing windows at the top edge. Now there is again a bit of space where the window can be grabbed. Included some related cleanups.
2024-02-13General code cleanupsThorbjørn Lindeijer1-17/+9
* 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-29Apply C++11 fixitsThorbjørn Lindeijer1-9/+8
modernize-loop-convert modernize-deprecated-headers
2024-01-24Fixed compilation issues and use of deprecated C++ featuresThorbjørn Lindeijer1-3/+3
* Fixed compiler errors due to dynamic exception specifications * Replace std::auto_ptr with std::unique_ptr * Replace std::mem_fun with std::mem_fn * Prefix for_each with std:: (apparently not needed before) * Just use lambda instead of std::bind2nd * Removed usages of std::unary_function
2012-04-01Made changes to compile on Mac OSX 10.6 and laterDavid Athay1-1/+1
Also added Xcode project for others to compile for Mac OSX. Reviewed-by: Thorbjørn Lindeijer
2012-01-26Updated copyrights to 2012Thorbjørn Lindeijer1-1/+1
2010-08-03Move Theme and UserPalette to the resources folderJared Adams1-2/+1
Reviewed-by: Yohann Ferreira
2010-07-28Centralized configuration default values using the VariableData system.Yohann Ferreira1-5/+5
Please note that I didn't turned all the getValue() call into new ones, simply because I have to have config object initiated which is not forcefully the case the branding file. Resolves: Manasource Mantis #170.
2010-03-05Rename SkinLoader to ThemeJared Adams1-13/+13
Also merge the guialpha ConfigListener into Theme. Reviewed-by: Thorbjørn Lindeijer
2010-02-28Make the gui more themeable and distribute two themesJared Adams1-13/+11
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-14Made the ScrollArea scrolling with buttons smootherThorbjørn Lindeijer1-31/+23
Update more frequently (every tick) and by a smaller amount.
2010-02-14Fixed ScrollAreas to allow for continual scrolling, as long as the mouseTametomo1-2/+36
button is pressed, instead of just moving one tick for each press. Signed-off-by: Tametomo <irarice@gmail.com>
2010-02-08Merge PartyWindow and GuildWindow into SocialWindowJared Adams1-0/+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-1/+2
Moved remaining widgets into widgets folder, standardized include order, moved TextRenderer out.
2009-09-03Resolved Mantis #847: Login stage Windows won't go less than the default gui ↵Bertram1-10/+19
opacity. Of course, in-game, the wanted opacity still shows up.
2009-08-10Fix TabbedArea and ScrollArea to resize contentsJared Adams1-0/+5
Also remove that code from SkillDialog. I tried to do the same with ChatWindow, but it kept segfaulting. Will try again later.
2009-08-06Fixed crash on exit when the last ScrollArea gets deletedThorbjørn Lindeijer1-1/+1
Variable name mixup.
2009-08-05patch for #813, adds mouse over highlight forMaximilian Philipps1-4/+43
radio buttons, tabs, checkboxes, slider and scrollbars
2009-05-03Moved strprintf into stringutils.{h,cpp}Bjørn Lindeijer1-2/+2
2009-04-07Moved basic widgets into the gui/widgets directoryBjørn Lindeijer1-0/+309
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.