How to switch yes and no buttons in dialog box, either in Windows or Linux?

2

I'm using the Cinnamon DE (based on Gnome 3, uses the GTK3 toolkit) for GNU/Linux.

I also use Windows 10 for approximately the same amount of time each week.

Now, the default button positions for each environment is different, and this is driving me crazy. In MS Windows, the "confirm" action is located on the left:

enter image description here

While on Cinnamon (and GNOME), they are located on the right:

enter image description here

This is consistent across all dialogs. Another example:

enter image description here

In this case, not only the buttons are positioned differently, the action highlighted by default is different too.

Is there any way to change this for either system, so that I can work with more sanity?

Marc.2377

Posted 2017-06-20T23:13:03.560

Reputation: 1 072

You cant change this behavior on Windows – Ramhound – 2017-06-20T23:33:21.490

1@Ramhound I figured – Marc.2377 – 2017-06-21T00:01:31.883

Answers

7

I highly doubt it is possible to change the button order in Windows, but GTK can! To change the order of the Cancel/No/Yes buttons, set the gtk-alternative-button-order property by adding this to your ~/.config/gtk-3.0/settings.ini file:

[Settings]
gtk-alternative-button-order = 1

For some background, the GNOME Human Interface Guidelines specify that the cancel button should be on the left:

When a dialog includes an affirmative and a cancel button, always ensure that the cancel button appears first, before the affirmative button. In left-to-right locales, this is on the left.

This button order ensures that users become aware of, and are reminded of, the ability to cancel prior to encountering the affirmative button.

But it's Linux; so it's configurable! From the gtk_dialog_set_alternative_button_order() documentation:

Sets an alternative button order. If the “gtk-alternative-button-order” setting is set to TRUE, the dialog buttons are reordered according to the order of the response ids passed to this function.

By default, GTK+ dialogs use the button order advocated by the GNOME Human Interface Guidelines with the affirmative button at the far right, and the cancel button left of it. But the builtin GTK+ dialogs and GtkMessageDialogs do provide an alternative button order, which is more suitable on some platforms, e.g. Windows.

The Windows user experience guidelines have the opposite recommendation. They state:

Present the commit buttons in the following order:

  1. OK/[Do it]/Yes
  2. [Don't do it]/No
  3. Cancel
  4. Apply (if present)
  5. Help (if present)

Tim

Posted 2017-06-20T23:13:03.560

Reputation: 1 375

And the benefit of Cancel being the default action is that in case of inadvertent confirmation by way of accidental Enter or Spacebar keypress, the resulting action is (usually) a no-op. – K3---rnc – 2019-07-28T19:27:50.967