Commit Graph
90 Commits
Author SHA1 Message Date
Chatziargyriou Eleftheria 4188ba1252 GUI: Add editable path in file browser dialog 2018-08-22 00:39:51 +01:00
Thierry Crozat bd98c6f045 GUI: Handle continous scrolling in ScrollContainer
When keeping the scrollbar up or down arrow pressed in a
ScrollContainer is now scrolls continously, as it was
already doing in the ListWidget.
2018-07-24 00:27:11 +01:00
Thierry Crozat 211ef61fdf GUI: Set ScrollContainer single step to kLineHeight instead of 1 pixel
The single step is the amount of scroll done when clicking once on
the scrollbar up or down arrow. It used to be 1 entry, but for the
ScrollContainer 1 entry is 1 pixel, which was too litle. Now the
single step can be set to a multiple entries.
2018-07-24 00:27:11 +01:00
Thierry Crozat f7a4b74130 GUI: Fix container widgets not receiving events 2018-07-24 00:27:11 +01:00
Adrian Frühwirth c7f3416daa JANITORIAL: Remove trailing whitespace 2018-05-20 23:40:20 +02:00
Thierry Crozat 6ab6d76792 GUI: Add copy to clipboard shortcut for EditableWidget 2018-04-29 21:47:10 +01:00
Bastien Bouclet 4d29ce21d0 GUI: Unify clip and non-clip draw calls 2018-04-19 19:18:39 +02:00
Eugene Sandulenko b0affe5bf2 GUI: Added override specifiers 2018-03-28 12:47:23 +02:00
Bastien Bouclet 4d0bb753e4 GUI: Remove the ThemeItem draw queues
Drawing nows happens directly when the Dialog or Widget draw methods are
called. This makes it easy to debug why a particular low level draw
method was called, by inspecting the call stack.

This replaces the notion of "buffering" by two independant ways to
control what is drawn and where:
- The active layer is used to select whether the foreground or
  background part of the dialogs are rendered by the draw calls.
- The active surface is used to select if the draw calls affect the back
  buffer or the screen.

The foreground layer of the active dialog is drawn directly to the
screen. Its background layer is drawn to the back buffer. This way
widgets can restore the back buffer in order to update without having to
redraw the dialog's background.

Dialogs lower in the dialog stack are drawn entirely to the back buffer.
2018-03-12 11:46:04 +01:00
Bastien Bouclet 7dc602f352 GUI: Fix the caret drawing over the scroll bar in the list widget
Also remove the unused linesWidth variable and fix the hlLeftPadding and
hlRightPadding widget attributes to actually work.

There are still issues remaining with the caret in the list widget due
to the ellipsis being used to shorten long text. Ellipsis is accounted
for when drawing the text but not when computing the caret position.
2018-01-27 18:12:53 +01:00
Bastien Bouclet 5878c618c9 GUI: Remove Dialog::markAsDirty to expose full GUI redraws 2018-01-27 18:12:34 +01:00
Bastien Bouclet fc37918130 GUI: Remove explicit redraw when scrolling the ScrollContainer
The redraw is already handled by the GUI main loop
2018-01-27 18:12:34 +01:00
Bastien Bouclet 0496ede62f GUI: Implement dirty-checking for widget redraws 2018-01-27 18:12:34 +01:00
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