mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-04 11:16:03 +00:00
Qt-Scaling: first cleanup pass
This commit is contained in:
@@ -16,8 +16,8 @@ Rectangle {
|
||||
signal hidden
|
||||
|
||||
width: parent.width
|
||||
height: Math.round(contentLayout.implicitHeight + Style.marginL * 2 * scaling)
|
||||
radius: Style.radiusL * scaling
|
||||
height: Math.round(contentLayout.implicitHeight + Style.marginL * 2)
|
||||
radius: Style.radiusL
|
||||
visible: false
|
||||
opacity: 0
|
||||
scale: initialScale
|
||||
@@ -34,7 +34,7 @@ Rectangle {
|
||||
return Color.mOutline
|
||||
}
|
||||
}
|
||||
border.width: Math.max(2, Style.borderM * scaling)
|
||||
border.width: Math.max(2, Style.borderM)
|
||||
|
||||
Behavior on opacity {
|
||||
NumberAnimation {
|
||||
@@ -74,8 +74,8 @@ Rectangle {
|
||||
RowLayout {
|
||||
id: contentLayout
|
||||
anchors.fill: parent
|
||||
anchors.margins: Style.marginL * scaling
|
||||
spacing: Style.marginL * scaling
|
||||
anchors.margins: Style.marginL
|
||||
spacing: Style.marginL
|
||||
|
||||
// Icon
|
||||
NIcon {
|
||||
@@ -100,13 +100,13 @@ Rectangle {
|
||||
return Color.mOnSurface
|
||||
}
|
||||
}
|
||||
pointSize: Style.fontSizeXXL * 1.5 * scaling
|
||||
pointSize: Style.fontSizeXXL * 1.5
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
}
|
||||
|
||||
// Label and description
|
||||
ColumnLayout {
|
||||
spacing: Style.marginXXS * scaling
|
||||
spacing: Style.marginXXS
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
|
||||
@@ -114,7 +114,7 @@ Rectangle {
|
||||
Layout.fillWidth: true
|
||||
text: root.message
|
||||
color: Color.mOnSurface
|
||||
pointSize: Style.fontSizeL * scaling
|
||||
pointSize: Style.fontSizeL
|
||||
font.weight: Style.fontWeightBold
|
||||
wrapMode: Text.WordWrap
|
||||
visible: text.length > 0
|
||||
@@ -124,7 +124,7 @@ Rectangle {
|
||||
Layout.fillWidth: true
|
||||
text: root.description
|
||||
color: Color.mOnSurface
|
||||
pointSize: Style.fontSizeM * scaling
|
||||
pointSize: Style.fontSizeM
|
||||
wrapMode: Text.WordWrap
|
||||
visible: text.length > 0
|
||||
}
|
||||
|
||||
@@ -11,8 +11,6 @@ Variants {
|
||||
|
||||
delegate: ToastScreen {
|
||||
required property ShellScreen modelData
|
||||
|
||||
screen: modelData
|
||||
scaling: ScalingService.getScreenScale(modelData)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,7 +10,6 @@ Item {
|
||||
id: root
|
||||
|
||||
required property ShellScreen screen
|
||||
required property real scaling
|
||||
|
||||
// Local queue for this screen only (bounded to prevent memory issues)
|
||||
property var messageQueue: []
|
||||
@@ -20,15 +19,6 @@ Item {
|
||||
// If true, immediately show new toasts
|
||||
property bool replaceOnNew: true
|
||||
|
||||
Connections {
|
||||
target: ScalingService
|
||||
function onScaleChanged(screenName, scale) {
|
||||
if (screenName === root.screen.name) {
|
||||
root.scaling = scale
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: ToastService
|
||||
|
||||
@@ -161,10 +151,10 @@ Item {
|
||||
margins.top: {
|
||||
if (!(anchors.top))
|
||||
return 0
|
||||
var base = Style.marginM * scaling
|
||||
var base = Style.marginM
|
||||
if (Settings.data.bar.position === "top") {
|
||||
var floatExtraV = Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL * scaling : 0
|
||||
return (Style.barHeight * scaling) + base + floatExtraV
|
||||
var floatExtraV = Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL : 0
|
||||
return (Style.barHeight) + base + floatExtraV
|
||||
}
|
||||
return base
|
||||
}
|
||||
@@ -172,10 +162,10 @@ Item {
|
||||
margins.bottom: {
|
||||
if (!(anchors.bottom))
|
||||
return 0
|
||||
var base = Style.marginM * scaling
|
||||
var base = Style.marginM
|
||||
if (Settings.data.bar.position === "bottom") {
|
||||
var floatExtraV = Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL * scaling : 0
|
||||
return (Style.barHeight * scaling) + base + floatExtraV
|
||||
var floatExtraV = Settings.data.bar.floating ? Settings.data.bar.marginVertical * Style.marginXL : 0
|
||||
return (Style.barHeight) + base + floatExtraV
|
||||
}
|
||||
return base
|
||||
}
|
||||
@@ -183,10 +173,10 @@ Item {
|
||||
margins.left: {
|
||||
if (!(anchors.left))
|
||||
return 0
|
||||
var base = Style.marginM * scaling
|
||||
var base = Style.marginM
|
||||
if (Settings.data.bar.position === "left") {
|
||||
var floatExtraH = Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL * scaling : 0
|
||||
return (Style.barHeight * scaling) + base + floatExtraH
|
||||
var floatExtraH = Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL : 0
|
||||
return (Style.barHeight) + base + floatExtraH
|
||||
}
|
||||
return base
|
||||
}
|
||||
@@ -194,15 +184,15 @@ Item {
|
||||
margins.right: {
|
||||
if (!(anchors.right))
|
||||
return 0
|
||||
var base = Style.marginM * scaling
|
||||
var base = Style.marginM
|
||||
if (Settings.data.bar.position === "right") {
|
||||
var floatExtraH = Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL * scaling : 0
|
||||
return (Style.barHeight * scaling) + base + floatExtraH
|
||||
var floatExtraH = Settings.data.bar.floating ? Settings.data.bar.marginHorizontal * Style.marginXL : 0
|
||||
return (Style.barHeight) + base + floatExtraH
|
||||
}
|
||||
return base
|
||||
}
|
||||
|
||||
implicitWidth: 420 * root.scaling
|
||||
implicitWidth: 420
|
||||
implicitHeight: toastItem.height
|
||||
|
||||
color: Color.transparent
|
||||
|
||||
Reference in New Issue
Block a user