Use Style.spacingXXXl for spacing AND margins (removed Style.marginXXX)
This commit is contained in:
parent
197bd58661
commit
1e0057dcaf
7 changed files with 26 additions and 33 deletions
|
|
@ -15,7 +15,7 @@ PopupWindow {
|
||||||
property real anchorY
|
property real anchorY
|
||||||
|
|
||||||
implicitWidth: 180 * scaling
|
implicitWidth: 180 * scaling
|
||||||
implicitHeight: Math.max(40 * scaling, listView.contentHeight + (Style.spacingMedium * 2 * scaling))
|
implicitHeight: Math.max(40 * scaling, listView.contentHeight + (Style.marginMedium * 2 * scaling))
|
||||||
visible: false
|
visible: false
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
|
|
||||||
|
|
@ -83,7 +83,7 @@ PopupWindow {
|
||||||
ListView {
|
ListView {
|
||||||
id: listView
|
id: listView
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Style.spacingMedium * scaling
|
anchors.margins: Style.marginMedium * scaling
|
||||||
spacing: 0
|
spacing: 0
|
||||||
interactive: false
|
interactive: false
|
||||||
enabled: trayMenu.visible
|
enabled: trayMenu.visible
|
||||||
|
|
@ -318,8 +318,8 @@ PopupWindow {
|
||||||
ListView {
|
ListView {
|
||||||
id: listView
|
id: listView
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Style.spacingSmall * scaling
|
anchors.margins: Style.marginSmall * scaling
|
||||||
spacing: Style.spacingTiny * scaling
|
spacing: Style.marginTiny * scaling
|
||||||
interactive: false
|
interactive: false
|
||||||
enabled: subMenu.visible
|
enabled: subMenu.visible
|
||||||
clip: true
|
clip: true
|
||||||
|
|
@ -354,9 +354,9 @@ PopupWindow {
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.leftMargin: Style.spacingMedium * scaling
|
anchors.leftMargin: Style.marginMedium * scaling
|
||||||
anchors.rightMargin: Style.spacingMedium * scaling
|
anchors.rightMargin: Style.marginMedium * scaling
|
||||||
spacing: Style.spacingSmall * scaling
|
spacing: Style.marginSmall * scaling
|
||||||
|
|
||||||
NText {
|
NText {
|
||||||
id: subText
|
id: subText
|
||||||
|
|
|
||||||
|
|
@ -237,8 +237,8 @@ NLoader {
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Style.spacingSmall * scaling
|
anchors.margins: Style.marginSmall * scaling
|
||||||
spacing: Style.spacingSmall * scaling
|
spacing: Style.marginSmall * scaling
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
@ -254,7 +254,7 @@ NLoader {
|
||||||
TextInput {
|
TextInput {
|
||||||
id: passwordInputField
|
id: passwordInputField
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Style.spacingMedium * scaling
|
anchors.margins: Style.marginMedium * scaling
|
||||||
text: passwordInput
|
text: passwordInput
|
||||||
font.pointSize: Style.fontSizeMedium * scaling
|
font.pointSize: Style.fontSizeMedium * scaling
|
||||||
color: Colors.textPrimary
|
color: Colors.textPrimary
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ NLoader {
|
||||||
Column {
|
Column {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: Style.marginSmall * scaling
|
anchors.margins: Style.marginSmall * scaling
|
||||||
spacing: Style.spacingTiny * 1.5 * scaling // Minimal spacing between tabs
|
spacing: Style.marginTiny * 1.5 * scaling // Minimal spacing between tabs
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
id: sections
|
id: sections
|
||||||
|
|
@ -132,7 +132,7 @@ NLoader {
|
||||||
NText {
|
NText {
|
||||||
text: modelData.label
|
text: modelData.label
|
||||||
color: selected ? Colors.onAccent : (tabItem.hovering ? Colors.onAccent : Colors.textPrimary)
|
color: selected ? Colors.onAccent : (tabItem.hovering ? Colors.onAccent : Colors.textPrimary)
|
||||||
font.pointSize: Style.fontSizeMediumLarge * scaling
|
font.pointSize: Style.fontSizeInter * scaling
|
||||||
font.weight: Style.fontWeightBold
|
font.weight: Style.fontWeightBold
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@ NLoader {
|
||||||
|
|
||||||
readonly property real scaling: Scaling.scale(screen)
|
readonly property real scaling: Scaling.scale(screen)
|
||||||
// Single source of truth for spacing between cards (both axes)
|
// Single source of truth for spacing between cards (both axes)
|
||||||
property real cardSpacing: Style.spacingLarge * scaling
|
property real cardSpacing: Style.marginLarge * scaling
|
||||||
// X coordinate from the bar to align this panel under
|
// X coordinate from the bar to align this panel under
|
||||||
property real anchorX: root.anchorX
|
property real anchorX: root.anchorX
|
||||||
// Ensure this panel attaches to the intended screen
|
// Ensure this panel attaches to the intended screen
|
||||||
|
|
|
||||||
|
|
@ -79,7 +79,7 @@ NBox {
|
||||||
model: weatherReady ? Location.data.weather.daily.time : []
|
model: weatherReady ? Location.data.weather.daily.time : []
|
||||||
delegate: ColumnLayout {
|
delegate: ColumnLayout {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
spacing: Style.spacingSmall * scaling
|
spacing: Style.marginSmall * scaling
|
||||||
NText {
|
NText {
|
||||||
text: Qt.formatDateTime(new Date(Location.data.weather.daily.time[index]), "ddd")
|
text: Qt.formatDateTime(new Date(Location.data.weather.daily.time[index]), "ddd")
|
||||||
color: Colors.textPrimary
|
color: Colors.textPrimary
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ Singleton {
|
||||||
property real fontSizeTiny: 7
|
property real fontSizeTiny: 7
|
||||||
property real fontSizeSmall: 9
|
property real fontSizeSmall: 9
|
||||||
property real fontSizeMedium: 11
|
property real fontSizeMedium: 11
|
||||||
property real fontSizeMediumLarge: 12
|
property real fontSizeInter: 12
|
||||||
property real fontSizeLarge: 13
|
property real fontSizeLarge: 13
|
||||||
property real fontSizeXL: 18
|
property real fontSizeXL: 18
|
||||||
property real fontSizeXXL: 24
|
property real fontSizeXXL: 24
|
||||||
|
|
@ -27,23 +27,16 @@ Singleton {
|
||||||
property int fontWeightBold: 700
|
property int fontWeightBold: 700
|
||||||
|
|
||||||
// Radii
|
// Radii
|
||||||
property int radiusLarge: 20
|
|
||||||
property int radiusMedium: 16
|
|
||||||
property int radiusSmall: 12
|
|
||||||
property int radiusTiny: 8
|
property int radiusTiny: 8
|
||||||
|
property int radiusSmall: 12
|
||||||
|
property int radiusMedium: 16
|
||||||
|
property int radiusLarge: 20
|
||||||
|
|
||||||
// Border
|
// Border
|
||||||
property int borderThin: 1
|
property int borderThin: 1
|
||||||
property int borderMedium: 2
|
property int borderMedium: 2
|
||||||
property int borderThick: 3
|
property int borderThick: 3
|
||||||
|
|
||||||
// Spacing
|
|
||||||
property int spacingExtraLarge: 20
|
|
||||||
property int spacingLarge: 16
|
|
||||||
property int spacingMedium: 12
|
|
||||||
property int spacingSmall: 8
|
|
||||||
property int spacingTiny: 4
|
|
||||||
|
|
||||||
// Animation duration (ms)
|
// Animation duration (ms)
|
||||||
property int animationFast: 150
|
property int animationFast: 150
|
||||||
property int animationNormal: 300
|
property int animationNormal: 300
|
||||||
|
|
@ -59,12 +52,12 @@ Singleton {
|
||||||
property int tooltipDelayLong: 1200
|
property int tooltipDelayLong: 1200
|
||||||
property int pillDelay: 500
|
property int pillDelay: 500
|
||||||
|
|
||||||
// Margins and spacing
|
// Margins (for margins and spacing)
|
||||||
property int marginTiny: 4
|
property int marginTiny: 4
|
||||||
property int marginSmall: 8
|
property int marginSmall: 8
|
||||||
property int marginMedium: 12
|
property int marginMedium: 12
|
||||||
property int marginLarge: 16
|
property int marginLarge: 16
|
||||||
property int marginXL: 20
|
property int marginExtraLarge: 20
|
||||||
|
|
||||||
// Opacity
|
// Opacity
|
||||||
property real opacityNone: 0.0
|
property real opacityNone: 0.0
|
||||||
|
|
|
||||||
|
|
@ -36,8 +36,8 @@ ComboBox {
|
||||||
|
|
||||||
// Label (currently selected)
|
// Label (currently selected)
|
||||||
contentItem: NText {
|
contentItem: NText {
|
||||||
leftPadding: Style.spacingLarge * scaling
|
leftPadding: Style.marginLarge * scaling
|
||||||
rightPadding: root.indicator.width + Style.spacingLarge * scaling
|
rightPadding: root.indicator.width + Style.marginLarge * scaling
|
||||||
font.pointSize: Style.fontSizeMedium * scaling
|
font.pointSize: Style.fontSizeMedium * scaling
|
||||||
font.weight: Style.fontWeightBold
|
font.weight: Style.fontWeightBold
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
|
|
@ -49,7 +49,7 @@ ComboBox {
|
||||||
|
|
||||||
// Drop down indicator
|
// Drop down indicator
|
||||||
indicator: NText {
|
indicator: NText {
|
||||||
x: root.width - width - Style.spacingMedium * scaling
|
x: root.width - width - Style.marginMedium * scaling
|
||||||
y: root.topPadding + (root.availableHeight - height) / 2
|
y: root.topPadding + (root.availableHeight - height) / 2
|
||||||
text: "arrow_drop_down"
|
text: "arrow_drop_down"
|
||||||
font.family: "Material Symbols Outlined"
|
font.family: "Material Symbols Outlined"
|
||||||
|
|
@ -59,8 +59,8 @@ ComboBox {
|
||||||
popup: Popup {
|
popup: Popup {
|
||||||
y: root.height
|
y: root.height
|
||||||
width: root.width
|
width: root.width
|
||||||
implicitHeight: Math.min(160 * scaling, contentItem.implicitHeight + Style.spacingMedium * scaling * 2)
|
implicitHeight: Math.min(160 * scaling, contentItem.implicitHeight + Style.marginMedium * scaling * 2)
|
||||||
padding: Style.spacingMedium * scaling
|
padding: Style.marginMedium * scaling
|
||||||
|
|
||||||
contentItem: ListView {
|
contentItem: ListView {
|
||||||
clip: true
|
clip: true
|
||||||
|
|
@ -93,7 +93,7 @@ ComboBox {
|
||||||
}
|
}
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
width: root.width - Style.spacingMedium * scaling * 3
|
width: root.width - Style.marginMedium * scaling * 3
|
||||||
color: highlighted ? Colors.hover : "transparent"
|
color: highlighted ? Colors.hover : "transparent"
|
||||||
radius: Style.radiusSmall * scaling
|
radius: Style.radiusSmall * scaling
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue