Compare commits
3 Commits
6451050fd3
...
753e3e4023
Author | SHA1 | Date | |
---|---|---|---|
753e3e4023 | |||
5c46950224 | |||
f22c268a10 |
@ -8,7 +8,6 @@ import "strings"
|
|||||||
import "net/url"
|
import "net/url"
|
||||||
import "git.tebibyte.media/tomo/tomo"
|
import "git.tebibyte.media/tomo/tomo"
|
||||||
import "git.tebibyte.media/tomo/objects"
|
import "git.tebibyte.media/tomo/objects"
|
||||||
import "git.tebibyte.media/tomo/tomo/canvas"
|
|
||||||
import "git.tebibyte.media/tomo/nasin/internal/registrar"
|
import "git.tebibyte.media/tomo/nasin/internal/registrar"
|
||||||
|
|
||||||
// Application represents an application object.
|
// Application represents an application object.
|
||||||
@ -202,22 +201,16 @@ func applicationOpenUrls (application Application, args ...string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setApplicationWindowIcon (window tomo.Window, description ApplicationDescription) {
|
func setApplicationWindowIcon (window tomo.Window, description ApplicationDescription) {
|
||||||
allSizes := func (icon tomo.Icon) (sizes []canvas.Texture) {
|
iconExists := func (icon tomo.Icon) bool {
|
||||||
small := icon.Texture(tomo.IconSizeSmall)
|
return icon.Texture(tomo.IconSizeMedium) != nil
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if sizes := allSizes(tomo.Icon(description.ID)); len(sizes) > 0 {
|
if iconExists(tomo.Icon(description.ID)) {
|
||||||
window.SetIcon(sizes...)
|
window.SetIcon(tomo.Icon(description.ID))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if sizes := allSizes(description.Role.Icon()); len(sizes) > 0 {
|
if iconExists(description.Role.Icon()) {
|
||||||
window.SetIcon(sizes...)
|
window.SetIcon(description.Role.Icon())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 26 KiB |
@ -219,6 +219,11 @@ var rules = []tomo.Rule {
|
|||||||
tomo.AttrMinimumSize { X: 12, Y: 12, },
|
tomo.AttrMinimumSize { X: 12, Y: 12, },
|
||||||
), tomo.R("", "SliderHandle")),
|
), tomo.R("", "SliderHandle")),
|
||||||
|
|
||||||
|
// *.ScrollContainer
|
||||||
|
tomo.Ru(tomo.AS (
|
||||||
|
tomo.AGap(0, 0),
|
||||||
|
), tomo.R("", "ScrollContainer")),
|
||||||
|
|
||||||
// *.Checkbox
|
// *.Checkbox
|
||||||
tomo.Ru(tomo.AS (
|
tomo.Ru(tomo.AS (
|
||||||
tomo.ABorder (
|
tomo.ABorder (
|
||||||
|
Loading…
Reference in New Issue
Block a user