Compare commits

...

3 Commits

Author SHA1 Message Date
753e3e4023 Styling fixes 2024-07-26 17:54:06 -04:00
5c46950224 Fix large icons png 2024-07-26 17:53:59 -04:00
f22c268a10 Update application.go code 2024-07-26 17:53:48 -04:00
3 changed files with 11 additions and 13 deletions

View File

@ -8,7 +8,6 @@ import "strings"
import "net/url"
import "git.tebibyte.media/tomo/tomo"
import "git.tebibyte.media/tomo/objects"
import "git.tebibyte.media/tomo/tomo/canvas"
import "git.tebibyte.media/tomo/nasin/internal/registrar"
// Application represents an application object.
@ -202,22 +201,16 @@ func applicationOpenUrls (application Application, args ...string) {
}
func setApplicationWindowIcon (window tomo.Window, description ApplicationDescription) {
allSizes := func (icon tomo.Icon) (sizes []canvas.Texture) {
small := icon.Texture(tomo.IconSizeSmall)
medium := icon.Texture(tomo.IconSizeMedium)
large := icon.Texture(tomo.IconSizeLarge)
if small != nil { sizes = append(sizes, small) }
if medium != nil { sizes = append(sizes, medium) }
if large != nil { sizes = append(sizes, large) }
return sizes
iconExists := func (icon tomo.Icon) bool {
return icon.Texture(tomo.IconSizeMedium) != nil
}
if sizes := allSizes(tomo.Icon(description.ID)); len(sizes) > 0 {
window.SetIcon(sizes...)
if iconExists(tomo.Icon(description.ID)) {
window.SetIcon(tomo.Icon(description.ID))
return
}
if sizes := allSizes(description.Role.Icon()); len(sizes) > 0 {
window.SetIcon(sizes...)
if iconExists(description.Role.Icon()) {
window.SetIcon(description.Role.Icon())
return
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -219,6 +219,11 @@ var rules = []tomo.Rule {
tomo.AttrMinimumSize { X: 12, Y: 12, },
), tomo.R("", "SliderHandle")),
// *.ScrollContainer
tomo.Ru(tomo.AS (
tomo.AGap(0, 0),
), tomo.R("", "ScrollContainer")),
// *.Checkbox
tomo.Ru(tomo.AS (
tomo.ABorder (