77 Commits

Author SHA1 Message Date
Bastien Bouclet
f5b335af10 GUI: Mark some fall-through cases as intentional
Comments explain how the num lock handling works before the
fall-through cases.
2017-08-06 17:55:33 +02:00
Thierry Crozat
91125bcbcd GUI: Add method to know if a widget contains a given widget 2017-04-06 21:55:28 +01:00
Willem Jan Palenstijn
7dd1a1e4f5 GUI: Increase tab title spacing 2017-03-01 00:24:06 +01:00
Willem Jan Palenstijn
5510640dbc GUI: Give each tab in TabWidget its own width
The width of each tab is now computed from its title, independently of
the other tabs. This increases the number of tabs that fit on the
screen.

This rewrite also fixes a bug where if the window size increased while
_firstVisibleTab > 0, some tabs would become inaccessible when the
scroll buttons were hidden.

The layout key Globals.TabWidget.Tab.Width is now treated as minimal
tab width. This is set so that the tabs fit reasonably well in lowres
layouts.

At the same time, this reduces the lowres scroll buttons heights to fit.

This patch makes the Nintento DS hacks in TabWidget obsolete.
(Hopefully! I'm not able to test.)
2017-02-28 15:55:52 +01:00
rsn8887
45bd7a8b75 SDL: Fix erratic analog pointer + control options
Fixes erratic speeds in analog pointer motion
Implemented option to set analog/keyboard pointer speed
and control the analog joystick deadzone. The deadzone option appears
only if the build supports analog joystick (via JOY_ANALOG define)
2017-02-22 16:52:09 -06:00
Thierry Crozat
50847f9e03 GUI: Setting the active tab also ensures it is visible in the tab bar 2016-10-30 18:22:56 +00:00
Thierry Crozat
74b3b45c61 GUI: Fix possible access to free'ed memory or double deletion in tab widget
The issue could occur when adding or removing widgets to a tab, and then
not switching to a different tab before the destructor or reflowLayout() were
called. In such a case the firstWidget of the current widget in the _tabs list
could be out of date. Accessing this first widget from the destructor or from
reflowLayout() could then cause a crash, or random issues caused to access
to free'ed memory. In theory this could also lead to a memory leak, although
I don't think this could occur in our current code.

Usually we add several tabs to a TabWidget and then switch back to the first
tab after building all the tabs. So in such a case the issue would not occur.
But because we are deleting and reconstructing the clear buttons for the
MIDI and Path tabs of the options dialog from reflowLayout(), if the current
tab is the Path tab, it would be kept as active tab after adding and removing
widget to it and the issue would occur.

This fixes bug #9618.
2016-10-22 21:32:16 +01:00
Alexander Tkachev
b9bba9bd4b ALL: Move Clipboard support to OSystem
Commit adds kFeatureClipboardSupport. hasTextInClipboard() and
getTextFromClipboard().

OSystem_SDL has this feature if SDL2 is used.

EditableWidget and StorageWizardDialog use g_system to access clipboard
now.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
438ba985a4 JANITORIAL: Remove spaces at the end of the line
I knew there were some, but I wanted to fix them once, instead of doing
it all the time.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
75fbecf616 GUI: Add Ctrl+V handling in EditableWidget
In SDL2 there is SDL_GetClipboardText(), so EditableWidget could support
pasting into it.

No copying yet, as there is no selecting.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
2f5138f795 GUI: Minor Container fixes
I should've done these in PR, I guess.
2016-08-24 16:07:55 +06:00
Alexander Tkachev
9975307caf GUI: Fix Container's visibility issue
Now it respects outer code's decision to hide or move some widgets
around. Outer code must be CommandReceiver which is set as
ScrollContainer's target.
2016-08-24 16:07:55 +06:00
Eugene Sandulenko
499e5ab3ea GUI: Fix regression in multicolumn PopUp widget 2016-07-22 14:36:00 +03:00
Alexander Tkachev
64a79fd1ab GUI: Fix TabWidget height issues
Changes theme stx files to specify TabWidget's type. That fixes wrong TabWidget height.

Changes TabWidget's getHeight() to return not only "children" height, but also tabs height. That fixes wrong clipping area.

Changes Widget's findWidget to use getHeight(). That fixes bug when widgets in the bottom of TabWidget were not reacting to the mouse events.
2016-07-12 22:37:57 +06:00
Alexander Tkachev
cea58cc61c JANITORIAL: Remove trailing spaces 2016-07-03 12:24:53 +02:00
Alexander Tkachev
3d636617d0 GUI: Use clipping everywhere 2016-07-03 12:24:46 +02:00
Alexander Tkachev
dc9b32e620 GUI: Fix PopUpDialog 2016-07-03 12:24:28 +02:00
Alexander Tkachev
80412a4139 GUI: Add drawTabClip() 2016-07-03 12:22:10 +02:00
Alexander Tkachev
f22d11953d GUI: Add drawSquareClip() 2016-07-03 12:21:09 +02:00
Alexander Tkachev
559ca37daf GUI: Add VectorRendererSpec::drawTriangleClip() 2016-07-03 12:20:37 +02:00
Alexander Tkachev
0ae4409138 GUI: Add ThemeLayoutTabWidget 2016-07-03 12:20:03 +02:00
Alexander Tkachev
24963ac97d GUI: Fix Dialog's and TabWidget's reflowLayout() 2016-07-03 12:19:48 +02:00
Alexander Tkachev
421f9826c8 GUI: Hide scrollbar in ScrollContainerWidget when needed 2016-07-03 12:19:31 +02:00
Alexander Tkachev
40fa9b4de3 GUI: Fix ScrollContainerWidget's reflowLayout() 2016-07-03 12:19:15 +02:00
Alexander Tkachev
ac25acbccc GUI: Update ScrollContainerWidget 2016-07-03 12:18:52 +02:00
Alexander Tkachev
9c1eab6415 GUI: Fix ScrollContainerWidget look a bit 2016-07-03 12:18:34 +02:00
Alexander Tkachev
31e528c070 GUI: Make ScrollContainerWidget do full redraw 2016-07-03 12:17:43 +02:00
Alexander Tkachev
b946ef8598 GUI: Make ScrollContainerWidget hide children 2016-07-03 12:17:01 +02:00
Alexander Tkachev
fca0f0ed34 GUI: Make PopUpWidget clip 2016-07-03 12:16:43 +02:00
Alexander Tkachev
8f2d35b0b8 GUI: drawRoundedSquareClip() 2016-07-03 12:16:26 +02:00
Alexander Tkachev
34af71a8ef GUI: Remove _clippingArea from ScrollContainer 2016-07-03 12:14:23 +02:00
Alexander Tkachev
9bf2d65dd2 GUI: Cleanup in ScrollContainer 2016-07-03 12:13:57 +02:00
Alexander Tkachev
49caaf77a1 GUI: Add ScrollContainer 2016-07-03 12:10:56 +02:00
Eugene Sandulenko
b590cc2d8f GUI: Cleanup class initialization 2016-06-01 13:16:12 +02:00
Eugene Sandulenko
bf06b3bc18 GUI: Initialize widget padding 2016-05-02 15:19:07 +02:00
Eugene Sandulenko
35a44edca1 GUI: Implement immediate coordinate mode for PopUp widget 2016-03-30 19:02:02 +02:00
Eugene Sandulenko
6f44d4f7e1 GUI: Make disabled EditTextWidget not allowing to edit the string 2015-11-07 13:26:55 +01:00
Filippos Karapetis
0d81e522c1 GUI: Remove trailing whitespace 2014-10-28 15:38:51 +02:00
Zerophase
5c12e09ed1 GUI: Tab cycling handles multiple themes.
First visible tab moves up when a theme's width cannot fit another tab.
2014-04-06 19:58:56 -05:00
Zerophase
5df3c14eba GUI: Fix tab cycling when total tabs increase.
Tab cycling ignores tab width, and slides correctly for larger tab counts.
2014-04-01 07:28:57 -05:00
Zerophase
80d34a8a7c GUI: Add Tab cycling to TabWidget
Tab and Shift-Tab can now cycle between each Tab of the Edit Game menu.
2014-04-01 07:28:48 -05:00
Johannes Schickel
f5dfe6725a GUI: Make GPL headers consistent in themselves. 2014-02-18 02:39:35 +01:00
Johannes Schickel
fe7f28bf6c GUI: Do not draw text outside edit rect in EditableWidget. 2013-11-24 01:15:27 +01:00
Johannes Schickel
b487c1fc38 GUI: Fix undrawing caret glitch when the edit text is inversed.
This is prominently visible in the list based save/load chooser since the
edit string is drawn on a special green background there. When the caret is
at the end of the edit string this would result in the green color missing
at the place of the (undrawn) caret. To avoid this we simply draw a fake
space now.
2013-11-24 00:38:47 +01:00
Johannes Schickel
95f07fd405 GUI: Document EditableWidget::getEditRect. 2013-11-24 00:20:29 +01:00
Johannes Schickel
3be846cfd7 GUI: Draw caret over the whole height of the edit rect.
This improves the look of the editable widgets.
2013-11-24 00:15:48 +01:00
Johannes Schickel
bb4a730a88 GUI: Fix out-of-bounds check in EditableWidget::drawCaret.
The line "y + editRect.height() + 2" is not included in drawing anymore. Thus
it is allowed to equal EditableWidget::_h.
2013-11-24 00:15:48 +01:00
Johannes Schickel
aaad08c9fe GUI: Fix character redrawing behind caret in EditTextWidgets.
This fixes an ugly y position change when the caret is moved to a character in
an edit text widget.
2013-11-24 00:15:48 +01:00
Johannes Schickel
e036aa76da GUI: Fix EditTextWidget::getEditRect's returned height. 2013-11-24 00:15:48 +01:00
Johannes Schickel
129e891a87 GUI: Fix ListWidget::getEditRect's returned height. 2013-11-24 00:15:47 +01:00