mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-01 10:05:30 +00:00
New scaling wip
This commit is contained in:
@@ -17,20 +17,21 @@ NBox {
|
||||
property string uptimeText: "--"
|
||||
|
||||
RowLayout {
|
||||
id: content
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.margins: Style.marginM
|
||||
spacing: Style.marginM
|
||||
|
||||
NImageCircled {
|
||||
width: Style.baseWidgetSize * 1.25
|
||||
height: Style.baseWidgetSize * 1.25
|
||||
width: Math.round(Style.baseWidgetSize * 1.25 * Style.uiScaleRatio)
|
||||
height: width
|
||||
imagePath: Settings.data.general.avatarImage
|
||||
fallbackIcon: "person"
|
||||
borderColor: Color.mPrimary
|
||||
borderWidth: Math.max(1, Style.borderM)
|
||||
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
@@ -84,6 +85,7 @@ NBox {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------
|
||||
// Uptime
|
||||
Timer {
|
||||
|
||||
@@ -14,6 +14,8 @@ NBox {
|
||||
anchors.fill: parent
|
||||
anchors.margins: Style.marginS
|
||||
|
||||
property int widgetHeight: Math.round(65 * Style.uiScaleRatio)
|
||||
|
||||
ColumnLayout {
|
||||
anchors.centerIn: parent
|
||||
spacing: 0
|
||||
@@ -23,7 +25,7 @@ NBox {
|
||||
icon: "cpu-usage"
|
||||
flat: true
|
||||
contentScale: 0.8
|
||||
height: 65
|
||||
height: content.widgetHeight
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
NCircleStat {
|
||||
@@ -32,7 +34,7 @@ NBox {
|
||||
icon: "cpu-temperature"
|
||||
flat: true
|
||||
contentScale: 0.8
|
||||
height: 65
|
||||
height: content.widgetHeight
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
NCircleStat {
|
||||
@@ -40,7 +42,7 @@ NBox {
|
||||
icon: "memory"
|
||||
flat: true
|
||||
contentScale: 0.8
|
||||
height: 65
|
||||
height: content.widgetHeight
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
NCircleStat {
|
||||
@@ -48,7 +50,7 @@ NBox {
|
||||
icon: "storage"
|
||||
flat: true
|
||||
contentScale: 0.8
|
||||
height: 65
|
||||
height: content.widgetHeight
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,8 +10,8 @@ import qs.Widgets
|
||||
NPanel {
|
||||
id: root
|
||||
|
||||
preferredWidth: 460
|
||||
preferredHeight: 790
|
||||
preferredWidth: Math.round(460 * Style.uiScaleRatio)
|
||||
preferredHeight: (profileHeight + weatherHeight + mediaSysMonHeight + audioHeight + bottomHeight) + 6 * Style.marginL
|
||||
panelKeyboardFocus: true
|
||||
|
||||
// Positioning
|
||||
@@ -23,35 +23,39 @@ NPanel {
|
||||
panelAnchorBottom: controlCenterPosition !== "close_to_bar_button" && controlCenterPosition.startsWith("bottom_")
|
||||
panelAnchorTop: controlCenterPosition !== "close_to_bar_button" && controlCenterPosition.startsWith("top_")
|
||||
|
||||
readonly property int profileHeight: Math.round(64 * Style.uiScaleRatio)
|
||||
readonly property int weatherHeight: Math.round(190 * Style.uiScaleRatio)
|
||||
readonly property int mediaSysMonHeight: Math.round(260 * Style.uiScaleRatio)
|
||||
readonly property int audioHeight: Math.round(120 * Style.uiScaleRatio)
|
||||
readonly property int bottomHeight: Math.round(60 * Style.uiScaleRatio)
|
||||
|
||||
panelContent: Item {
|
||||
id: content
|
||||
|
||||
property real cardSpacing: Style.marginL
|
||||
|
||||
// Layout content
|
||||
ColumnLayout {
|
||||
id: layout
|
||||
x: content.cardSpacing
|
||||
y: content.cardSpacing
|
||||
width: parent.width - (2 * content.cardSpacing)
|
||||
spacing: content.cardSpacing
|
||||
x: Style.marginL
|
||||
y: Style.marginL
|
||||
width: parent.width - (Style.marginL * 2)
|
||||
spacing: Style.marginL
|
||||
|
||||
// Cards (consistent inter-card spacing via ColumnLayout spacing)
|
||||
ProfileCard {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Math.max(64)
|
||||
Layout.preferredHeight: profileHeight
|
||||
}
|
||||
|
||||
WeatherCard {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Math.max(190)
|
||||
Layout.preferredHeight: weatherHeight
|
||||
}
|
||||
|
||||
// Middle section: media + stats column
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Math.max(260)
|
||||
spacing: content.cardSpacing
|
||||
Layout.preferredHeight: mediaSysMonHeight
|
||||
spacing: Style.marginL
|
||||
|
||||
// Media card
|
||||
MediaCard {
|
||||
@@ -61,7 +65,7 @@ NPanel {
|
||||
|
||||
// System monitors combined in one card
|
||||
SystemMonitorCard {
|
||||
Layout.preferredWidth: Style.baseWidgetSize * 2.625
|
||||
Layout.preferredWidth: Math.round(Style.baseWidgetSize * 2.625)
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
}
|
||||
@@ -69,27 +73,27 @@ NPanel {
|
||||
// Audio card below media and system monitor
|
||||
AudioCard {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Math.max(120)
|
||||
Layout.preferredHeight: audioHeight
|
||||
}
|
||||
|
||||
// Bottom actions (two grouped rows of round buttons)
|
||||
RowLayout {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: Math.max(60)
|
||||
spacing: content.cardSpacing
|
||||
Layout.preferredHeight: bottomHeight
|
||||
spacing: Style.marginL
|
||||
|
||||
// Power Profiles switcher
|
||||
PowerProfilesCard {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
spacing: content.cardSpacing
|
||||
spacing: Style.marginL
|
||||
}
|
||||
|
||||
// Utilities buttons
|
||||
UtilitiesCard {
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
spacing: content.cardSpacing
|
||||
spacing: Style.marginL
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user