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

23 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
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
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
cfb96dd697 Pass a Surface to ButtonBox' and IconButton's paint function 2014-01-16 01:19:34 +01:00
Maarten ter Huurne
742444c919 Removed Button class
It was only used to share implementation between IconButton and Link.
However, there was only one non-trivial method, handleTS(), and that
method used a different code path for each use case: doubleClick was
always false for IconButton and always true for Link. So the total
amount of code was actually reduced by eliminating this code sharing.

The main motivation for this split is that I can now freely refactor
Link without having to worry about IconButton.
2013-08-14 04:26:04 +02:00
Maarten ter Huurne
6378fcfcd7 Make Link and IconButton inherit from Button privately
Each part of the code deals with either Links or IconButtons, but
not both: the base class is only used to share implementation and
not interface. Make this explicit by doing private inheritance.
2013-08-13 01:47:02 +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
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
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
cfd294b9ae IconButton: header cleanup. 2011-10-23 12:37:39 +02:00
Maarten ter Huurne
62facf4dc7 IconButton: removed unused functionality.
Labels were always right-aligned: this was the default and no other alignment
was ever selected.
Also removed unused getter and setter methods.
2011-10-23 12:30:20 +02:00
Maarten ter Huurne
abe9130de9 IconButton: fixed up-to-date check in setPosition().
Recalculate size if either x or y changed, not necessarily both of them.
2011-10-23 12:06:59 +02:00
Maarten ter Huurne
76613d1810 IconButton: removed unused local variable. 2011-10-23 12:05:27 +02:00
Maarten ter Huurne
7861e07eb0 Surface: Made "raw" field private.
I cheated a bit by declaring ASFont as friend, but all other outside
access now happens via methods.

I removed the "saveScreenshot" method since the code calling it is
commented out and I never heard anyone complain about missing this
feature.
2011-06-02 22:44:04 +02:00
Maarten ter Huurne
a35a7e2c35 Introduced enums for text alignment in the ASFont class. 2011-05-09 05:17:25 +02:00
Maarten ter Huurne
4468464505 Give Button a direct reference to the Touchscreen object instead of fetching it from the GMenu2X object. 2010-07-27 22:12:28 +02:00
Lars-Peter Clausen
d4490ba85c remove redundant assignments 2010-05-02 20:02:21 +02:00
Lars-Peter Clausen
28d3fc9ece iconbutton: Cache icon surface instead of doing serveral hashtable lookups per
frame
2010-05-02 14:52:46 +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