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

35 Commits

Author SHA1 Message Date
Maarten ter Huurne
428a316bc1 Removed GMenu2X pointer from ButtonBox
It was only used to fetch resY, so I replaced that by taking the
y-coordinate as an argument. That is also more consistent with the
x-coordinate which was already an argument.

The x-coordinate was changed to a signed int, since that is the norm
for paint coordinates. It can be useful for drawing widgets that are
partially off screen, for example during a (dis)appear animation.

In InputDialog, the ButtonBox field was changed from a pointer to
a plain data member. There was no need to dynamically allocate it.
2014-08-16 05:52:25 +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
Nebuleon Fumika
f85ef14b3e Remove unnecessary file existence check in WallpaperDialog::exec()
Browsing the user's wallpaper directory will simply add no new files
to the list of wallpapers available if the directory doesn't exist.
WallpaperDialog::exec doesn't need to care about that.

Because wallpapers are files, not directories, also don't return
directories in the result. The code that makes the wallpapers list
calls FileLister::getFiles and ignores directories anyway.
2014-08-13 22:51:56 +02:00
Nebuleon Fumika
1dec6f6f11 Split creation, configuration and use of FileLister objects
The constructor now has zero arguments. showDirectories and showFiles
are now set using setter methods.

FileLister::browse is now the sole way to start a scan for files and
directories, replacing the initial path in the constructor and the
setPath method. It allows merging results from multiple directories
as before.

This is all to make explicit how many times the costly task of browsing
a directory is actually carried out.
2014-08-13 04:50:22 +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
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
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
917cbf7208 Various changes related to translations 2014-07-15 14:25:17 +02:00
Paul Cercueil
408a991a9d Remove hardcoded sizes and positions in WallpaperDialog 2014-01-16 15:49:51 +01:00
Paul Cercueil
cfb96dd697 Pass a Surface to ButtonBox' and IconButton's paint function 2014-01-16 01:19:34 +01: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
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
4ed21f27e5 Fix extension filter of the wallpaper dialog 2013-07-05 17:08:09 -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
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
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
38cfd321f6 Modified the key shortcuts for the wallpaper dialog. 2011-09-18 03:16:08 +02:00
Ayla
c9a51af4a6 The WallpaperDialog object now uses a ButtonBox to print the key mapping at the bottom of the screen. 2011-09-18 01:34:19 +02:00
Xiangfu Liu
46d680990a gmenu2x wallpaper only support .png 2011-08-22 15:13:44 +08:00
Ayla
ef4b012026 Merge branch 'master' of projects.qi-hardware.com:gmenu2x into install_locations
Conflicts:
	data/platform/nanonote/sections/terminals/ash
	src/gmenu2x.cpp
	src/surface.cpp
2011-06-02 12:16:26 +02:00
Maarten ter Huurne
a35a7e2c35 Introduced enums for text alignment in the ASFont class. 2011-05-09 05:17:25 +02:00
Ayla
6c97139113 The FileLister won't list a file if a previous one has the same file name (without path).
This is useful when the files/directories lists are not cleared; then it is possible to define priorities between the files.
For instance, the skin "Default" will be shown only once, even if the directory "Default" exists both in the system and the user directories.
As the skin and translation loading functions does check both directories, there is no problem in doing that.
2011-04-14 11:16:16 +02:00
Ayla
f2b34f383b The wallpapers will now be loaded from the system and the user-specific skin directories. 2011-04-12 10:18:10 +02:00
Ayla
563cb34a89 Rewrote the whole input system.
Gmenu2X will no longer eat 100% CPU ;)
2010-09-17 22:34:26 +02:00
Ayla
7c9364780b Replaced every message output by calls to the log macros. 2010-09-17 22:31:09 +02:00
Maarten ter Huurne
8032d96a17 Converted public fields of FileLister to private. 2010-07-27 21:41:35 +02:00
Maarten ter Huurne
ea7b4ec002 Removed unused field. 2010-07-26 05:08:56 +02:00
Maarten ter Huurne
90df129f66 Initialize field using init syntax instead of assignment.
No functional change.
2010-07-26 03:36:55 +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
Mirko Lindner
cddcd72e33 initial commit - needs clean-up
Signed-off-by: Mirko Lindner <mirko@sharism.cc>
2010-02-04 12:33:47 +01:00