Inputs: review r1 fixes
This commit is contained in:
29 files changed
+417
-84
No files matched your search
+4
-1
@@ -9,7 +9,7 @@ import (
|
||||
"mujicaui/theme"
|
||||
)
|
||||
|
||||
// ButtonGroupItem is one button of a ButtonGroup. Give Label, Icon or both.
|
||||
// ButtonGroupItem is one button of a ButtonGroup. Give Label, Icon or both; icon-only needs Name.
|
||||
type ButtonGroupItem struct {
|
||||
Label string
|
||||
Icon *ui.SVG
|
||||
@@ -55,6 +55,9 @@ func ButtonGroup(c *ui.Context, items []ButtonGroupItem, opts ButtonGroupOptions
|
||||
if it.Label == "" && it.Icon == nil {
|
||||
panic("mujica: ButtonGroupItem needs a Label or an Icon")
|
||||
}
|
||||
if it.Label == "" && it.Name == "" {
|
||||
panic("mujica: icon-only ButtonGroupItem needs a Name")
|
||||
}
|
||||
b := ui.ButtonBase(c).Key(i).MinHeight(d.ControlHeight()).MinWidth(d.ControlHeight()).
|
||||
Padding(0, d.Unit()*3).Gap(d.Unit() * 2).Disabled(it.Disabled)
|
||||
internal.Ring(b, k.Focus, theme.ControlRadius)
|
||||
|
||||
Reference in new issue
Block a user