Skip to content

Commit 2d904eb

Browse files
committed
Theme: Assets and Fonts component added
1 parent 4d4be08 commit 2d904eb

File tree

4 files changed

+132
-4
lines changed

4 files changed

+132
-4
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
pragma Singleton
2+
3+
import QtQml
4+
5+
QtObject {
6+
readonly property string assetPath: Qt.resolvedUrl("../../../assets/")
7+
8+
function png(name) {
9+
return assetPath + "png/" + name + ".png"
10+
}
11+
function svg(name) {
12+
return assetPath + "img/icons/" + name + ".svg"
13+
}
14+
function emoji(name) {
15+
return assetPath + "twemoji/svg/" + name + ".svg"
16+
}
17+
}
Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
1+
pragma Singleton
2+
3+
import QtQuick
4+
5+
import StatusQ.Core.Utils as SQUtils
6+
7+
SQUtils.QObject {
8+
readonly property alias baseFont: baseFont.font
9+
readonly property alias monoFont: monoFont.font
10+
readonly property alias codeFont: codeFont.font
11+
12+
FontLoader {
13+
id: baseFont
14+
15+
source: Assets.assetPath + "fonts/Inter/Inter-Regular.otf"
16+
}
17+
18+
FontLoader {
19+
id: monoFont
20+
21+
source: Assets.assetPath + "fonts/InterStatus/InterStatus-Regular.otf"
22+
}
23+
24+
FontLoader {
25+
id: codeFont
26+
27+
source: Assets.assetPath + "fonts/RobotoMono/RobotoMono-Regular.ttf"
28+
}
29+
30+
// Inter font variants
31+
FontLoader {
32+
source: Assets.assetPath + "fonts/Inter/Inter-Thin.otf"
33+
}
34+
35+
FontLoader {
36+
source: Assets.assetPath + "fonts/Inter/Inter-ExtraLight.otf"
37+
}
38+
39+
FontLoader {
40+
source: Assets.assetPath + "fonts/Inter/Inter-Light.otf"
41+
}
42+
43+
FontLoader {
44+
source: Assets.assetPath + "fonts/Inter/Inter-Medium.otf"
45+
}
46+
47+
FontLoader {
48+
source: Assets.assetPath + "fonts/Inter/Inter-Bold.otf"
49+
}
50+
51+
FontLoader {
52+
source: Assets.assetPath + "fonts/Inter/Inter-ExtraBold.otf"
53+
}
54+
55+
FontLoader {
56+
source: Assets.assetPath + "fonts/Inter/Inter-Black.otf"
57+
}
58+
59+
// Inter Status font variants
60+
FontLoader {
61+
source: Assets.assetPath + "fonts/InterStatus/InterStatus-Thin.otf"
62+
}
63+
64+
FontLoader {
65+
source: Assets.assetPath + "fonts/InterStatus/InterStatus-ExtraLight.otf"
66+
}
67+
68+
FontLoader {
69+
source: Assets.assetPath + "fonts/InterStatus/InterStatus-Light.otf"
70+
}
71+
72+
FontLoader {
73+
source: Assets.assetPath + "fonts/InterStatus/InterStatus-Medium.otf"
74+
}
75+
76+
FontLoader {
77+
source: Assets.assetPath + "fonts/InterStatus/InterStatus-Bold.otf"
78+
}
79+
80+
FontLoader {
81+
source: Assets.assetPath + "fonts/InterStatus/InterStatus-ExtraBold.otf"
82+
}
83+
84+
FontLoader {
85+
source: Assets.assetPath + "fonts/InterStatus/InterStatus-Black.otf"
86+
}
87+
88+
// Roboto font variants
89+
FontLoader {
90+
source: Assets.assetPath + "fonts/RobotoMono/RobotoMono-Thin.ttf"
91+
}
92+
93+
FontLoader {
94+
source: Assets.assetPath + "fonts/RobotoMono/RobotoMono-ExtraLight.ttf"
95+
}
96+
97+
FontLoader {
98+
source: Assets.assetPath + "fonts/RobotoMono/RobotoMono-Light.ttf"
99+
}
100+
101+
FontLoader {
102+
source: Assets.assetPath + "fonts/RobotoMono/RobotoMono-Medium.ttf"
103+
}
104+
105+
FontLoader {
106+
source: Assets.assetPath + "fonts/RobotoMono/RobotoMono-Bold.ttf"
107+
}
108+
}

ui/StatusQ/src/StatusQ/Core/Theme/qmldir

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
module StatusQ.Core.Theme
22

3-
singleton StatusColors 0.1 StatusColors.qml
4-
ThemePalette 0.1 ThemePalette.qml
5-
StatusLightTheme 0.1 StatusLightTheme.qml
63
StatusDarkTheme 0.1 StatusDarkTheme.qml
4+
StatusLightTheme 0.1 StatusLightTheme.qml
5+
ThemePalette 0.1 ThemePalette.qml
6+
singleton Assets 0.1 Assets.qml
7+
singleton Fonts 0.1 Fonts.qml
8+
singleton StatusColors 0.1 StatusColors.qml
79
singleton Theme 0.1 Theme.qml
8-

ui/StatusQ/src/statusq.qrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@
186186
<file>StatusQ/Core/StatusScrollView.qml</file>
187187
<file>StatusQ/Core/StatusSharedUpdateTimer.qml</file>
188188
<file>StatusQ/Core/StatusTooltipSettings.qml</file>
189+
<file>StatusQ/Core/Theme/Assets.qml</file>
190+
<file>StatusQ/Core/Theme/Fonts.qml</file>
189191
<file>StatusQ/Core/Theme/StatusColors.qml</file>
190192
<file>StatusQ/Core/Theme/StatusDarkTheme.qml</file>
191193
<file>StatusQ/Core/Theme/StatusLightTheme.qml</file>

0 commit comments

Comments
 (0)