Compare commits
No commits in common. "753e3e40230401a6c12a9ab40743172ebd8e2999" and "6451050fd3abd49a7e61a6d3996bbe7f76db5396" have entirely different histories.
753e3e4023
...
6451050fd3
@ -8,6 +8,7 @@ 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.
|
||||
@ -201,16 +202,22 @@ func applicationOpenUrls (application Application, args ...string) {
|
||||
}
|
||||
|
||||
func setApplicationWindowIcon (window tomo.Window, description ApplicationDescription) {
|
||||
iconExists := func (icon tomo.Icon) bool {
|
||||
return icon.Texture(tomo.IconSizeMedium) != nil
|
||||
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
|
||||
}
|
||||
|
||||
if iconExists(tomo.Icon(description.ID)) {
|
||||
window.SetIcon(tomo.Icon(description.ID))
|
||||
if sizes := allSizes(tomo.Icon(description.ID)); len(sizes) > 0 {
|
||||
window.SetIcon(sizes...)
|
||||
return
|
||||
}
|
||||
if iconExists(description.Role.Icon()) {
|
||||
window.SetIcon(description.Role.Icon())
|
||||
if sizes := allSizes(description.Role.Icon()); len(sizes) > 0 {
|
||||
window.SetIcon(sizes...)
|
||||
return
|
||||
}
|
||||
}
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 32 KiB |
@ -219,11 +219,6 @@ 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 (
|
||||
|
Loading…
Reference in New Issue
Block a user