go.*,colorpicker,component,debug,outlay,richtext: make compatible with latest Gio
This commit updates all widget/gesture event API use to be compatible with the
latest Gio APIs.
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
debug: single debugger at a time and keyboard shortcuts
This commit ensures that only a single constraint debugger is active at a time within
a given window (using keyboard focus) and adds some simple keyboard shortcuts to the
editor.
- Escape: unfocus the constraint editor
- R: reset the constraints to their unmodified values
- M: set the max constraint equal to the min constraint
- Shift-M: set the min constraint equal to the max constraint
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
debug: display constraint/size values as text
This commit adds an overlay displaying the numerical values of the constraints.
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
debug: add global helpers with automagic state management
This commit adds two global functions that can use any unique tag to store the
constraint editor state in a map, making it much easier for layout authors to
insert ad-hoc constraint editors into their code.
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
debug: define simple constraint editor
This commit defines debug.ConstraintEditor, a type that can be easily inserted
into layout code to allow the programmer to experiment with constraint manipulations
within their live interface.
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
component: update context area absolute position docs
This commit clarifies the documentation for component.ContextArea's AbsolutePosition
field to make the intended use clearer.
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
outlay: fix pre go 1.21 slices package use
I didn't realize that my editor imported the wrong slices package here.
We do support Go 1.20, so I've swapped to the old slices package in x.
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
component: deprecate TruncatingLabelStyle
This type is no longer needed now that the core text widgets internally support truncation.
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
component: fix bad field rename
This commit fixes a failed automatic refactor that was supposed to rename the outlay
inset fields from Left/Right to Start/End.
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
component: make menu items RTL compatible
Thanks to Imran Iqbal for prompting me to do this. Imran submitted a
great patch that manually flipped the presentation order of items based on
locale, but I really didn't want to have to do that everywhere. Instead,
I defined some layout helpers that do the right thing based on the locale
and used those to achieve the same effect for menu items. All of package
component needs this conversion, but I can't tackle the thorough testing
required right now.
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>
outlay: add locale aware flex and inset types
This commit adds analogs to layout.Inset and layout.Flex that automatically
respond to the system text direction provided by gtx.Locale and flip their
visuals. This makes it easier to write RTL-aware layout code without significant
logic changes.
Signed-off-by: Chris Waldon <christopher.waldon.dev@gmail.com>