diff --git a/popups/dialog.go b/popups/dialog.go index e0fe839..4b8af60 100644 --- a/popups/dialog.go +++ b/popups/dialog.go @@ -49,7 +49,7 @@ func NewDialog ( 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) container.Adopt(messageContainer, true) diff --git a/theme/assets/wintergreen-icons-large.png b/theme/assets/wintergreen-icons-large.png new file mode 100644 index 0000000..ad1438f Binary files /dev/null and b/theme/assets/wintergreen-icons-large.png differ diff --git a/theme/assets/wintergreen-icons-small.png b/theme/assets/wintergreen-icons-small.png index 972db16..ae4209a 100644 Binary files a/theme/assets/wintergreen-icons-small.png and b/theme/assets/wintergreen-icons-small.png differ diff --git a/theme/default.go b/theme/default.go index 8c25519..b59624c 100644 --- a/theme/default.go +++ b/theme/default.go @@ -19,6 +19,9 @@ var defaultTextures [14][9]artist.Pattern //go:embed assets/wintergreen-icons-small.png var defaultIconsSmallAtlasBytes []byte 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) { bounds := image.Rect(0, 0, 16, 16).Add(image.Pt(col, row).Mul(16)) @@ -116,14 +119,34 @@ func init () { // set up small icons defaultIconsSmallAtlasImage, _, _ := image.Decode ( bytes.NewReader(defaultIconsSmallAtlasBytes)) - bounds := defaultIconsSmallAtlasImage.Bounds() point := image.Point { } iconIndex := 0 - for point.Y = bounds.Min.Y; point.Y < bounds.Max.Y; point.Y += 16 { - for point.X = bounds.Min.X; point.X < bounds.Max.X; point.X += 16 { + for point.Y = 0; point.Y < 20; point.Y ++ { + for point.X = 0; point.X < 32; point.X ++ { defaultIconsSmall[iconIndex] = binaryIconFrom ( 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 ++ }} } @@ -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. func (Default) Icon (id Icon, size IconSize, c Case) artist.Icon { if size == IconSizeLarge { - // TODO - return nil + if id < 0 || int(id) >= len(defaultIconsLarge) { + return nil + } else { + return defaultIconsLarge[id] + } } else { if id < 0 || int(id) >= len(defaultIconsSmall) { return nil diff --git a/xcf/large.xcf b/xcf/large.xcf index e2d7f3d..ff64f0f 100644 Binary files a/xcf/large.xcf and b/xcf/large.xcf differ