Tweak icons example

This commit is contained in:
Sasha Koshka 2024-05-28 21:57:34 -04:00
parent 072eaa6029
commit 0eced435a0

View File

@ -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 = "<UNKNOWN>"
}
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,
))