We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6e239f5 commit f7e79f7Copy full SHA for f7e79f7
1 file changed
widget/icon.go
@@ -0,0 +1,25 @@
1
+package widget
2
+
3
+import (
4
+ "fyne.io/fyne/v2"
5
+ "fyne.io/fyne/v2/widget"
6
+)
7
8
+// Icon widget is a basic image component that load's its resource to match the theme.
9
+type Icon struct {
10
+ widget.Icon
11
+ ToolTipWidgetExtend
12
+}
13
14
+// NewIcon returns a new icon widget that displays a themed icon resource.
15
+func NewIcon(res fyne.Resource) *Icon {
16
+ w := &Icon{}
17
+ w.ExtendBaseWidget(w)
18
+ w.SetResource(res)
19
+ return w
20
21
22
+func (w *Icon) ExtendBaseWidget(wid fyne.Widget) {
23
+ w.ExtendToolTipWidget(wid)
24
+ w.Icon.ExtendBaseWidget(wid)
25
0 commit comments