Skip to content

Commit 59bf71e

Browse files
authored
Merge pull request #645 from blackteaextract/jsttxt
2 parents c7f0e00 + c098e44 commit 59bf71e

2 files changed

Lines changed: 38 additions & 2 deletions

File tree

not-just-text/Settings.qml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ ColumnLayout {
1515
property bool editFortuneOffensive: cfg.fortuneOffensive ?? defaults.fortuneOffensive ?? false
1616
property bool editFortuneEqual: cfg.fortuneEqual ?? defaults.fortuneEqual ?? false
1717
property string editFortuneCategory: cfg.fortuneCategory ?? defaults.fortuneCategory ?? ""
18+
property int editFortuneMaxLength: cfg.fortuneMaxLength ?? defaults.fortuneMaxLength ?? 60
1819
property bool editListEnabled: cfg.listEnabled ?? defaults.listEnabled ?? false
1920
property string editTextFile: cfg.textFile ?? defaults.textFile ?? ""
21+
property bool editRefreshOnWallpaper: cfg.refreshOnWallpaper ?? defaults.refreshOnWallpaper ?? true
2022

2123
spacing: Style.marginL
2224

@@ -70,6 +72,26 @@ ColumnLayout {
7072
onTextChanged: root.editFortuneCategory = text
7173
}
7274

75+
ColumnLayout {
76+
Layout.fillWidth: true
77+
visible: root.editFortuneEnabled
78+
spacing: Style.marginS
79+
80+
NLabel {
81+
label: pluginApi?.tr("settings.fortuneMaxLength.label", {"value": root.editFortuneMaxLength})
82+
description: pluginApi?.tr("settings.fortuneMaxLength.desc")
83+
}
84+
85+
NSlider {
86+
Layout.fillWidth: true
87+
from: 10
88+
to: 200
89+
value: root.editFortuneMaxLength
90+
stepSize: 5
91+
onMoved: root.editFortuneMaxLength = Math.round(value)
92+
}
93+
}
94+
7395
NToggle {
7496
Layout.fillWidth: true
7597
visible: root.editFortuneEnabled
@@ -88,15 +110,26 @@ ColumnLayout {
88110
onToggled: checked => root.editFortuneEqual = checked
89111
}
90112

113+
NToggle {
114+
Layout.fillWidth: true
115+
visible: root.editFortuneEnabled || root.editListEnabled
116+
label: pluginApi?.tr("settings.refreshOnWallpaper.label")
117+
description: pluginApi?.tr("settings.refreshOnWallpaper.desc")
118+
checked: root.editRefreshOnWallpaper
119+
onToggled: checked => root.editRefreshOnWallpaper = checked
120+
}
121+
91122
function saveSettings() {
92123
if (!pluginApi) return;
93124
pluginApi.pluginSettings.text = root.editText;
94125
pluginApi.pluginSettings.fortuneEnabled = root.editFortuneEnabled;
95126
pluginApi.pluginSettings.fortuneOffensive = root.editFortuneOffensive;
96127
pluginApi.pluginSettings.fortuneEqual = root.editFortuneEqual;
97128
pluginApi.pluginSettings.fortuneCategory = root.editFortuneCategory;
129+
pluginApi.pluginSettings.fortuneMaxLength = root.editFortuneMaxLength;
98130
pluginApi.pluginSettings.listEnabled = root.editListEnabled;
99131
pluginApi.pluginSettings.textFile = root.editTextFile;
132+
pluginApi.pluginSettings.refreshOnWallpaper = root.editRefreshOnWallpaper;
100133
pluginApi.saveSettings();
101134
}
102135
}

not-just-text/manifest.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
{
22
"id": "not-just-text",
33
"name": "Not Just Text",
4-
"version": "1.0.0",
4+
"version": "1.0.1",
55
"minNoctaliaVersion": "4.4.1",
66
"author": "blackteaextract",
77
"license": "MIT",
88
"repository": "https://github.com/noctalia-dev/noctalia-plugins",
99
"description": "Displays custom text, fortune quotes, or a random entry from a user-provided text file in the bar.",
10-
"tags": ["Bar"],
10+
"tags": [
11+
"Bar",
12+
"Fun"
13+
],
1114
"entryPoints": {
1215
"main": "Main.qml",
1316
"barWidget": "BarWidget.qml",

0 commit comments

Comments
 (0)