Re: [hatari-devel] Re: [hatari-users] SDL GUI keyboard shortcuts

[ Thread Index | Date Index | More lists.tuxfamily.org/hatari-devel Archives ]


Hi,

On tiistai 12 elokuu 2014, Thomas Huth wrote:
> Eero, I've played now a little bit with the new keyboard GUI control,
> and I like it, but I also got some comments:

Any comments on what to do about the file selector?

GUI has no concept of lists or their focus, so adding
that just for file selector would be a lot of work.

Other alternative I was thinking was adding file name
completion.  When user types first letters for a filename,
GUI will:
- put to edit line the first file name matching
  the typed letters so far
- move the list so that this file name and ones
  following it are visible (which could be selected
  by typing more letters)
To type another name, user needs to pause typing for
a while.

Matching should IMHO be case insensitive, so the list
sorting should be made case insensitive too.


Btw. I'm not completely sure whether the current method
of using space to activate focuced item is the best.  I
constantly try to use Enter for that, before remembering
that Enter is used for the default action.  Using Enter
for activation would also suit "type to match" better
than space, as file names can contain spaces.

However, if Enter is used to activate the focused item,
there's no way to activate the default item (when focus
is moved away from it).

Any comments on that?


> 2) The texts in the buttons doe not seem to be centered right anymore

Fixed.  Implementing keyboard shortcuts for SDL GUI was
trivial, but handling the indications (underlining) for
those shortcuts turns surprisingly annoying.


> 3) The blue color for the focus is ... hmm, maybe ok ... but wouldn't
> it fit better to use a lighter shade of grey instead, for example?

I'm not attached to that color (it's just a place holder),
but IMHO the current gray scheme is a bit bland.

I started to move specifying of the SDL GUI colors into
same place, in preparation for potential later themeing
for the colors.  I was thinking that if it were configurable
from a text file, people could experiment with different
color combinations and we could before release pick nice one
as default + ship few good ones with Hatari.

Would you be interested / have time to look into that?
And maybe add joystick support to GUI keyboard navigation?
:-)


> 1) I get a compiler warning now:
> 
> dlgFileSelect.c: In function ‘SDLGui_FileSelect’:
> dlgFileSelect.c:515:29: warning: cast discards ‘__attribute__((const))’
> qualifier from pointer target type [-Wcast-qual]
> fsdlg[SGFSDLG_TITLE].txt = (char *)title;

There's no good way to fix text string handling in SDL GUI.
Because same field is used both for immutable text fields
and editable text fields, it needs to be "char *", not const.

However, most of the strings specified within/for SDL GUI code
(including file selector titles) are literal strings i.e.
consts.

As a result, at some point const string contents need to be set
to non-const struct member when specifying button/text string.
Doing it in the current place gives the least amount of warnings.

Other alternative would be to dup the string & free it at every
function exit, but doing it just to silence a warning seems
icky.  Strings for non-editfields aren't modified.



	- Eero



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/