Commit graph

59 commits

Author SHA1 Message Date
Eugene Sandulenko
29f3e570c3
GUI: Fix editing of colored string in List. Bug #13541 2022-06-09 19:16:36 +02:00
Torbjörn Andersson
8b94209d36 GUI: Fix caret position in list widget
Strip formatting from the list widget string before taking the length of
it to calculate the caret position. This can be seen e.g. in the save
dialog when not using the icon view.
2022-06-07 08:52:13 +02:00
Eugene Sandulenko
df0c373120
GUI: Fix game name jumping shortcut. Fixes bug #13525 2022-05-29 22:14:52 +02:00
Eugene Sandulenko
829c600a02
GUI: Remove remains of the old color lists in *ListWidget 2022-05-29 00:39:35 +02:00
D G Turner
c99f548212 GUI: Fix Set But Unused Variable Compiler Warnings in List Widgets 2022-05-28 16:33:00 +01:00
Eugene Sandulenko
1edab21c6e
GUI: Use color information from the strings in *ListWidget 2022-05-28 10:46:34 +02:00
Eugene Sandulenko
3727b3e16e
GUI: Initial code for embedding formatting info into *ListWidget strings 2022-05-26 10:31:45 +02:00
Eugene Sandulenko
abea37c9bb
ALL: Update ScummVM project license to GPLv3+ 2021-12-26 18:48:43 +01:00
Eugene Sandulenko
109beb4f86 GUI: Explicitely use Common:: namespace 2021-11-12 14:46:34 +01:00
av-dx
6f4c26061b GUI: Directly get fontHeight from g_gui.getFontHeight() 2021-11-12 14:46:34 +01:00
av-dx
4961a867fb TTS: Read correct displayed entry from the list 2021-11-12 14:46:34 +01:00
lb_ii
498f0ac8aa GUI: Extend ListWidget to use custom filter matchers 2021-11-01 15:29:34 +01:00
Le Philousophe
aa9cbdc6ab GUI: Fix invalid rect when list width goes too small 2021-06-20 13:33:38 +02:00
sluicebox
aac1eb12bf GUI: Add delete/backspace support to save/load list
- SaveLoadChooserSimple responds to kListItemRemovalRequestCmd
- ListWidget::scrollToCurrent() only scrolls when there is a
  current selected item
2021-05-28 23:15:04 +03:00
Eugene Sandulenko
eda31b9498
GUI: Initialized more variables 2021-05-01 01:49:47 +02:00
Eugene Sandulenko
493a343e6a GUI: Avoid double scaling for scrollbar and tab navbuttons 2021-04-11 21:21:44 +02:00
Torbjörn Andersson
20e09e6d56 GUI: Fix crash in setSelected() when the list index is empty
If the list is filtered, but _listIndex is empty, setSelected() would
trigger trigger an assertion because it tried to use the index value
from the unfiltered list. This would happen in the ScummVM launcher if
you filtered the list and then edited the game titles until nothing
matched your search condition any more.

Instead of checking if there is a filtered list, check if there is a
filter or not. That should hold true whether or not the filter actually
matched anything.
2020-12-29 23:31:07 +00:00
Thierry Crozat
982ecb4f93 GUI: Fix use of uninitialized variable in ListWidget constructor
The _scrollBarWidth variable was used (to create the ScrollBarWidget)
before it was initialized.
2020-09-10 00:34:45 +01:00
aryanrawlani28
2ca907b4a2 GUI: U32: Use game-list filters with u32
- Add a contains utility function to ustr
- setFilter uses U32String and U32Tokenizers
- Make consequent changes in launcher to allow sending u32strings
2020-08-30 14:43:41 +02:00
aryanrawlani28
d3e64b2df4 GUI: U32: Use const-references for tooltips 2020-08-30 14:43:41 +02:00
aryanrawlani28
ef7ec444d3 GUI: U32: Enable u32 for tts (Windows)
They always take in U32 strings now.

- Revert tts descriptions to string, they don't use translations, so better to keep it as strings.
- Make read() take in const U32 references.
2020-08-30 14:43:41 +02:00
aryanrawlani28
f800ca4ada GUI: U32: Convert majority of code to use U32
This commit also includes some additional major changes.

