Compare commits
No commits in common. "bea78be3312e16c4bbf5a2999b96d21e33f8454b" and "7d9d93fa3fc1c9b6c9b7d7b2edcba79bc06a0074" have entirely different histories.
bea78be331
...
7d9d93fa3f
@ -7,7 +7,6 @@ import "git.tebibyte.media/tomo/nasin"
|
|||||||
import "git.tebibyte.media/tomo/objects"
|
import "git.tebibyte.media/tomo/objects"
|
||||||
import "git.tebibyte.media/tomo/tomo/input"
|
import "git.tebibyte.media/tomo/tomo/input"
|
||||||
import "git.tebibyte.media/tomo/objects/layouts"
|
import "git.tebibyte.media/tomo/objects/layouts"
|
||||||
import "git.tebibyte.media/tomo/nasin/internal/theme/xdgicons"
|
|
||||||
|
|
||||||
const scrollIcons = true
|
const scrollIcons = true
|
||||||
|
|
||||||
@ -390,15 +389,13 @@ func (this *Application) iconPopup (icon tomo.Icon) error {
|
|||||||
icon = "<UNKNOWN>"
|
icon = "<UNKNOWN>"
|
||||||
}
|
}
|
||||||
|
|
||||||
sizesRow := objects.NewSunkenContainer (
|
sizesRow := objects.NewInnerContainer (
|
||||||
layouts.ContractHorizontal,
|
layouts.ContractHorizontal,
|
||||||
objects.NewIcon(icon, tomo.IconSizeSmall),
|
objects.NewIcon(icon, tomo.IconSizeSmall),
|
||||||
objects.NewIcon(icon, tomo.IconSizeMedium),
|
objects.NewIcon(icon, tomo.IconSizeMedium),
|
||||||
objects.NewIcon(icon, tomo.IconSizeLarge))
|
objects.NewIcon(icon, tomo.IconSizeLarge))
|
||||||
sizesRow.SetAlign(tomo.AlignMiddle, tomo.AlignMiddle)
|
|
||||||
|
|
||||||
okButton := objects.NewButton("OK")
|
okButton := objects.NewButton("OK")
|
||||||
okButton.SetFocused(true)
|
|
||||||
okButton.OnClick(popup.Close)
|
okButton.OnClick(popup.Close)
|
||||||
okButton.SetIcon(tomo.IconDialogOkay)
|
okButton.SetIcon(tomo.IconDialogOkay)
|
||||||
controlRow := objects.NewInnerContainer (
|
controlRow := objects.NewInnerContainer (
|
||||||
@ -407,9 +404,8 @@ func (this *Application) iconPopup (icon tomo.Icon) error {
|
|||||||
controlRow.SetAlign(tomo.AlignEnd, tomo.AlignMiddle)
|
controlRow.SetAlign(tomo.AlignEnd, tomo.AlignMiddle)
|
||||||
|
|
||||||
popup.SetRoot(objects.NewOuterContainer (
|
popup.SetRoot(objects.NewOuterContainer (
|
||||||
layouts.NewGrid([]bool { true }, []bool { false, false, true, false }),
|
layouts.NewGrid([]bool { true }, []bool { true, false }),
|
||||||
objects.NewLabel("Icon ID: " + string(icon)),
|
objects.NewLabel("Icon ID: " + string(icon)),
|
||||||
objects.NewLabel("XDG Name: " + xdgIcons.XdgIconName(icon)),
|
|
||||||
sizesRow,
|
sizesRow,
|
||||||
controlRow,
|
controlRow,
|
||||||
))
|
))
|
||||||
|
@ -1,27 +1,12 @@
|
|||||||
//go:build unix && (!darwin)
|
//go:build unix && (!darwin)
|
||||||
package registrar
|
package registrar
|
||||||
|
|
||||||
import "os"
|
|
||||||
import "log"
|
|
||||||
import "git.tebibyte.media/tomo/x"
|
import "git.tebibyte.media/tomo/x"
|
||||||
import "git.tebibyte.media/tomo/tomo"
|
import "git.tebibyte.media/tomo/tomo"
|
||||||
import "git.tebibyte.media/tomo/nasin/internal/theme/default"
|
import "git.tebibyte.media/tomo/nasin/internal/theme/default"
|
||||||
import "git.tebibyte.media/tomo/nasin/internal/theme/xdgicons"
|
|
||||||
|
|
||||||
func Init () error {
|
func Init () error {
|
||||||
theme := defaultTheme.Theme()
|
tomo.SetTheme(defaultTheme.Theme())
|
||||||
|
|
||||||
iconThemeName := os.Getenv("TOMO_XDG_ICON_THEME")
|
|
||||||
if iconThemeName != "" {
|
|
||||||
iconTheme, err := xdgIcons.FindThemeWarn(iconThemeName)
|
|
||||||
if err == nil {
|
|
||||||
theme.IconTheme = iconTheme
|
|
||||||
} else {
|
|
||||||
log.Printf("nasin: could not load icon theme '%s': %v", iconThemeName, err)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
tomo.SetTheme(theme)
|
|
||||||
tomo.Register(1, x.NewBackend)
|
tomo.Register(1, x.NewBackend)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
@ -154,22 +154,6 @@ var rules = []dataTheme.Rule {
|
|||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
// *.Container[menu]
|
|
||||||
dataTheme.Rule {
|
|
||||||
Role: tomo.R("", "Container", "menu"),
|
|
||||||
Default: dataTheme.AS (
|
|
||||||
dataTheme.AttrBorder {
|
|
||||||
outline,
|
|
||||||
tomo.Border {
|
|
||||||
Width: tomo.I(1),
|
|
||||||
Color: borderColorLifted,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
dataTheme.AttrColor { Color: tomo.ColorBackground },
|
|
||||||
dataTheme.AttrGap { },
|
|
||||||
),
|
|
||||||
},
|
|
||||||
|
|
||||||
// *.Heading[*]
|
// *.Heading[*]
|
||||||
dataTheme.Rule {
|
dataTheme.Rule {
|
||||||
Role: tomo.R("", "Heading", ""),
|
Role: tomo.R("", "Heading", ""),
|
||||||
@ -279,20 +263,4 @@ var rules = []dataTheme.Rule {
|
|||||||
dataTheme.AttrGap { X: 8, Y: 8 },
|
dataTheme.AttrGap { X: 8, Y: 8 },
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
|
||||||
// *.MenuItem[*]
|
|
||||||
dataTheme.Rule {
|
|
||||||
Role: tomo.R("", "MenuItem", ""),
|
|
||||||
Default: dataTheme.AS (
|
|
||||||
dataTheme.AttrPadding(tomo.I(4)),
|
|
||||||
dataTheme.AttrGap { X: 4, Y: 4 },
|
|
||||||
dataTheme.AttrColor { Color: color.Transparent },
|
|
||||||
),
|
|
||||||
Hovered: dataTheme.AS (
|
|
||||||
dataTheme.AttrColor { Color: tomo.ColorAccent },
|
|
||||||
),
|
|
||||||
Focused: dataTheme.AS (
|
|
||||||
dataTheme.AttrColor { Color: tomo.ColorAccent },
|
|
||||||
),
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user