~eliasnaur/gio-patches

gio-x: component: adding a way to remove selected item v1 PROPOSED

: 1
 component: adding a way to remove selected item

 1 files changed, 6 insertions(+), 1 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/32842/mbox | git am -3
Learn more about email & git

[PATCH gio-x] component: adding a way to remove selected item Export this patch

From: er <dever@alt.tf>

Signed-off-by: er <dever@alt.tf>
---
 component/nav_drawer.go | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/component/nav_drawer.go b/component/nav_drawer.go
index 42da240..c7e8b7d 100644
--- a/component/nav_drawer.go
+++ b/component/nav_drawer.go
@@ -251,8 +251,13 @@ func (m *NavDrawer) layoutNavList(gtx layout.Context, th *material.Theme, anim *
	})
}

func (m *NavDrawer) UnselectNavDestination() {
	m.items[m.selectedItem].selected = false
	m.selectedChanged = false
}

func (m *NavDrawer) changeSelected(newIndex int) {
	if newIndex == m.selectedItem {
	if newIndex == m.selectedItem && m.items[m.selectedItem].selected {
		return
	}
	m.items[m.selectedItem].selected = false
-- 
2.36.1
Thanks! Merged.