summaryrefslogtreecommitdiff
path: root/src/gui/widgets/button.h
AgeCommit message (Collapse)AuthorFilesLines
2025-03-17Have ImageRect automatically initialize and clean upThorbjørn Lindeijer1-1/+0
2025-03-14Moved widget drawing code into ThemeThorbjørn Lindeijer1-8/+1
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-02-26Plugged a few more memory leaksThorbjørn Lindeijer1-1/+0
* DebugWindow and SkillDialog were not deleting their tabs nor their tab widgets. * TabbedArea was not deleting its arrow buttons. * Button was deleting its TextPopup on deletion of the last Button instance, which was wrong because it was also being deleted by the WindowContainer. Also removed some misplaced event forwarding to the TextPopup. TabbedArea is tricky because it does not automatically delete added tabs or their widgets. Tab instances are only deleted when they were added by name. Issues found by Valgrind memory analyzer.
2025-02-26Use ResourceRef for all resource typesThorbjørn Lindeijer1-2/+5
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-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.
2024-02-13General code cleanupsThorbjørn Lindeijer1-4/+4
* 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-5/+5
modernize-use-auto modernize-use-nullptr modernize-use-override modernize-use-using
2012-02-10Arbitrary small code cleanupsThorbjørn Lindeijer1-4/+4
Reviewed-by: Erik Schilling
2012-02-03Changed the setup button at login stage to use the icon.Yohann Ferreira1-1/+1
I also made the button not readjust its size when deleted to avoid a crash. Reviewed-by: Erik Schilling
2012-01-26Updated copyrights to 2012Thorbjørn Lindeijer1-1/+1
2011-11-12Removed hiding of button popup when setting the text to emptyYohann Ferreira1-1/+2
The text is never set to an empty string, especially not while the mouse is over the button. The popup will be updated or hidden by mouseMoved anyway. Reviewed-by: Thorbjorn Lindeijer
2011-09-28Small changes requested by o11c - part 1.Yohann Ferreira1-1/+5
2011-08-11Made the button icon only shown when the icon file is valid.Yohann Ferreira1-1/+1
And falls back to the text based caption otherwise.
2011-08-11Changed the Social button to an image one.Yohann Ferreira1-3/+2
I also made the client able to keep the old behaviour, and i changed the button api to not require the icon frames size as it could easily guess them.
2011-08-11Added textpopup on mouse hovering support to buttons.Yohann Ferreira1-0/+15
I added a use of it to the menu buttons.
2011-06-16Added image support to the button widgets.Yohann Ferreira1-2/+22
Resolves: Mana-mantis #96. Reviewed-by: Crush. Note that the option to set the image position next to the text is still needed and will be handled in another issue.
2011-04-09Removed a lot of useless "documentation"Thorbjørn Lindeijer1-3/+0
I have to admit I contributed a large part of these. Sorry for that. Less empty space, more attention to the code. Acked-by: Jared Adams
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 )
2009-09-02Added a minimum alpha opacity value handle in SkinLoader and made use of it.Bertram1-0/+5
Part 1 of 3 for Mantis #847 Only a few controls follow minimum opacity value at login stage. Part 2 will make all other controls do the same. Part 3 will try to set default gui opacity value as a constant.
2009-04-07Moved basic widgets into the gui/widgets directoryBjørn Lindeijer1-0/+67
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.