Open nilason opened 3 years ago
Do not miss out HIG for KDE too. GNU/Linux is not only Gnome! https://hig.kde.org/index.html
"OK | Cancel" consistency should be provided by the toolkit thus allowing automatic reorganisation based on user preferences. Here is an example how "good job" (default config without tweaks) is done by current toolkits on my system (KDE file open dialog on the left, GTK – on right; "Atvērt" = "Open", "Atcelt" = "Cancel"):
Overall for your proposal: :+1: for greater consistency.
I leave you here meditating on how many times I close some dialog by pressing wrong button just because I just switched to a different window (and thus different HIG).
@marisn Thanks for the input, greatly appreciated.
"OK | Cancel" consistency should be provided by the toolkit thus allowing automatic reorganisation based on user preferences.
This will not be trivial as there is no built-in way for detection of user prefs on platform level in wxPython (at least that I'm aware of after brief survey).
Detecting GUI flavour under Linux may need quite complicated code (but correct me if I'm wrong on this). One way to implement this is with platform detection, with "Cancel | OK" order as default, and "OK | Cancel" order for Windows – and the possibility to set (reverse) the order in GUI Settings. In this case, this has to be set for KDE to achieve the Window's style.
The easiest is to use https://wxpython.org/Phoenix/docs/html/wx.StdDialogButtonSizer.html, which we already do in some places.
This will not be trivial as there is no built-in way for detection of user prefs on platform level in wxPython (at least that I'm aware of after brief survey).
wx.StdDialogButtonSizer? Damn'! Race condition :D
wx.StdDialogButtonSizer
I did look at that, figured it might be difficult with the cases with more than two buttons: e.g.
[Cancel] [Back] [Next]
or [Done] [Apply] [OK]
,
but it may perhaps work...
I know I'm late to the show, but I think that this is a great idea and worth working out how to implement it. Such consistency with widespread standards is really valuable
Looking into this, I would perhaps keep Close/Done for r.import rather than change it to Cancel. In terms of behavior, it's similar to module dialogs.
I am not sure Done is better than Close, I would personally prefer Close as more explicit. I didn't look at the linked HIG, but e.g. QGIS uses Close (Open Data Source Manager).
Introduction
This is a proposal for a more consistent and intuitive implementation of dialog button layout and labelling. This issue did surface working on issue #743 and was touch upon again with the PR #818. Any suggestions, opinions on this issue and its implementation is highly welcome.
The dialogs in current GUI display a very disparate layout of buttons, almost with one button layout style per dialog. Often all buttons are grouped together, with various order; and buttons labeled
Close
andCancel
are used semingly interchangeable.I'm proposing changes to address this present state, based on a survey of common practices for different platforms (see references below) with following main points:
OK
) and it's negating button (e.g.Cancel
). This group is aligned to the right of the dialog window.Labelling of Buttons
The main action button should, if possible, be labelled with an imperative verb, e.g.
Import
,Reproject
(notOK
).Cancel vs. Close
I've previously made the argument https://github.com/OSGeo/grass/pull/818#discussion_r504713766 in favour for using
Cancel
overClose
. I reiterate that position here, but only in those cases where operation is aborted and any/all changes are rewound. For dialogs with e.g.Apply
or the generated module dialogs (which stays open after being run and the result will not be undone upon closing the dialog), I'd prefer labelling the buttonDone
(notClose
).Order of Buttons
Typically on Linux and Mac, the order of the buttons in the main group is with the main action button to the right: e.g.
| Cancel | OK |
, on Windows this is reversed:| OK | Cancel |
. This should be addressed for consistency with the operating system.Ideally, support for Right-to-left languages might be considered, but this is perhaps better left for future enhancement.
References (Human Interface Guidelines)
Windows Mac GNOME
Example of Proposed Changes
generated module dialogs (gui_core/forms.py) :
r.import / v.import :
d.vect / d.rast :
mapcalculator :
vector attribute manager (dbmgr/manager.py) :
sql builder (dbmgr/sqlbuilder.py) :
gui settings :
create new location :
create new mapset :
reprojection (Data tab) :
Map Swipe / Select raster maps :
Fetch & install extension :
Georectify :
Vector Network Analysis Tool / Settings :