Large icons in the default set!
This commit is contained in:
parent
5d4a26a877
commit
9cc9e78504
@ -49,7 +49,7 @@ func NewDialog (
|
|||||||
case DialogKindError: iconId = theme.IconError
|
case DialogKindError: iconId = theme.IconError
|
||||||
}
|
}
|
||||||
|
|
||||||
messageContainer.Adopt(basicElements.NewIcon(iconId, theme.IconSizeSmall), false)
|
messageContainer.Adopt(basicElements.NewIcon(iconId, theme.IconSizeLarge), false)
|
||||||
messageContainer.Adopt(basicElements.NewLabel(message, false), true)
|
messageContainer.Adopt(basicElements.NewLabel(message, false), true)
|
||||||
container.Adopt(messageContainer, true)
|
container.Adopt(messageContainer, true)
|
||||||
|
|
||||||
|
BIN
theme/assets/wintergreen-icons-large.png
Normal file
BIN
theme/assets/wintergreen-icons-large.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.8 KiB |
Binary file not shown.
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
@ -19,6 +19,9 @@ var defaultTextures [14][9]artist.Pattern
|
|||||||
//go:embed assets/wintergreen-icons-small.png
|
//go:embed assets/wintergreen-icons-small.png
|
||||||
var defaultIconsSmallAtlasBytes []byte
|
var defaultIconsSmallAtlasBytes []byte
|
||||||
var defaultIconsSmall [640]binaryIcon
|
var defaultIconsSmall [640]binaryIcon
|
||||||
|
//go:embed assets/wintergreen-icons-large.png
|
||||||
|
var defaultIconsLargeAtlasBytes []byte
|
||||||
|
var defaultIconsLarge [640]binaryIcon
|
||||||
|
|
||||||
func atlasCell (col, row int, border artist.Inset) {
|
func atlasCell (col, row int, border artist.Inset) {
|
||||||
bounds := image.Rect(0, 0, 16, 16).Add(image.Pt(col, row).Mul(16))
|
bounds := image.Rect(0, 0, 16, 16).Add(image.Pt(col, row).Mul(16))
|
||||||
@ -116,14 +119,34 @@ func init () {
|
|||||||
// set up small icons
|
// set up small icons
|
||||||
defaultIconsSmallAtlasImage, _, _ := image.Decode (
|
defaultIconsSmallAtlasImage, _, _ := image.Decode (
|
||||||
bytes.NewReader(defaultIconsSmallAtlasBytes))
|
bytes.NewReader(defaultIconsSmallAtlasBytes))
|
||||||
bounds := defaultIconsSmallAtlasImage.Bounds()
|
|
||||||
point := image.Point { }
|
point := image.Point { }
|
||||||
iconIndex := 0
|
iconIndex := 0
|
||||||
for point.Y = bounds.Min.Y; point.Y < bounds.Max.Y; point.Y += 16 {
|
for point.Y = 0; point.Y < 20; point.Y ++ {
|
||||||
for point.X = bounds.Min.X; point.X < bounds.Max.X; point.X += 16 {
|
for point.X = 0; point.X < 32; point.X ++ {
|
||||||
defaultIconsSmall[iconIndex] = binaryIconFrom (
|
defaultIconsSmall[iconIndex] = binaryIconFrom (
|
||||||
defaultIconsSmallAtlasImage,
|
defaultIconsSmallAtlasImage,
|
||||||
image.Rect(0, 0, 16, 16).Add(point))
|
image.Rect(0, 0, 16, 16).Add(point.Mul(16)))
|
||||||
|
iconIndex ++
|
||||||
|
}}
|
||||||
|
|
||||||
|
// set up large icons
|
||||||
|
defaultIconsLargeAtlasImage, _, _ := image.Decode (
|
||||||
|
bytes.NewReader(defaultIconsLargeAtlasBytes))
|
||||||
|
point = image.Point { }
|
||||||
|
iconIndex = 0
|
||||||
|
for point.Y = 0; point.Y < 8; point.Y ++ {
|
||||||
|
for point.X = 0; point.X < 32; point.X ++ {
|
||||||
|
defaultIconsLarge[iconIndex] = binaryIconFrom (
|
||||||
|
defaultIconsLargeAtlasImage,
|
||||||
|
image.Rect(0, 0, 32, 32).Add(point.Mul(32)))
|
||||||
|
iconIndex ++
|
||||||
|
}}
|
||||||
|
iconIndex = 384
|
||||||
|
for point.Y = 8; point.Y < 12; point.Y ++ {
|
||||||
|
for point.X = 0; point.X < 32; point.X ++ {
|
||||||
|
defaultIconsLarge[iconIndex] = binaryIconFrom (
|
||||||
|
defaultIconsLargeAtlasImage,
|
||||||
|
image.Rect(0, 0, 32, 32).Add(point.Mul(32)))
|
||||||
iconIndex ++
|
iconIndex ++
|
||||||
}}
|
}}
|
||||||
}
|
}
|
||||||
@ -148,8 +171,11 @@ func (Default) FontFace (style FontStyle, size FontSize, c Case) font.Face {
|
|||||||
// Icon returns an icon from the default set corresponding to the given name.
|
// Icon returns an icon from the default set corresponding to the given name.
|
||||||
func (Default) Icon (id Icon, size IconSize, c Case) artist.Icon {
|
func (Default) Icon (id Icon, size IconSize, c Case) artist.Icon {
|
||||||
if size == IconSizeLarge {
|
if size == IconSizeLarge {
|
||||||
// TODO
|
if id < 0 || int(id) >= len(defaultIconsLarge) {
|
||||||
return nil
|
return nil
|
||||||
|
} else {
|
||||||
|
return defaultIconsLarge[id]
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if id < 0 || int(id) >= len(defaultIconsSmall) {
|
if id < 0 || int(id) >= len(defaultIconsSmall) {
|
||||||
return nil
|
return nil
|
||||||
|
BIN
xcf/large.xcf
BIN
xcf/large.xcf
Binary file not shown.
Reference in New Issue
Block a user