~eliasnaur/gio-patches

widget/material: Make checkbox icon modifiable Currently checkbox use default icon. Now can change it v1 PROPOSED

Song: 1
 widget/material: Make checkbox icon modifiable Currently checkbox use default icon. Now can change it

 2 files changed, 6 insertions(+), 6 deletions(-)
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~eliasnaur/gio-patches/patches/11740/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH] widget/material: Make checkbox icon modifiable Currently checkbox use default icon. Now can change it Export this patch

---
 widget/material/checkbox.go | 4 ++--
 widget/material/theme.go    | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/widget/material/checkbox.go b/widget/material/checkbox.go
index 22f37ad..c403a7d 100644
--- a/widget/material/checkbox.go
+++ b/widget/material/checkbox.go
@@ -23,8 +23,8 @@ func CheckBox(th *Theme, checkBox *widget.Bool, label string) CheckBoxStyle {
			TextSize:           th.TextSize.Scale(14.0 / 16.0),
			Size:               unit.Dp(26),
			shaper:             th.Shaper,
			checkedStateIcon:   th.checkBoxCheckedIcon,
			uncheckedStateIcon: th.checkBoxUncheckedIcon,
			checkedStateIcon:   th.CheckBoxCheckedIcon,
			uncheckedStateIcon: th.CheckBoxUncheckedIcon,
		},
	}
}
diff --git a/widget/material/theme.go b/widget/material/theme.go
index 12b3d29..42bd09b 100644
--- a/widget/material/theme.go
+++ b/widget/material/theme.go
@@ -23,8 +23,8 @@ type Theme struct {
		InvText color.RGBA
	}
	TextSize              unit.Value
	checkBoxCheckedIcon   *widget.Icon
	checkBoxUncheckedIcon *widget.Icon
	CheckBoxCheckedIcon   *widget.Icon
	CheckBoxUncheckedIcon *widget.Icon
	radioCheckedIcon      *widget.Icon
	radioUncheckedIcon    *widget.Icon
}
@@ -39,8 +39,8 @@ func NewTheme(fontCollection []text.FontFace) *Theme {
	t.Color.InvText = rgb(0xffffff)
	t.TextSize = unit.Sp(16)

	t.checkBoxCheckedIcon = mustIcon(widget.NewIcon(icons.ToggleCheckBox))
	t.checkBoxUncheckedIcon = mustIcon(widget.NewIcon(icons.ToggleCheckBoxOutlineBlank))
	t.CheckBoxCheckedIcon = mustIcon(widget.NewIcon(icons.ToggleCheckBox))
	t.CheckBoxUncheckedIcon = mustIcon(widget.NewIcon(icons.ToggleCheckBoxOutlineBlank))
	t.radioCheckedIcon = mustIcon(widget.NewIcon(icons.ToggleRadioButtonChecked))
	t.radioUncheckedIcon = mustIcon(widget.NewIcon(icons.ToggleRadioButtonUnchecked))

-- 
2.24.3 (Apple Git-128)
Patch looks great to me! Thanks for putting this together.
Looks good, one comment below.

On Sun Jul 26, 2020 at 02:07, Song wrote: