default widgets misbehaviour



hi all,

ever since the default widget behaviour in gtk has changed, i get immensely
frustrated by the way in which dialogs currently work. grabted, the original
implementation by peter also had some problems, but at least having more than
one default widget made sense back then.
so i'm now going to outline the current problems and then my proposed
solutions.

1) we keep focus history across dialog invocations, so a dialog

+-----------+                 
| +-------+ |      +-------+  
| |  Ok   | |      | Close |  
| +-------+ |      +-------+  
+-----------+                 

when closed by clicking on "Close", will give the focus to "Close"
and upon the next invokation look like:

                 +-----------+
  +-------+      | +-------+ |
  |  Ok   |      | | Close | |
  +-------+      | +-------+ |
                 +-----------+

with "Close" having the focus, while "Ok" should actually have
the focus again. randomly (or: historically) changing the default
widget across dialog invokations is simply confusing UI behaviour.


2) property-edit kind of dialogs:

+-----------+                                  
| +-------+ |      +-------+        +-------+  
| |  Ok   | |      | Apply |        | Close |  
| +-------+ |      +-------+        +-------+  
+-----------+                                  
(apply changes     (only apply      (only close)
 and close)         changes)

when the user clicks on Apply, Apply gets the focus and has its
default border drawn, but when then the focus is moved to some
other widget, e.g. an entry, the default switches back to "Ok".
it does not switch back if a non-focusable widget is changed
though, e.g. a !can_focus toggle button.

this is very inconvenient and inconsistent usability wise,
while "Ok" is probably a good default choice, we'd actually want
the default to stay on "Apply" until the dialog is closed.
that way, the user can make changes in the dialog, hit "Apply"
if he wants to make more changes, and from then on simply activate
the last activated default widget (i.e. "Apply") with Return until
he tried out all options he wanted to alter.
switching back to "Ok" over and over is very hostily in forcing the
user to switch back and forth between mouse and keyboard.

at the next invokation of the dialog however, the default widget
has to be "Ok" again.

with the current behaviour however, there is just *no* point in
having more than default widget, because unless "Apply" or
"Close" are _focussed_, they can not be default-activated (Return),
and when they already have the focus, they can of course be
focus-activated already (Space bar).

[i do notice that motif implements this very behaviour, but that's
 simply brain-damaged also. the GUI is simply misleading in drawing
 widgets as "default" widgets under some circumstances, though they
 never can be used as such.]


3) insensitive widgets can have the default

in some dialogs, button sensitivity is toggled according to user input,
which in combination with a has_default widget can lead to:

+...........+                 
: +.......+ :      +-------+  
: : Apply : :      | Close |  
: +.......+ :      +-------+  
+...........+                 

(Apply being insensitive)

this is utterly useless, making widgets insensitive needs to also
remove their has_default state.



i discussed this with owen a bit on irc, and the base-line was,
- he wouldn't recommend more than one can_default widget anyways
- for case 2), he'd make Apply have an underline accelerator
  <Alt>A to get immediate updates whithout closing the dialog

facts are:
- we have many dialogs that do come with more than one default widget,
  whether we recommend that or not
- having accelerators for buttons is nice, but is not only usefull for
  default widgets, and shouldn't be proposed as a workaround for the
  problems at hand
- we have a concept of default widgets which can provide very
  convenient means to alter default-activation on the fly. we should
  have it work that way, instead of crippling it to
  feature-one-default-widget-and-let-the-rest-be-visibility-zombies ;)


so what i intend to change with gtk+ 1.3 is:
a) reset the focus widget when dialogs are shown, if the focus widget
   is can_default and focus_widget != default_widget.
   alternatively, we can also completely unset the focus widget when
   hiding dialogs, i don't have a strong opinion on this one, comments
   are apprechiated
b) we'll keep the last activated default widget as default widget as long
   as the dialog is visible (this is the key to having more than one
   default widget making sense)
   [this is going to affect property-edit style dialogs only, that supply
   default widgets which do not also hide a dialog]
c) making a widget insensitive will instantly remove their has_default state


---
ciaoTJ



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]