Commit Graph
97 Commits
Author SHA1 Message Date
Alexander TkachevandMatan Bareket c91bcbfb94 GUI: Fix scrollbars
- removed +1px in ListWidget, added in lordhoto's 2007 commit 68eb28a
(aka r29971 in svn) `Fix for bug #1670082 "GUI: Modern theme gfx glitch
in launcher".`, because it made clip this last line of scrollbar in all
themes, which doesn't look good. In 2007 theme was written in .ini,
which is not the case now. I don't see any glitches after removing this
"fix";

- fixed how scrollbar top and bottom scroll buttons are drawn in
ThemeEngine::drawScrollbar: there were these weird magic numbers, but in
reality extra space that buttons should occupy is hardcoded in
scrollbar.cpp (ScrollBarWidget) and is just +1px.
2019-08-03 04:35:48 -04:00
Alexander TkachevandMatan Bareket 99c2418d1a GUI: Rewrite Cloud tab
- StorageWizardDialog is removed, along with bmps it was using;
- EditTextWidget now accepts custom font in constructor;
- ScrollContainer scrollbar now jumps to top when content height changes
so it's "overscrolled";
- IndexPageHandler now does not awaits for `code` GET-parameter, as
local webserver is no longer used to connect Storages;
- CloudManager and all corresponding Storages are updated to support
disconnecting and to notify about successful connection.
2019-07-30 14:51:41 -04:00
Thierry Crozat 63a6a3c3de GUI: show/hide virtual keyboard when the EditTextWidget gains/loses the focus 2019-02-16 17:20:57 +00:00
Bastien Bouclet c1bd6a250d GUI: Add some override markers 2018-11-14 20:27:41 +01:00
Bastien Bouclet 7c570d9b25 GUI: Don't display the ScrollContainer background inside tabs
Fixes #10645.
2018-11-14 20:27:41 +01:00
D G Turner efcd857083 GUI: Fix Mouse Wheel Input for Unknown Game Dialog.
This should also fix this for other instances of ScrollContainer, though
the dialogs / widgets may require the same change.

This fixes bug Trac #10741.
2018-10-11 05:52:02 +01:00
Bastien Bouclet ac4b2efd3f GUI: Clean up file browser path entry 2018-08-27 06:39:40 +02:00
Chatziargyriou EleftheriaandThierry Crozat 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 BoucletandEugene Sandulenko 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 TkachevandEugene Sandulenko cea58cc61c JANITORIAL: Remove trailing spaces 2016-07-03 12:24:53 +02:00
Alexander TkachevandEugene Sandulenko 3d636617d0 GUI: Use clipping everywhere 2016-07-03 12:24:46 +02:00
Alexander TkachevandEugene Sandulenko dc9b32e620 GUI: Fix PopUpDialog 2016-07-03 12:24:28 +02:00
Alexander TkachevandEugene Sandulenko 80412a4139 GUI: Add drawTabClip() 2016-07-03 12:22:10 +02:00
Alexander TkachevandEugene Sandulenko f22d11953d GUI: Add drawSquareClip() 2016-07-03 12:21:09 +02:00
Alexander TkachevandEugene Sandulenko 559ca37daf GUI: Add VectorRendererSpec::drawTriangleClip() 2016-07-03 12:20:37 +02:00
Alexander TkachevandEugene Sandulenko 0ae4409138 GUI: Add ThemeLayoutTabWidget 2016-07-03 12:20:03 +02:00
Alexander TkachevandEugene Sandulenko 24963ac97d GUI: Fix Dialog's and TabWidget's reflowLayout() 2016-07-03 12:19:48 +02:00
Alexander TkachevandEugene Sandulenko 421f9826c8 GUI: Hide scrollbar in ScrollContainerWidget when needed 2016-07-03 12:19:31 +02:00
Alexander TkachevandEugene Sandulenko 40fa9b4de3 GUI: Fix ScrollContainerWidget's reflowLayout() 2016-07-03 12:19:15 +02:00
Alexander TkachevandEugene Sandulenko ac25acbccc GUI: Update ScrollContainerWidget 2016-07-03 12:18:52 +02:00
Alexander TkachevandEugene Sandulenko 9c1eab6415 GUI: Fix ScrollContainerWidget look a bit 2016-07-03 12:18:34 +02:00
Alexander TkachevandEugene Sandulenko 31e528c070 GUI: Make ScrollContainerWidget do full redraw 2016-07-03 12:17:43 +02:00
Alexander TkachevandEugene Sandulenko b946ef8598 GUI: Make ScrollContainerWidget hide children 2016-07-03 12:17:01 +02:00
Alexander TkachevandEugene Sandulenko fca0f0ed34 GUI: Make PopUpWidget clip 2016-07-03 12:16:43 +02:00
Alexander TkachevandEugene Sandulenko 8f2d35b0b8 GUI: drawRoundedSquareClip() 2016-07-03 12:16:26 +02:00