Elias Naur
11506a974e
layout: add NewContext, make zero value Contexts useful
...
While here, unexport the Queue and Config fields. The NewContext
cosntructor is shorter, and there is no reason to expose the fields
to accidental mutation.
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-12-02 13:13:15 +01:00
Elias Naur
16cc51ee8a
io/pointer: unify area ops into a single AreaOp
...
Make Rect and Ellipse constructors of AreaOp.
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-11-18 15:03:11 +01:00
Elias Naur
7299d1c875
op/clip: replace Rect and RoundRect with Rect type
...
Remembering the order of the corners in the RoundRect is difficult,
which suggest that RoundRect should be a struct with named fields.
Do that, and make Rect the special case where corner radii are all
zero.
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-11-18 14:33:28 +01:00
Larry Clapp
a770a2425c
widget: no newline in editor on submit
...
When you press enter to "submit" an editor widget, don't also append the
newline to the editor text. Enter should be "submit" or "add newline"
but not both.
Also add parens to the Enter check: x && y || z => x && (y || z).
Signed-off-by: Larry Clapp <larry@theclapp.org >
2019-11-11 00:10:09 +01:00
Elias Naur
682d2810d3
text: remove SingleLine from LayoutOptions
...
Low level text layout should not deal with filtering newlines.
Updates gio#61
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-11-09 20:01:40 +01:00
Elias Naur
778b7e6398
widget/material: rename material.go to theme.go
...
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-11-09 19:55:05 +01:00
Elias Naur
65c783179d
clip: change Rect argument to f32.Rectangle
...
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-11-09 19:42:19 +01:00
Elias Naur
4f30b985eb
op/clip: add RoundRect
...
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-11-09 19:30:07 +01:00
Elias Naur
e864ac3fc3
op/clip: split clip operations into its own package
...
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-11-09 19:07:00 +01:00
Elias Naur
9c0fc631bd
widget/material: use theme TextSize for Editors
...
Thanks to Werner Laurensse for noticing.
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-11-07 18:45:53 +01:00
Elias Naur
7256bdae38
app/internal/windows: don't draw window background on Windows
...
Avoids flickering between GPU content and the CPU drawn background
color.
gofmt -w -s . now we're here.
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-11-06 17:28:14 +01:00
Elias Naur
1defd4e759
widget/material: clean up package docs, add license, rename file
...
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-11-06 11:46:52 +01:00
Alexander Arin
089ae31f0c
widgets, widgets/material: add RadioButton & Enum
...
Signed-off-by: Alexander Arin <fralx@yandex.ru >
2019-11-06 11:02:28 +01:00
Elias Naur
82e51019e1
widget/material: document package
...
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-11-06 10:57:17 +01:00
Alexander Arin
4ac3a7fd84
widget: add SetChecked method to CheckBox
...
Signed-off-by: Alexander Arin <fralx@yandex.ru >
2019-11-04 17:10:51 +01:00
Alexander Arin
0f5b94a483
widget,widget/material: add CheckBox
2019-11-04 00:31:12 +01:00
Alexander Arin
2a06f3d3b2
widget/material: move Icon to its own file and add Color; add CornerRadius to Button
2019-11-04 00:29:21 +01:00
Elias Naur
4107485902
widget,widget/material: remove disabled drawing modes
...
Determining the enabled state of a widget from whether its Clicked method has
been called only works for button-like widgets. For example, it's not clear a
Clicked method is appropriate for a CheckBox.
Remove the feature for now, and let's find a better design in the future.
As a nice side effect, we can now process events in Layout methods, so that
buttons react to user input even when Clicked is not called.
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-11-02 14:48:22 +01:00
Elias Naur
9a6bdee813
widget/material: adjust Button insets to match Android
...
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-11-01 20:51:16 +01:00
Elias Naur
0504c27e46
widget/material: respect height minimum constraint in Button.Layout
...
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-10-23 09:56:34 +02:00
Elias Naur
3a60a384e6
widget/material: respect min width in Button.Layout
...
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-10-21 12:58:05 +02:00
Elias Naur
86f45f813e
widget/material: fix IconButton padding
...
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-10-21 09:34:26 +02:00
Elias Naur
78963bdaae
widget/material: add and use Icon.Layout method
...
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-10-21 09:21:23 +02:00
Elias Naur
bf6741f2d6
widget/material: accept nil icon in IconButton.Layout
...
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-10-17 20:50:02 +02:00
Elias Naur
3ec0948bba
widget/material: don't scale image when constrained
...
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-10-17 14:10:49 +02:00
Elias Naur
7835d6999f
widget/material: don't use translucency for disabled icon buttons
...
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-10-16 21:11:16 +02:00
Elias Naur
e2d0b3cfca
layout: invert baseline to measure positive distance from bottom
...
With an inverted baseline, the zero value results in the widget
baseline aligned to its bottom.
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-10-16 00:49:52 +02:00
Elias Naur
160408ec03
widget/material: use constraint minimums for background fills
2019-10-15 23:33:31 +02:00
Elias Naur
8da2c9dbb4
widget/material: change Image to take an ImageOp, not an image.Image
...
Using ImageOps directly avoids the image copy by NewImageOp.
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-10-14 18:17:30 +02:00
Elias Naur
74407a50d5
op/paint: add NewImageOp, unexport ImageOp fields
...
With public ImageOp fields there was no way to mark an image.Image as modified.
Replace them with NewImageOp that always make a copy, and use the opportunity
to ensure the copy is ready to upload to a GPU texture.
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-10-14 18:06:50 +02:00
Elias Naur
2e22edbb99
widget/material: remove unused function
...
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-10-14 17:41:32 +02:00
Elias Naur
0559393633
widget/material: don't use transparency for disabled buttons
...
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-10-14 15:08:13 +02:00
Elias Naur
8cd4c2e5de
widget/material: use font.Default
...
And simplify NewTheme to take no arguments.
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-10-13 18:23:39 +02:00
Elias Naur
abb99eca5c
theme/material: add the material theme
...
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-10-12 14:36:25 +02:00
Elias Naur
ff3fc7a24a
widget,text: move Label and Editor from text to widget package
...
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-10-12 14:04:34 +02:00
Elias Naur
3784ece6dd
all: rename package ui to unit
...
Package ui is now only about units except for the Config.Now method.
Remove Now and rename Config to Converter. Add layout.Config to
replace the old ui.Config.
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-09-30 16:55:47 +02:00
Elias Naur
beaec661d2
op/paint: move paint package below the op package
...
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-09-30 16:55:47 +02:00
Elias Naur
22cd88df9f
all: rename the gioui.org/ui module to gioui.org
...
The "ui" is redundant and stutters.
Signed-off-by: Elias Naur <mail@eliasnaur.com >
2019-09-30 12:37:06 +02:00