mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-28 14:43:09 +00:00
[panel] Fix not centered bottom arrow, and adjust top margin slightly
This commit is contained in:
parent
844be8376e
commit
7c8fc77984
1 changed files with 19 additions and 12 deletions
|
|
@ -41,9 +41,9 @@ Item {
|
||||||
: (expandedMode ? 0 : root.height - collapsedHeight)
|
: (expandedMode ? 0 : root.height - collapsedHeight)
|
||||||
|
|
||||||
|
|
||||||
readonly property real collapsedHeight: column.Layout.minimumHeight + background.fixedMargins.top + background.fixedMargins.bottom
|
readonly property real collapsedHeight: column.Layout.minimumHeight + background.margins.top + background.fixedMargins.bottom
|
||||||
|
|
||||||
readonly property real expandedHeight: column.Layout.maximumHeight + background.fixedMargins.top + background.fixedMargins.bottom
|
readonly property real expandedHeight: column.Layout.maximumHeight + background.margins.top + background.fixedMargins.bottom
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
target: root.parentSlidingPanel
|
target: root.parentSlidingPanel
|
||||||
|
|
@ -81,21 +81,23 @@ Item {
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: column
|
id: column
|
||||||
|
|
||||||
anchors {
|
anchors {
|
||||||
leftMargin: parent.fixedMargins.left
|
leftMargin: parent.fixedMargins.left
|
||||||
rightMargin: parent.fixedMargins.right
|
rightMargin: parent.fixedMargins.right
|
||||||
bottomMargin: parent.fixedMargins.bottom
|
bottomMargin: parent.fixedMargins.bottom * (parentSlidingPanel.wideScreen ? 1 : 0.5) // HACK: fix the bottom arrow not being centered, bottom margins aren't properly calculated it seems
|
||||||
left: parent.left
|
left: parent.left
|
||||||
right: parent.right
|
right: parent.right
|
||||||
bottom: parent.bottom
|
bottom: parent.bottom
|
||||||
}
|
}
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
height: Layout.minimumHeight * (1 - root.expandedRatio) + (Layout.maximumHeight * root.expandedRatio)
|
height: Layout.minimumHeight * (1 - root.expandedRatio) + (Layout.maximumHeight * root.expandedRatio)
|
||||||
// clip: expandedRatio > 0 && expandedRatio < 1 // only clip when necessary to improve performance
|
|
||||||
|
|
||||||
readonly property real cellSizeHint: units.iconSizes.large + units.smallSpacing * 6
|
readonly property real cellSizeHint: units.iconSizes.large + units.smallSpacing * 6
|
||||||
readonly property real columnWidth: Math.floor(width / Math.floor(width / cellSizeHint))
|
readonly property real columnWidth: Math.floor(width / Math.floor(width / cellSizeHint))
|
||||||
|
|
||||||
|
// top indicators (clock, widgets, etc.)
|
||||||
IndicatorsRow {
|
IndicatorsRow {
|
||||||
id: indicatorsRow
|
id: indicatorsRow
|
||||||
z: 1
|
z: 1
|
||||||
|
|
@ -106,6 +108,8 @@ Item {
|
||||||
showGradientBackground: false
|
showGradientBackground: false
|
||||||
showDropShadow: false
|
showDropShadow: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// quicksettings list
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
clip: expandedRatio > 0 && expandedRatio < 1 // only clip when necessary to improve performance
|
clip: expandedRatio > 0 && expandedRatio < 1 // only clip when necessary to improve performance
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
@ -172,27 +176,30 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
// bottom "handle bar"
|
// bottom "handle bar"
|
||||||
Item {
|
ColumnLayout {
|
||||||
id: bottomBar
|
id: bottomBar
|
||||||
Layout.fillWidth: true
|
spacing: 0
|
||||||
visible: !parentSlidingPanel.wideScreen
|
visible: !parentSlidingPanel.wideScreen
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
implicitHeight: visible ? Math.round(PlasmaCore.Units.gridUnit * 1.3) : 0
|
implicitHeight: visible ? Math.round(PlasmaCore.Units.gridUnit * 1.3) : 0
|
||||||
z: 1
|
|
||||||
Kirigami.Separator {
|
Kirigami.Separator {
|
||||||
anchors {
|
Layout.fillWidth: true
|
||||||
left: parent.left
|
|
||||||
right: parent.right
|
|
||||||
}
|
|
||||||
color: PlasmaCore.Theme.disabledTextColor
|
color: PlasmaCore.Theme.disabledTextColor
|
||||||
opacity: 0.3
|
opacity: 0.3
|
||||||
}
|
}
|
||||||
|
|
||||||
Kirigami.Icon {
|
Kirigami.Icon {
|
||||||
color: PlasmaCore.Theme.disabledTextColor
|
color: PlasmaCore.Theme.disabledTextColor
|
||||||
source: expandedRatio >= 0.5 ? "go-up-symbolic" : "go-down-symbolic"
|
source: expandedRatio >= 0.5 ? "go-up-symbolic" : "go-down-symbolic"
|
||||||
implicitWidth: PlasmaCore.Units.gridUnit
|
implicitWidth: PlasmaCore.Units.gridUnit
|
||||||
implicitHeight: width
|
implicitHeight: width
|
||||||
anchors.centerIn: parent
|
Layout.alignment: Qt.AlignCenter
|
||||||
|
Layout.topMargin: Kirigami.Units.smallSpacing
|
||||||
|
Layout.bottomMargin: Kirigami.Units.smallSpacing
|
||||||
}
|
}
|
||||||
|
|
||||||
TapHandler {
|
TapHandler {
|
||||||
onTapped: {
|
onTapped: {
|
||||||
if (root.expandedMode) {
|
if (root.expandedMode) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue