persist favorites page view settings
This commit is contained in:
@@ -43,19 +43,24 @@ func (t *ToggleButtonGroup) ActivatedButtonIndex() int {
|
||||
return t.activeBtnIdx
|
||||
}
|
||||
|
||||
func (t *ToggleButtonGroup) onTapped(btnIdx int) bool {
|
||||
func (t *ToggleButtonGroup) SetActivatedButton(idx int) {
|
||||
changed := t.activeBtnIdx != idx
|
||||
t.activeBtnIdx = idx
|
||||
for i, b := range t.buttonContainer.Objects {
|
||||
if i == btnIdx {
|
||||
if i == idx {
|
||||
b.(*widget.Button).Importance = widget.HighImportance
|
||||
} else {
|
||||
b.(*widget.Button).Importance = widget.MediumImportance
|
||||
}
|
||||
}
|
||||
changed := t.activeBtnIdx != btnIdx
|
||||
t.activeBtnIdx = btnIdx
|
||||
if changed {
|
||||
t.Refresh()
|
||||
}
|
||||
}
|
||||
|
||||
func (t *ToggleButtonGroup) onTapped(btnIdx int) bool {
|
||||
changed := t.activeBtnIdx != btnIdx
|
||||
t.SetActivatedButton(btnIdx)
|
||||
return changed
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user