- Return U32String from TransMan getTranslation()
- Change tooltips to be U32Strings
- Remove temporary code of convertToU32String
- U32 Support various dialogs (Browser, FileBrowser, Messages, Chooser, etc)
- U32 for music plugins
- U32 for OSD messages
- Add some helper functions to ustr.cpp
- Change default tooltips from nullptr & 0 -> ""
- Some runtime exceptions may occur when changing languages due to incorrect String::Format
2020-08-30 14:43:41 +02:00
aryanrawlani28
5f2af6b93e GUI: U32: Add u32 support to Editables and Dialogs
- Editable widgets
- Lists
- SaveLoad Dialogs
- Browser Dialogs
2020-08-30 14:43:41 +02:00
aryanrawlani28
5a093e4e95 GUI: RTL: Improve right align text drawing
- Fix last chars being eaten
- Add support for input in right-align mode editables
- Fix issue with dirtyness of editables after clicking
- Improve spacing for lists and popup
- Make numbers reversed in lists
2020-06-22 00:03:02 +02:00
aryanrawlani28
12a4af77bd GUI: Code cleanup 2020-06-22 00:03:02 +02:00
aryanrawlani28
6ecc90edf6 GUI: RTL: Implement RTL for lists and numbers 2020-06-22 00:03:02 +02:00
aryanrawlani28
aa802df7aa GUI: RTL: Fix lists being overdrawn when tooltip focused 2020-06-22 00:03:02 +02:00
aryanrawlani28
0420dc4f6d GUI: Fix review issues, code cleanup 2020-06-22 00:03:02 +02:00
aryanrawlani28
f8ee449227 GUI: RTL: Right align main list text 2020-06-22 00:03:02 +02:00
Eugene Sandulenko
ac82bb8823 GUI: Sync constructors 2020-04-28 10:04:09 +02:00
Eugene Sandulenko
86712a3680 GUI: Initialize class variables in ListWidget 2020-04-27 14:46:58 +02:00
Eugene Sandulenko
9bea9fd5cf GUI: Sort games by dictionary, ignoring English articles 2020-04-24 10:54:00 +02:00
Bastien Bouclet
eb28c5a092 GUI: Use a dialog theme layout for the unknown game dialog 2020-01-04 10:56:25 +01:00
Bastien Bouclet
c0d8b6d9fc GUI: Introduce dynamic layouts
Prior to this change, a GUI layout was only affected by the screen size.
Now, a layout can additionally be influenced by the GUI dialog and widgets
that uses it. This capability is leveraged to implement the following
features:

* Layout elements that are not bound to a GUI widget do not take space.
   This means that dialogs where the widgets shown depend on for example
   a feature being enabled at configure time no longer have blank spaces.
* Widgets can define a minimal required size for their contents not to be
   cut. For now this is only used for buttons so their width is always
   sufficient for their caption not to be cut. This mechanism could be
   applied to other widget types in the future.
2020-01-04 10:56:25 +01:00
D G Turner
30c366ee5d GUI: Add Missing Switch Default Cases
These are flagged by GCC if -Wswitch-default is enabled.
2019-10-03 06:03:46 +01:00
D G Turner
e376abf650 GUI: Fix Missing Field Initializer in List Widget
This field was introduced by the TTS code changes, but only one of
the constructors was modified to set the default value.
2019-09-02 11:42:17 +01:00
Jaromir Wysoglad
59631627c8 TTS: Fix reading of list widgets
The TTS read items from list widgets even when the mouse was
outside the widget
2019-09-01 22:47:55 +03:00
Jaromir Wysoglad
b5cebcbeae TTS: Add text to speech to the GUI. 2019-09-01 22:47:55 +03:00
Alexander Tkachev
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
Bastien Bouclet
4d29ce21d0 GUI: Unify clip and non-clip draw calls 2018-04-19 19:18:39 +02: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
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
Alexander Tkachev
3d636617d0 GUI: Use clipping everywhere 2016-07-03 12:24:46 +02:00
Johannes Schickel
f5dfe6725a GUI: Make GPL headers consistent in themselves. 2014-02-18 02:39:35 +01:00
Johannes Schickel
129e891a87 GUI: Fix ListWidget::getEditRect's returned height. 2013-11-24 00:15:47 +01:00
D G Turner
62d07700b3 GUI: Fix missing initializers for ListWidget. CID 1002259. 2013-09-30 04:53:17 +01:00
Johannes Schickel
a41457e224 GUI: Always try to show as many entries as possible in ListWidget.
In case there were less items in the list than on a page, it was possible
that a "scrollTo" call scrolled items out of the view even though all could
be displayed. This caused odd behavior in the load dialog in T7G. There
the list contains 10 entries. In case the last one was loaded via the dialog,
the next time it was brought up again it showed the 9th entry at the top
of the view and effectively hiding all the others. It furthermore did not
show the scroll bar because all entries would have fit onto one page.

To prevent this odd behavior, a boundary check has been added to all places
where the scroll position is set. This has been taken from "scrollToCurrent"
which already tried to prevent this.

This fixes the second issue described in bug #3610960
"T7G - savegame glitches".
2013-04-16 23:25:04 +02:00