Skip to content

Commit 57089b0

Browse files
feat(lyrics-fetch): add settings option for vertical bar lyrics rotation
1 parent d967827 commit 57089b0

3 files changed

Lines changed: 69 additions & 33 deletions

File tree

lyrics-fetch/Settings.qml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,14 @@ ColumnLayout {
1616
property string draftFontFamily: pluginApi?.pluginSettings?.fontFamily ?? "Inter"
1717
property bool draftAdaptScrollSpeed: pluginApi?.pluginSettings?.adaptScrollSpeed ?? true
1818
property bool draftHideWhenPaused: pluginApi?.pluginSettings?.hideWhenPaused ?? true
19+
property string draftVerticalRotationDirection: {
20+
const savedDirection = pluginApi?.pluginSettings?.verticalRotationDirection;
21+
if (savedDirection === "auto" || savedDirection === "cw" || savedDirection === "ccw")
22+
return savedDirection;
23+
return "auto";
24+
}
25+
26+
readonly property bool isBarVertical: Settings.data.bar.position === "left" || Settings.data.bar.position === "right"
1927

2028
spacing: Style.marginM
2129

@@ -26,6 +34,7 @@ ColumnLayout {
2634
pluginApi.pluginSettings.scrollMode = draftMode;
2735
pluginApi.pluginSettings.adaptScrollSpeed = draftAdaptScrollSpeed;
2836
pluginApi.pluginSettings.hideWhenPaused = draftHideWhenPaused;
37+
pluginApi.pluginSettings.verticalRotationDirection = draftVerticalRotationDirection;
2938
pluginApi.pluginSettings.fontSize = draftFontSize;
3039
pluginApi.pluginSettings.hideWhenEmpty = draftHideWhenEmpty;
3140
// Save the selected font
@@ -144,6 +153,29 @@ ColumnLayout {
144153
}
145154
}
146155

156+
NComboBox {
157+
visible: root.isBarVertical
158+
label: pluginApi?.tr("settings.vertical-rotation.title")
159+
description: pluginApi?.tr("settings.vertical-rotation.description")
160+
Layout.fillWidth: true
161+
model: [
162+
{
163+
name: pluginApi?.tr("settings.vertical-rotation.auto"),
164+
key: "auto"
165+
},
166+
{
167+
name: pluginApi?.tr("settings.vertical-rotation.ccw"),
168+
key: "ccw"
169+
},
170+
{
171+
name: pluginApi?.tr("settings.vertical-rotation.cw"),
172+
key: "cw"
173+
}
174+
]
175+
currentKey: draftVerticalRotationDirection
176+
onSelected: key => draftVerticalRotationDirection = key
177+
}
178+
147179
NToggle {
148180
label: pluginApi?.tr("settings.hide-when-paused")
149181
checked: draftHideWhenPaused

lyrics-fetch/i18n/en.json

Lines changed: 35 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,39 @@
11
{
2-
"settings": {
3-
"title": "Settings",
4-
"font": {
5-
"title": "Font Family",
6-
"desc": "Select the font for lyrics.",
7-
"placeholder": "Select a font...",
8-
"search-placeholder": "Search a font...",
9-
"size": "Font Size",
10-
"size-desc": "Text size in points."
11-
},
12-
13-
"width": "Widget Width",
14-
15-
"scroll": {
16-
"speed": "Scroll Speed",
17-
"mode": {
18-
"title": "Scroll Mode",
19-
"always": "Always Scroll",
20-
"hover": "Scroll on Hover",
21-
"never": "Never Scroll"
22-
},
23-
"adapt": "Adapt scroll speed to line",
24-
"adapt-desc": "Change scroll speed based on length of line"
25-
},
26-
27-
"hide-when-empty": "Hide when empty",
28-
"hide-when-paused": "Hide when paused"
2+
"settings": {
3+
"title": "Settings",
4+
"font": {
5+
"title": "Font Family",
6+
"desc": "Select the font for lyrics.",
7+
"placeholder": "Select a font...",
8+
"search-placeholder": "Search a font...",
9+
"size": "Font Size",
10+
"size-desc": "Text size in points."
2911
},
30-
31-
"lyrics": {
32-
"paused": "Music paused",
33-
"loading": "Wait Loading 🪿",
34-
"stopped": "No song playing"
12+
"width": "Widget Width",
13+
"scroll": {
14+
"speed": "Scroll Speed",
15+
"mode": {
16+
"title": "Scroll Mode",
17+
"always": "Always Scroll",
18+
"hover": "Scroll on Hover",
19+
"never": "Never Scroll"
20+
},
21+
"adapt": "Adapt scroll speed to line",
22+
"adapt-desc": "Change scroll speed based on length of line"
23+
},
24+
"hide-when-empty": "Hide when empty",
25+
"hide-when-paused": "Hide when paused",
26+
"vertical-rotation": {
27+
"title": "Vertical lyrics orientation",
28+
"description": "Change direction of the lyrics when using a vertical bar.",
29+
"auto": "Automatic",
30+
"cw": "Clockwise",
31+
"ccw": "Counterclockwise"
3532
}
33+
},
34+
"lyrics": {
35+
"paused": "Music paused",
36+
"loading": "Wait Loading 🪿",
37+
"stopped": "No song playing"
38+
}
3639
}

lyrics-fetch/manifest.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
"fontSize": 10,
2626
"scrollMode": "always",
2727
"hideWhenEmpty": true,
28-
"adaptScrollSpeed": true
28+
"adaptScrollSpeed": true,
29+
"verticalRotationDirection": "auto"
2930
}
3031
},
3132
"repository": "https://github.com/noctalia-dev/noctalia-plugins"

0 commit comments

Comments
 (0)