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

32 Commits

Author SHA1 Message Date
Maarten ter Huurne
e2382e11fd Made SettingsDialog::exec() return whether a setting was changed
Previously, exec() always returned true and a separate edited() method
would indicate whether any settings were changed.
2014-08-16 17:11:18 +02:00
Maarten ter Huurne
faf2495727 Use unique_ptr to make ownership of MenuSettings explicit 2014-08-16 17:01:04 +02:00
Maarten ter Huurne
8a1bb5694f Renamed SettingsDialog::voices to settings
I have no idea where that original name came from, but it didn't make
any sense to me.
2014-08-16 16:43:26 +02:00
Maarten ter Huurne
60183e539d Removed most uses of naked Surface pointers
However, SurfaceCollection remains a very important user.
2014-08-10 14:21:14 +02:00
Maarten ter Huurne
4bd1c799bd Created separate subclasses for output and off-screen surfaces
There are a few exclusive operations for each type. Also we no longer
need the freeWhenDone flag since the class now determines whether the
surface should be freed or not.
2014-08-10 13:25:54 +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
20c5ec4eb6 Put Surface argument first in Dialog paint methods
This is the convention that most classes stick to. The likely reason
why Dialog didn't stick to the convention was to be able to provide
a default value for this argument, but that feature wasn't very useful
since every caller already had access to the default surface.
2014-08-10 04:02:10 +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
0810a26589 Removed unnecessary includes of SDL_gfx header
Only surface.cpp actually uses SDL_gfx functions.
2014-07-19 00:43:05 +02:00
Nebuleon Fumika
099bd24556 Use the font's suggested line height instead of its ascent and descent.
In well-described fonts, this enables multi-line text (e.g. in manuals) to be
more readable.

The term "height" is also replaced with "line spacing" in Font's code.
2014-07-17 02:03:02 +02:00
Paul Cercueil
217a9b5cd6 Remove calls to setInputSpeed(), as it only needs to be called once 2013-09-26 18:59:22 -03:00
Maarten ter Huurne
6c80a663e1 Check for empty strings using empty() instead of comparing to "" 2013-08-16 09:16:04 +02:00
Maarten ter Huurne
b18e3fa6a8 Don't pass screen coordinates to drawScrollBar()
The scroll bar always spans the content area of the screen: the
position and height depend only on the theme and not on who is
drawing it.

Note that the coordinates passed were wrong in most cases, so this
commit fixes the scroll bar positioning for several dialogs.
2013-08-14 11:47:29 +02:00
Paul Cercueil
9263c782e7 Drop GP2X platform support.
The GP2X build was unused and totally broken.
2012-06-14 23:45:57 +02:00
Maarten ter Huurne
8f57afcf53 Explicitly convert 32-bit integers to 16-bit.
GCC 4.7.0 warns that C++11 considers doing this implicitly ill-formed.
2012-04-10 23:01:16 +02:00
Maarten ter Huurne
fd642ffe9a SettingsDialog: Code layout cleanup.
No functional changes, except for fetching "topBarHeight" only once.
2012-04-10 22:09:20 +02:00
Maarten ter Huurne
944ab86f9c Cleanup of touch screen code.
Initialize in constructor and clean up in destructor instead of having separate init() and deinit() methods.
Don't close file descriptor if open failed (ts_fd == -1).
Renamed initialized() to available(), since it tests whether the touch screen was found, not whether an initialization was attempted.
Improved code layout and minor other cleanups.
2011-12-23 12:30:15 +01:00
Maarten ter Huurne
e0e7e87ebc Massive header cleanup.
The main goal is to avoid including "gmenu2x.h" from headers.
But I did various other cleanups as well while I was at it.
2011-10-23 16:13:02 +02:00
Maarten ter Huurne
0b878c1b77 SettingsDialog: removed unused action variable and macros. 2011-10-23 11:41:44 +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
7f2c7db8e2 Rewrite of how the events are handled by the menusetting* objects. 2011-09-15 20:20:35 +02:00
Ayla
5f77e3baf7 Cleaned GP2X-specific code that was built on all platforms.
There was a lot of gp2x-specific code which was built for
all platform. For instance, the code was compiled for all
the platforms with the constant "TARGET_GP2X" defined.
This obviously had to be fixed.
2011-07-29 01:13:35 +02:00
Ayla
81a607c36e Fixed a good number of memory leaks.
The objects created with "new" were destroyed with "free()",
instead of "delete"; as a result, the destructors were never called.
2011-07-20 13:43:25 +02:00
Maarten ter Huurne
8a81837c04 Surface: Make pixel format conversion explicit.
Instead of having the copy constructor convert to display format, the new
copy constructor preserves the pixel format and a separate method was
introduced to convert surfaces to display format.

The code was made more robust as well: it should no longer crash if the
wallpaper cannot be loaded.
2011-06-03 11:46:36 +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
0ce743426a Give SettingsDialog a direct reference to the Touchscreen and InputManager objects instead of fetching them from the GMenu2X object. 2010-07-27 23:09:16 +02:00
Maarten ter Huurne
b718658bf1 Converted public fields of MenuSetting to private. 2010-07-27 21:01:52 +02:00
Lars-Peter Clausen
6da573f303 Move methods only used by dialogs from the GMenu2x class to a common base class
for all dialog classes.
2010-05-05 14:35:52 +02:00
Lars-Peter Clausen
7fd1ab032a Use a simple array instead of a hashmap for the colors. 2010-05-02 19:53:06 +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