Skip to content

Commit ed1fff6

Browse files
authored
Merge pull request #2427 from notiant/patch-10
Fix problem with Airplane Mode toggle visibility & add some default values for the Color Scheme settings
2 parents 478e941 + 4cf7938 commit ed1fff6

8 files changed

Lines changed: 14 additions & 31 deletions

File tree

Modules/Panels/Settings/Tabs/ColorScheme/ColorsSubTab.qml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ ColumnLayout {
122122
label: I18n.tr("panels.color-scheme.sync-gsettings-label")
123123
description: I18n.tr("panels.color-scheme.sync-gsettings-description")
124124
checked: Settings.data.colorSchemes.syncGsettings
125+
defaultValue: Settings.getDefaultValue("colorSchemes.syncGsettings")
125126
onToggled: checked => {
126127
Settings.data.colorSchemes.syncGsettings = checked;
127128
if (checked)
@@ -149,6 +150,7 @@ ColumnLayout {
149150
]
150151

151152
currentKey: Settings.data.colorSchemes.schedulingMode
153+
defaultValue: Settings.getDefaultValue("colorSchemes.schedulingMode")
152154

153155
onSelected: key => {
154156
Settings.data.colorSchemes.schedulingMode = key;
@@ -211,6 +213,7 @@ ColumnLayout {
211213
label: I18n.tr("panels.color-scheme.color-source-use-wallpaper-colors-label")
212214
description: I18n.tr("panels.color-scheme.color-source-use-wallpaper-colors-description")
213215
checked: Settings.data.colorSchemes.useWallpaperColors
216+
defaultValue: Settings.getDefaultValue("colorSchemes.useWallpaperColors")
214217
onToggled: checked => {
215218
Settings.data.colorSchemes.useWallpaperColors = checked;
216219
if (checked) {
@@ -249,7 +252,6 @@ ColumnLayout {
249252
Settings.data.colorSchemes.monitorForColors = key;
250253
AppThemeService.generate();
251254
}
252-
defaultValue: ""
253255
}
254256

255257
NComboBox {

Modules/Panels/Settings/Tabs/Connections/BluetoothSubTab.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Item {
161161
label: I18n.tr("common.bluetooth")
162162
icon: BluetoothService.enabled ? "bluetooth" : "bluetooth-off"
163163
checked: BluetoothService.enabled
164-
enabled: !NetworkService.airplaneModeEnabled && BluetoothService.bluetoothAvailable
164+
enabled: !NetworkService.airplaneModeEnabled && BluetoothService.bluetoothAvailable && !BluetoothService.blocked
165165
onToggled: checked => BluetoothService.setBluetoothEnabled(checked)
166166
Layout.alignment: Qt.AlignVCenter
167167
}

Modules/Panels/Settings/Tabs/Connections/WifiSubTab.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ Item {
148148
label: I18n.tr("common.wifi")
149149
icon: NetworkService.wifiEnabled ? "wifi" : "wifi-off"
150150
checked: NetworkService.wifiEnabled
151-
onToggled: checked => NetworkService.setWifiEnabled(checked)
152151
enabled: !NetworkService.airplaneModeEnabled && NetworkService.wifiAvailable
152+
onToggled: checked => NetworkService.setWifiEnabled(checked)
153153
Layout.alignment: Qt.AlignVCenter
154154
}
155155
}
@@ -324,7 +324,7 @@ Item {
324324
// Airplane Mode
325325
NBox {
326326
id: miscSettingsBox
327-
visible: !root.showOnlyLists && miscSettingsCol.visibleChildren.length > 0
327+
visible: !root.showOnlyLists && NetworkService.wifiAvailable && BluetoothService.bluetoothAvailable
328328
Layout.fillWidth: true
329329
Layout.preferredHeight: miscSettingsCol.implicitHeight + Style.margin2XL
330330
color: Color.mSurface

Modules/Panels/Settings/Tabs/Launcher/ExecuteSubTab.qml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ ColumnLayout {
1616
Layout.fillWidth: true
1717
text: Settings.data.appLauncher.terminalCommand
1818
onTextChanged: Settings.data.appLauncher.terminalCommand = text
19-
}
2019
}
2120

2221
NToggle {

Modules/Panels/Wallpaper/WallpaperPanel.qml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ SmartPanel {
298298

299299
NIconButton {
300300
visible: Settings.data.wallpaper.enabled
301-
icon: "sun"
302-
tooltipText: Settings.data.wallpaper.linkLightAndDarkWallpapers ? I18n.tr("wallpaper.panel.header-sun-linked-tooltip") : I18n.tr("wallpaper.panel.header-sun-separate-tooltip")
301+
icon: "dark-mode"
302+
tooltipText: Settings.data.wallpaper.linkLightAndDarkWallpapers ? I18n.tr("wallpaper.panel.header-separate-light-dark-tooltip") : I18n.tr("wallpaper.panel.header-link-light-dark-tooltip")
303303
baseSize: Style.baseWidgetSize * 0.8
304304
colorBg: !Settings.data.wallpaper.linkLightAndDarkWallpapers ? Color.mPrimary : Color.smartAlpha(Color.mSurfaceVariant)
305305
colorFg: !Settings.data.wallpaper.linkLightAndDarkWallpapers ? Color.mOnPrimary : Color.mPrimary

Services/Networking/BluetoothService.qml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,10 @@ Singleton {
7171
}
7272
}
7373

74-
// Handle system wakeup to force-poll and ensure state is up-to-date
74+
// Handle potential case where Quickshell doesnt't properly update adapter after system wakeup
7575
Connections {
7676
target: Time
7777
function onResumed() {
78-
Logger.i("Bluetooth", "System resumed - forcing state poll");
7978
ctlPollTimer.restart();
8079
}
8180
}
@@ -90,7 +89,7 @@ Singleton {
9089
checkAirplaneMode();
9190
}
9291
function onEnabledChanged() {
93-
if (adapter && adapter.enabled && Settings.data.network.bluetoothAutoConnect) {
92+
if (adapter?.enabled && Settings.data.network.bluetoothAutoConnect) {
9493
autoConnectTimer.restart();
9594
}
9695
}
@@ -99,7 +98,7 @@ Singleton {
9998
Connections {
10099
target: Settings.data.network
101100
function onBluetoothAutoConnectChanged() {
102-
if (Settings.data.network.bluetoothAutoConnect && adapter && adapter.enabled) {
101+
if (Settings.data.network.bluetoothAutoConnect && adapter?.enabled) {
103102
autoConnectTimer.restart();
104103
} else {
105104
autoConnectTimer.stop();
@@ -137,7 +136,7 @@ Singleton {
137136

138137
Timer {
139138
id: ctlPollTimer
140-
interval: 250
139+
interval: 2000
141140
running: false
142141
onTriggered: {
143142
if (!adapter || !ProgramCheckerService.bluetoothctlAvailable) {

Services/Networking/NetworkService.qml

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ Singleton {
114114

115115
Component.onCompleted: {
116116
Logger.i("Network", "Service started");
117-
wifiInitTimer.running = true;
117+
wifiInitTimer.restart();
118118

119119
// Ensure initial detection if nmcli is already available at startup
120120
if (ProgramCheckerService.nmcliAvailable) {
@@ -155,23 +155,6 @@ Singleton {
155155
}
156156
return;
157157
}
158-
var isAirplaneModeActive = !root.wifiEnabled && BluetoothService.blocked;
159-
// Extra check for Airplane Mode if Bluetooth has been blocked before Wi-Fi
160-
if (isAirplaneModeActive && !root.airplaneModeEnabled) {
161-
root.airplaneModeEnabled = true;
162-
ToastService.showNotice(I18n.tr("toast.airplane-mode.title"), I18n.tr("common.enabled"), "plane");
163-
Logger.i("AirplaneMode", "Enabled");
164-
root.networks = ({});
165-
return;
166-
}
167-
// Extra check for Airplane Mode if Wi-Fi has been unblocked before Bluetooth
168-
if (!isAirplaneModeActive && root.airplaneModeEnabled) {
169-
root.airplaneModeEnabled = false;
170-
ToastService.showNotice(I18n.tr("toast.airplane-mode.title"), I18n.tr("common.disabled"), "plane-off");
171-
Logger.i("AirplaneMode", "Disabled");
172-
scan();
173-
return;
174-
}
175158
if (root.wifiEnabled) {
176159
ToastService.showNotice(I18n.tr("common.wifi"), I18n.tr("common.enabled"), "wifi");
177160
scan();

shell.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ ShellRoot {
124124
}
125125
});
126126

127-
delayedInitTimer.running = true;
127+
delayedInitTimer.restart();
128128
}
129129

130130
Overview {}

0 commit comments

Comments
 (0)