Commit Graph

14 Commits

Author SHA1 Message Date
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 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 160408ec03 widget/material: use constraint minimums for background fills 2019-10-15 23:33:31 +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 abb99eca5c theme/material: add the material theme
Signed-off-by: Elias Naur <mail@eliasnaur.com>
2019-10-12 14:36:25 +02:00