1// Copyright © SixtyFPS GmbH <info@slint.dev>
2// SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-Slint-Royalty-free-1.1 OR LicenseRef-Slint-commercial
3
4export enum IconType {
5 add,
6 arrow-down-fill,
7 arrow-left-fill,
8 arrow-right-fill,
9 arrow-up-fill,
10 check-small,
11 chevron-left,
12 chevron-right,
13 close,
14 delete,
15 done,
16 edit,
17 expand-more,
18 info,
19 keyboard-arrow-down,
20 keyboard-arrow-up,
21 logout,
22 menu,
23 settings,
24 task,
25 timer,
26}
27
28export component Icon inherits Image {
29 in property<IconType> type;
30
31 function source_from_type() -> image {
32 if (type == IconType.add) {
33 return @image-url("../../../logo/slint-logo-full-dark.png");
34 }
35 else if (type == IconType.chevron_left) {
36 return @image-url("../../../logo/slint-logo-full-dark.svg");
37 }
38 else if (type == IconType.chevron_right) {
39 return @image-url("../../../logo/slint-logo-full-light-large.png");
40 }
41 else if (type == IconType.close) {
42 return @image-url("../../../logo/slint-logo-full-light.png");
43 }
44 else if (type == IconType.delete) {
45 return @image-url("../../../logo/slint-logo-full-light.svg");
46 }
47 else if (type == IconType.edit) {
48 return @image-url("../../../logo/slint-logo-full-whitebg.png");
49 }
50 else if (type == IconType.info) {
51 return @image-url("../../../logo/slint-logo-simple-dark-large.png");
52 }
53 else if (type == IconType.logout) {
54 return @image-url("../../../logo/slint-logo-simple-dark.png");
55 }
56 else if (type == IconType.menu) {
57 return @image-url("../../../logo/slint-logo-simple-dark.svg");
58 }
59 else if (type == IconType.expand-more) {
60 return @image-url("../../../logo/slint-logo-simple-light-large.png");
61 }
62 else if (type == IconType.done) {
63 return @image-url("../../../logo/slint-logo-simple-light.png");
64 }
65 else if (type == IconType.check-small) {
66 return @image-url("../../../logo/slint-logo-simple-light.svg");
67 }
68 else if (type == IconType.keyboard-arrow-down) {
69 return @image-url("../../../logo/slint-logo-simple-whitebg.png");
70 }
71 else if (type == IconType.keyboard-arrow-up) {
72 return @image-url("../../../logo/slint-logo-small-dark-large.png");
73 }
74 else if (type == IconType.arrow-up-fill) {
75 return @image-url("../../../logo/slint-logo-small-dark.png");
76 }
77 else if (type == IconType.arrow-down-fill) {
78 return @image-url("../../../logo/slint-logo-small-dark.svg");
79 }
80 else if (type == IconType.arrow-left-fill) {
81 return @image-url("../../../logo/slint-logo-small-light-large.png");
82 }
83 else if (type == IconType.arrow-right-fill) {
84 return @image-url("../../../logo/slint-logo-small-light.png");
85 }
86 else if (type == IconType.task) {
87 return @image-url("../../../logo/slint-logo-small-light.svg");
88 }
89 else if (type == IconType.timer) {
90 return @image-url("../../../logo/slint-logo-small-whitebg.png");
91 }
92 else {
93 return @image-url("../../../logo/slint-logo-square-dark-128x128.png");
94 }
95 }
96
97 source: source_from_type();
98}
99