Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
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.
|
|
* 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.
|
|
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.
|
|
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.
|
|
* 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 ""
|
|
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
|
|
Reviewed-by: Erik Schilling
|
|
I also made the button not readjust its size when deleted
to avoid a crash.
Reviewed-by: Erik Schilling
|
|
|
|
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
|
|
|
|
And falls back to the text based caption otherwise.
|
|
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.
|
|
I added a use of it to the menu buttons.
|
|
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.
|
|
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
|
|
|
|
|
|
Also added the update copyright tool from the Wormux Team.
( And not forgetting credit's due. :P )
|
|
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.
|
|
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.
|