From 0eced435a03ab1ac64b5448c074aa4de32f4aee1 Mon Sep 17 00:00:00 2001 From: Sasha Koshka Date: Tue, 28 May 2024 21:57:34 -0400 Subject: [PATCH] Tweak icons example --- examples/icons/main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/examples/icons/main.go b/examples/icons/main.go index 3459cf8..7c920bd 100644 --- a/examples/icons/main.go +++ b/examples/icons/main.go @@ -7,6 +7,7 @@ import "git.tebibyte.media/tomo/nasin" import "git.tebibyte.media/tomo/objects" import "git.tebibyte.media/tomo/tomo/input" import "git.tebibyte.media/tomo/objects/layouts" +import "git.tebibyte.media/tomo/nasin/internal/theme/xdgicons" const scrollIcons = true @@ -389,13 +390,15 @@ func (this *Application) iconPopup (icon tomo.Icon) error { icon = "" } - sizesRow := objects.NewInnerContainer ( + sizesRow := objects.NewSunkenContainer ( layouts.ContractHorizontal, objects.NewIcon(icon, tomo.IconSizeSmall), objects.NewIcon(icon, tomo.IconSizeMedium), objects.NewIcon(icon, tomo.IconSizeLarge)) + sizesRow.SetAlign(tomo.AlignMiddle, tomo.AlignMiddle) okButton := objects.NewButton("OK") + okButton.SetFocused(true) okButton.OnClick(popup.Close) okButton.SetIcon(tomo.IconDialogOkay) controlRow := objects.NewInnerContainer ( @@ -404,8 +407,9 @@ func (this *Application) iconPopup (icon tomo.Icon) error { controlRow.SetAlign(tomo.AlignEnd, tomo.AlignMiddle) popup.SetRoot(objects.NewOuterContainer ( - layouts.NewGrid([]bool { true }, []bool { true, false }), + layouts.NewGrid([]bool { true }, []bool { false, false, true, false }), objects.NewLabel("Icon ID: " + string(icon)), + objects.NewLabel("XDG Name: " + xdgIcons.XdgIconName(icon)), sizesRow, controlRow, ))