Difference between revisions of "GUI Guidelines"
From GnuCash
(1. Draft) |
(→Mnemonics and Accelerators: glade files; highlighting) |
||
Line 3: | Line 3: | ||
*'''Accelerators''' are keyboard "hot-keys" like ctrl-c for copy | *'''Accelerators''' are keyboard "hot-keys" like ctrl-c for copy | ||
*'''Mnemonics''' are part of the menu label, the underscore, so they would be included in the msgid. | *'''Mnemonics''' are part of the menu label, the underscore, so they would be included in the msgid. | ||
+ | ** In glade files they have <code><property name="use_underline">True</property></code>. | ||
== Possible Problems== | == Possible Problems== | ||
from [https://lists.gnucash.org/logs/2018/01/04.html IRC]: | from [https://lists.gnucash.org/logs/2018/01/04.html IRC]: | ||
* First off, mnemonics work differently for different widgets. e.g. on buttons they work like accelerators: <alt>F operates the button with that mnemonic--as long as there isn't an accelerator set to <alt>F because accelerators are handled first by gtkevent. Menuitem mnemonics work without a modifier key if one has the containing menu open. | * First off, mnemonics work differently for different widgets. e.g. on buttons they work like accelerators: <alt>F operates the button with that mnemonic--as long as there isn't an accelerator set to <alt>F because accelerators are handled first by gtkevent. Menuitem mnemonics work without a modifier key if one has the containing menu open. | ||
* Mnemonics can be attached to any widget via gtk_label_new_with_mnemonic() and gtk_label_set_mnemonic_widget(), so it would be easy to go crazy and have them everywhere. | * Mnemonics can be attached to any widget via gtk_label_new_with_mnemonic() and gtk_label_set_mnemonic_widget(), so it would be easy to go crazy and have them everywhere. | ||
− | * But we also need to be careful to ensure that they're turned off when focus is inside an edit because <alt> is used to extend the keyboard on Macs. For example to type ö I use <alt>u followed by o. We've had several bugs on Gramps where some mnemonic grabbed the <alt>u and prevented users from typing umlauts. | + | * But we also need to be careful to ensure that they're turned off when focus is inside an edit because <alt> is used to ''extend the keyboard'' '''on Macs'''. For example to type ö I use <alt>u followed by o. We've had several bugs on Gramps where some mnemonic grabbed the <alt>u and prevented users from typing umlauts. |
Revision as of 23:06, 4 January 2018
This page collects rules for the GUI. You should mind them while coding or translating.
Mnemonics and Accelerators
- Accelerators are keyboard "hot-keys" like ctrl-c for copy
- Mnemonics are part of the menu label, the underscore, so they would be included in the msgid.
- In glade files they have
<property name="use_underline">True</property>
.
- In glade files they have
Possible Problems
from IRC:
- First off, mnemonics work differently for different widgets. e.g. on buttons they work like accelerators: <alt>F operates the button with that mnemonic--as long as there isn't an accelerator set to <alt>F because accelerators are handled first by gtkevent. Menuitem mnemonics work without a modifier key if one has the containing menu open.
- Mnemonics can be attached to any widget via gtk_label_new_with_mnemonic() and gtk_label_set_mnemonic_widget(), so it would be easy to go crazy and have them everywhere.
- But we also need to be careful to ensure that they're turned off when focus is inside an edit because <alt> is used to extend the keyboard on Macs. For example to type ö I use <alt>u followed by o. We've had several bugs on Gramps where some mnemonic grabbed the <alt>u and prevented users from typing umlauts.