mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Quicksettings: polishing, fixed all scaling issues.
This commit is contained in:
@@ -31,7 +31,7 @@ NBox {
|
||||
|
||||
NImageCircled {
|
||||
width: Style.baseWidgetSize * 1.25 * scaling
|
||||
height: Style.baseWidgetSize * 1.25 * scaling
|
||||
height: width
|
||||
imagePath: Settings.data.general.avatarImage
|
||||
fallbackIcon: "person"
|
||||
borderColor: Color.mPrimary
|
||||
@@ -105,7 +105,7 @@ NBox {
|
||||
GridLayout {
|
||||
id: grid
|
||||
Layout.fillWidth: true
|
||||
columns: (Settings.data.controlCenter.quickSettingsStyle === "compact") ? 4 : 3
|
||||
columns: (Settings.data.controlCenter.quickSettingsStyle === "compact") ? 5 : 3
|
||||
columnSpacing: Style.marginM * scaling
|
||||
rowSpacing: Style.marginS * scaling
|
||||
|
||||
|
||||
@@ -11,12 +11,12 @@ NPanel {
|
||||
id: root
|
||||
|
||||
preferredWidth: 440
|
||||
preferredHeight: topHeight + bottomHeight + Math.round(Style.marginL * scaling * 3)
|
||||
preferredHeight: topHeight + bottomHeight + Math.round(Style.marginL * 3)
|
||||
panelKeyboardFocus: true
|
||||
|
||||
readonly property int bottomHeight: Math.round(Math.max(196 * scaling))
|
||||
readonly property int bottomHeight: 196
|
||||
readonly property int topHeight: {
|
||||
const columns = (Settings.data.controlCenter.quickSettingsStyle === "compact") ? 4 : 3
|
||||
const columns = (Settings.data.controlCenter.quickSettingsStyle === "compact") ? 5 : 3
|
||||
const rowsCount = Math.ceil(Settings.data.controlCenter.widgets.quickSettings.length / columns)
|
||||
|
||||
var buttonHeight
|
||||
@@ -28,7 +28,7 @@ NPanel {
|
||||
buttonHeight = 56
|
||||
}
|
||||
|
||||
return (rowsCount * buttonHeight) + (120 * scaling)
|
||||
return (rowsCount * buttonHeight) + 120
|
||||
}
|
||||
|
||||
// Positioning
|
||||
@@ -56,26 +56,26 @@ NPanel {
|
||||
TopCard {
|
||||
id: topCard
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: topHeight
|
||||
Layout.preferredHeight: topHeight * scaling
|
||||
}
|
||||
|
||||
// Media + stats column
|
||||
RowLayout {
|
||||
id: bottomCard
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: bottomHeight
|
||||
Layout.preferredHeight: bottomHeight * scaling
|
||||
spacing: content.cardSpacing
|
||||
|
||||
// Media card
|
||||
MediaCard {
|
||||
Layout.preferredWidth: Math.max(250 * scaling)
|
||||
Layout.preferredHeight: bottomHeight
|
||||
Layout.preferredHeight: bottomHeight * scaling
|
||||
}
|
||||
|
||||
// System monitors combined in one card
|
||||
SystemMonitorCard {
|
||||
Layout.preferredWidth: Math.max(140 * scaling)
|
||||
Layout.preferredHeight: bottomHeight
|
||||
Layout.preferredHeight: bottomHeight * scaling
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,9 +12,7 @@ NQuickSetting {
|
||||
fontSize: Style.fontSizeS * scaling
|
||||
fontWeight: Style.fontWeightMedium
|
||||
icon: BluetoothService.enabled ? "bluetooth" : "bluetooth-off"
|
||||
active: BluetoothService.enabled
|
||||
tooltipText: I18n.tr("quickSettings.bluetooth.tooltip.action")
|
||||
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
|
||||
|
||||
onClicked: PanelService.getPanel("bluetoothPanel")?.toggle(this)
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ NQuickSetting {
|
||||
fontSize: Style.fontSizeS * scaling
|
||||
fontWeight: Style.fontWeightMedium
|
||||
icon: IdleInhibitorService.isInhibited ? "keep-awake-on" : "keep-awake-off"
|
||||
active: IdleInhibitorService.isInhibited
|
||||
hot: IdleInhibitorService.isInhibited
|
||||
tooltipText: I18n.tr("quickSettings.keepAwake.tooltip.action")
|
||||
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ NQuickSetting {
|
||||
fontSize: Style.fontSizeS * scaling
|
||||
fontWeight: Style.fontWeightMedium
|
||||
icon: Settings.data.nightLight.enabled ? (Settings.data.nightLight.forced ? "nightlight-forced" : "nightlight-on") : "nightlight-off"
|
||||
active: Settings.data.nightLight.enabled
|
||||
hot: !Settings.data.nightLight.enabled || Settings.data.nightLight.forced
|
||||
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
|
||||
tooltipText: I18n.tr("quickSettings.nightLight.tooltip.action")
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ NQuickSetting {
|
||||
fontSize: Style.fontSizeS * scaling
|
||||
fontWeight: Style.fontWeightMedium
|
||||
icon: Settings.data.notifications.doNotDisturb ? "bell-off" : "bell"
|
||||
active: Settings.data.notifications.doNotDisturb
|
||||
hot: Settings.data.notifications.doNotDisturb
|
||||
tooltipText: I18n.tr("quickSettings.notifications.tooltip.action")
|
||||
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ NQuickSetting {
|
||||
fontSize: Style.fontSizeS * scaling
|
||||
fontWeight: Style.fontWeightMedium
|
||||
icon: PowerProfileService.getIcon()
|
||||
active: hasPP
|
||||
hot: !PowerProfileService.isDefault()
|
||||
tooltipText: I18n.tr("quickSettings.powerProfile.tooltip.action")
|
||||
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ NQuickSetting {
|
||||
text: ScreenRecorderService.isRecording ? I18n.tr("quickSettings.screenRecorder.label.recording") : I18n.tr("quickSettings.screenRecorder.label.stopped")
|
||||
fontSize: Style.fontSizeS * scaling
|
||||
fontWeight: Style.fontWeightMedium
|
||||
active: ScreenRecorderService.isRecording
|
||||
hot: ScreenRecorderService.isRecording
|
||||
tooltipText: I18n.tr("quickSettings.screenRecorder.tooltip.action")
|
||||
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
|
||||
|
||||
|
||||
@@ -13,7 +13,6 @@ NQuickSetting {
|
||||
text: I18n.tr("quickSettings.wallpaperSelector.label")
|
||||
fontSize: Style.fontSizeS * scaling
|
||||
fontWeight: Style.fontWeightMedium
|
||||
active: Settings.data.wallpaper.enabled
|
||||
tooltipText: I18n.tr("quickSettings.wallpaperSelector.tooltip.action")
|
||||
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
|
||||
|
||||
|
||||
@@ -46,24 +46,6 @@ NQuickSetting {
|
||||
fontSize: Style.fontSizeS * scaling
|
||||
fontWeight: Style.fontWeightMedium
|
||||
style: Settings.data.controlCenter.quickSettingsStyle || "modern"
|
||||
|
||||
active: {
|
||||
if (NetworkService.ethernetConnected) {
|
||||
return true
|
||||
}
|
||||
try {
|
||||
for (const net in NetworkService.networks) {
|
||||
if (NetworkService.networks[net].connected) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
} catch (error) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
tooltipText: I18n.tr("quickSettings.wifi.tooltip.action")
|
||||
|
||||
onClicked: PanelService.getPanel("wifiPanel")?.toggle(this)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user