1
0
mirror of git://projects.qi-hardware.com/gmenu2x.git synced 2024-06-30 21:13:51 +03:00
Commit Graph

25 Commits

Author SHA1 Message Date
Maarten ter Huurne
fe0db484ec Removed "delegate.h"
The abstraction it provided was so thin that I think it is simpler to
just have the code use std::bind directly.
2014-08-16 07:07:41 +02:00
Maarten ter Huurne
7e308879c1 Pass action to IconButton constructor
This removes the need for a separate setAction method.

The default action is the empty action, which does nothing. However,
a touch event on a button with the empty action is no longer considered
handled.

Menu::btnContextMenu was changed from a unique_ptr to a plain data
member.
2014-08-16 06:44:13 +02:00
Nebuleon Fumika
891525aa94 Fix dynamic allocation of IconButton instances
Previously, IconButton instances to be added to button boxes were
allocated with new, but never freed with delete.

unique_ptr makes sure the buttons will be freed along with the button
box that owns them, or when code calls ButtonBox::clear.

The destructor of ButtonBox has been made redundant by this change, so
it's gone.
2014-08-16 05:17:31 +02:00
Maarten ter Huurne
aff5f53f7d Don't pass around naked Surface pointers when drawing
Use references instead.
2014-08-10 04:26:59 +02:00
Maarten ter Huurne
902145b698 Removed Surface::write method
All it did was redirect to Font::write, so it's better to call that
method directly.
2014-07-31 23:16:51 +02:00
Nebuleon Fumika
bac622fc39 Cap the width of setting names in SettingDialog to the width of the longest
Setting values are now displayed 10 pixels to the right of setting names, as
passed to MenuSetting::draw.

This commit also contains the following cleanups:

* The height of a row is passed to MenuSetting's draw and touchscreen methods.
* MenuSettingRGBA's magic constant (36) to separate the text for a color's
  four components is now a named constant.
* MenuSettingRGBA's color preview squares are now rowHeight - 2 pixels tall,
  and have a white border surrounded by a black border to help view the color
  it contains in both light and dark themes.
* The rectangle behind the selected setting's name is now drawn by that
  setting's drawSelected method.
2014-07-24 11:07:30 +02:00
Maarten ter Huurne
724aefe482 Renamed ASFont class to just Font
Originally the font implementation was based on SFont, but it was
recently replaced by an SDL_ttf based implementation, so the name
no longer made sense.
2013-08-03 22:30:12 +02:00
Paul Cercueil
88f54e1ccc Drop incredibly dirty and huge file FastDelegate.h
It's way too over-engineered for what we need to do, and we can
do much simpler using C++11.
2013-07-29 12:58:25 -04:00
Maarten ter Huurne
1ad6b2f25a Made GMenu2X::ts private.
Pass Touchscreen reference to constructors instead of pulling it from
the GMenu2X class.
2011-12-23 14:03:05 +01:00
Maarten ter Huurne
f28e4f6d89 Minimized gmenu2x.h.
Everything that does not need to be shared was moved to gmenu2x.cpp.
2011-10-23 17:27:29 +02:00
Maarten ter Huurne
641c989934 MenuSettingBool: Support toggling of boolean settings using left/right. 2011-10-23 09:47:51 +02:00
Maarten ter Huurne
a38c283e17 SettingsDialog: simplify code using InputManager::waitForPressedButton().
Replaced MenuSetting::manageInput() by handleButtonPress(), because we will
only pass pressed buttons to it, not the entire input event.
2011-10-23 09:38:59 +02:00
Maarten ter Huurne
315bf0a180 InputManager: C++-style type definitions.
There is no need to typedef enums and structs in C++.
Put types defined by InputManager inside the class namespace.
Changed type names to CamelCase.
2011-10-23 09:04:12 +02:00
Ayla
759eefd676 The files "a.png" and "b.png" have been renamed to "cancel.png" and "accept.png". 2011-09-18 03:40:33 +02:00
Ayla
7f2c7db8e2 Rewrite of how the events are handled by the menusetting* objects. 2011-09-15 20:20:35 +02:00
Maarten ter Huurne
e4b71138b9 ASFont: removed precalculation of half heights.
There is no point in precalculating something so cheap to recalculate.
Also, the majority of uses was to compensate for passing the wrong alignment argument.
2011-05-10 00:31:45 +02:00
Maarten ter Huurne
a35a7e2c35 Introduced enums for text alignment in the ASFont class. 2011-05-09 05:17:25 +02:00
Ayla
563cb34a89 Rewrote the whole input system.
Gmenu2X will no longer eat 100% CPU ;)
2010-09-17 22:34:26 +02:00
Maarten ter Huurne
d082f7f280 Minimize namespace pollution in MenuSetting class hierarchy.
This should be done for all source files, but it is too much to do all at once.
2010-07-28 02:36:46 +02:00
Maarten ter Huurne
44bed79d5c Give adjustInput() an empty default implementation and remove empty overrides.
Again a slight reduction in binary size.
2010-07-28 01:52:05 +02:00
Maarten ter Huurne
eff06b0319 Remove code duplication between the two constructors of MenuSettingBool. 2010-07-27 23:45:53 +02:00
Lars-Peter Clausen
3b2538cfaf Add ButtonBox widget to simplify managing buttons in the bottombar. Also fixes some memleaks where buttons were left unfreed. 2010-05-03 22:21:36 +02:00
Lars-Peter Clausen
d4490ba85c remove redundant assignments 2010-05-02 20:02:21 +02:00
Lars-Peter Clausen
40a26e1a9c pass strings by reference where possible 2010-05-02 14:38:16 +02:00
Mirko Lindner
cddcd72e33 initial commit - needs clean-up
Signed-off-by: Mirko Lindner <mirko@sharism.cc>
2010-02-04 12:33:47 +01:00