-
-
Notifications
You must be signed in to change notification settings - Fork 10
/
images.go
96 lines (83 loc) · 2.71 KB
/
images.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Copyright (c) 2021-2024 by Richard A. Wilkes. All rights reserved.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, version 2.0. If a copy of the MPL was not distributed with
// this file, You can obtain one at http://mozilla.org/MPL/2.0/.
//
// This Source Code Form is "Incompatible With Secondary Licenses", as
// defined by the Mozilla Public License, version 2.0.
package unison
import (
_ "embed"
"github.com/richardwilkes/toolbox/fatal"
)
var (
moveCursorImage *Image
//go:embed resources/images/move.png
moveCursorImageData []byte
)
// MoveCursorImage returns the standard move cursor image.
func MoveCursorImage() *Image {
if moveCursorImage == nil {
var err error
moveCursorImage, err = NewImageFromBytes(moveCursorImageData, 0.5)
fatal.IfErr(err)
}
return moveCursorImage
}
var (
resizeHorizontalCursorImage *Image
//go:embed resources/images/resize_horizontal.png
resizeHorizontalCursorImageData []byte
)
// ResizeHorizontalCursorImage returns the standard horizontal resize cursor image.
func ResizeHorizontalCursorImage() *Image {
if resizeHorizontalCursorImage == nil {
var err error
resizeHorizontalCursorImage, err = NewImageFromBytes(resizeHorizontalCursorImageData, 0.5)
fatal.IfErr(err)
}
return resizeHorizontalCursorImage
}
var (
resizeLeftDiagonalCursorImage *Image
//go:embed resources/images/resize_left_diagonal.png
resizeLeftDiagonalCursorImageData []byte
)
// ResizeLeftDiagonalCursorImage returns the standard left diagonal resize cursor image.
func ResizeLeftDiagonalCursorImage() *Image {
if resizeLeftDiagonalCursorImage == nil {
var err error
resizeLeftDiagonalCursorImage, err = NewImageFromBytes(resizeLeftDiagonalCursorImageData, 0.5)
fatal.IfErr(err)
}
return resizeLeftDiagonalCursorImage
}
var (
resizeRightDiagonalCursorImage *Image
//go:embed resources/images/resize_right_diagonal.png
resizeRightDiagonalCursorImageData []byte
)
// ResizeRightDiagonalCursorImage returns the standard right diagonal resize cursor image.
func ResizeRightDiagonalCursorImage() *Image {
if resizeRightDiagonalCursorImage == nil {
var err error
resizeRightDiagonalCursorImage, err = NewImageFromBytes(resizeRightDiagonalCursorImageData, 0.5)
fatal.IfErr(err)
}
return resizeRightDiagonalCursorImage
}
var (
resizeVerticalCursorImage *Image
//go:embed resources/images/resize_vertical.png
resizeVerticalCursorImageData []byte
)
// ResizeVerticalCursorImage returns the standard vertical resize cursor image.
func ResizeVerticalCursorImage() *Image {
if resizeVerticalCursorImage == nil {
var err error
resizeVerticalCursorImage, err = NewImageFromBytes(resizeVerticalCursorImageData, 0.5)
fatal.IfErr(err)
}
return resizeVerticalCursorImage
}