mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-30 08:22:51 -05:00
launcher v2: general styling fixes
- scrollbar - footer alignment - radii - hover colors
This commit is contained in:
@@ -36,7 +36,7 @@ Rectangle {
|
|||||||
readonly property int computedIconSize: Math.min(48, Math.max(32, width * 0.45))
|
readonly property int computedIconSize: Math.min(48, Math.max(32, width * 0.45))
|
||||||
|
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
color: isSelected ? Theme.primaryPressed : isHovered ? Theme.primaryPressed : "transparent"
|
color: isSelected ? Theme.primaryPressed : isHovered ? Theme.primaryHoverLight : "transparent"
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|||||||
@@ -271,21 +271,32 @@ FocusScope {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
visible: !editMode
|
visible: !editMode
|
||||||
|
|
||||||
Rectangle {
|
Item {
|
||||||
id: footerBar
|
id: footerBar
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.leftMargin: root.parentModal?.borderWidth ?? 1
|
||||||
|
anchors.rightMargin: root.parentModal?.borderWidth ?? 1
|
||||||
|
anchors.bottomMargin: root.parentModal?.borderWidth ?? 1
|
||||||
readonly property bool showFooter: SettingsData.dankLauncherV2Size !== "micro" && SettingsData.dankLauncherV2ShowFooter
|
readonly property bool showFooter: SettingsData.dankLauncherV2Size !== "micro" && SettingsData.dankLauncherV2ShowFooter
|
||||||
height: showFooter ? 32 : 0
|
height: showFooter ? 36 : 0
|
||||||
visible: showFooter
|
visible: showFooter
|
||||||
|
clip: true
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.topMargin: -Theme.cornerRadius
|
||||||
color: Theme.surfaceContainerHigh
|
color: Theme.surfaceContainerHigh
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
|
}
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: modeButtonsRow
|
id: modeButtonsRow
|
||||||
x: I18n.isRtl ? parent.width - width - Theme.spacingS : Theme.spacingS
|
anchors.left: parent.left
|
||||||
y: (parent.height - height) / 2
|
anchors.leftMargin: Theme.spacingXS
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
layoutDirection: I18n.isRtl ? Qt.RightToLeft : Qt.LeftToRight
|
||||||
spacing: 2
|
spacing: 2
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
@@ -316,28 +327,25 @@ FocusScope {
|
|||||||
required property var modelData
|
required property var modelData
|
||||||
required property int index
|
required property int index
|
||||||
|
|
||||||
width: modeButtonMetrics.width + 14 + Theme.spacingXS + Theme.spacingM * 2 + Theme.spacingS
|
width: buttonContent.width + Theme.spacingM * 2
|
||||||
height: footerBar.height - 4
|
height: 28
|
||||||
radius: Theme.cornerRadius - 2
|
radius: Theme.cornerRadius
|
||||||
color: controller.searchMode === modelData.id || modeArea.containsMouse ? Theme.primaryContainer : "transparent"
|
color: controller.searchMode === modelData.id || modeArea.containsMouse ? Theme.primaryContainer : "transparent"
|
||||||
|
|
||||||
TextMetrics {
|
|
||||||
id: modeButtonMetrics
|
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
|
||||||
text: modelData.label
|
|
||||||
}
|
|
||||||
|
|
||||||
Row {
|
Row {
|
||||||
|
id: buttonContent
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
spacing: Theme.spacingXS
|
spacing: Theme.spacingXS
|
||||||
|
|
||||||
DankIcon {
|
DankIcon {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
name: modelData.icon
|
name: modelData.icon
|
||||||
size: 14
|
size: 14
|
||||||
color: controller.searchMode === modelData.id ? Theme.primary : Theme.surfaceVariantText
|
color: controller.searchMode === modelData.id ? Theme.primary : Theme.surfaceVariantText
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
text: modelData.label
|
text: modelData.label
|
||||||
font.pixelSize: Theme.fontSizeSmall
|
font.pixelSize: Theme.fontSizeSmall
|
||||||
color: controller.searchMode === modelData.id ? Theme.primary : Theme.surfaceText
|
color: controller.searchMode === modelData.id ? Theme.primary : Theme.surfaceText
|
||||||
@@ -357,23 +365,28 @@ FocusScope {
|
|||||||
|
|
||||||
Row {
|
Row {
|
||||||
id: hintsRow
|
id: hintsRow
|
||||||
x: I18n.isRtl ? Theme.spacingS : parent.width - width - Theme.spacingS
|
anchors.right: parent.right
|
||||||
y: (parent.height - height) / 2
|
anchors.rightMargin: Theme.spacingS
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
layoutDirection: I18n.isRtl ? Qt.RightToLeft : Qt.LeftToRight
|
||||||
spacing: Theme.spacingM
|
spacing: Theme.spacingM
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
text: "↑↓ " + I18n.tr("nav")
|
text: "↑↓ " + I18n.tr("nav")
|
||||||
font.pixelSize: Theme.fontSizeSmall - 1
|
font.pixelSize: Theme.fontSizeSmall - 1
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
text: "↵ " + I18n.tr("open")
|
text: "↵ " + I18n.tr("open")
|
||||||
font.pixelSize: Theme.fontSizeSmall - 1
|
font.pixelSize: Theme.fontSizeSmall - 1
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
text: "Tab " + I18n.tr("actions")
|
text: "Tab " + I18n.tr("actions")
|
||||||
font.pixelSize: Theme.fontSizeSmall - 1
|
font.pixelSize: Theme.fontSizeSmall - 1
|
||||||
color: Theme.surfaceVariantText
|
color: Theme.surfaceVariantText
|
||||||
@@ -390,7 +403,6 @@ FocusScope {
|
|||||||
anchors.leftMargin: Theme.spacingM
|
anchors.leftMargin: Theme.spacingM
|
||||||
anchors.rightMargin: Theme.spacingM
|
anchors.rightMargin: Theme.spacingM
|
||||||
anchors.topMargin: Theme.spacingM
|
anchors.topMargin: Theme.spacingM
|
||||||
anchors.bottomMargin: Theme.spacingXS
|
|
||||||
spacing: Theme.spacingXS
|
spacing: Theme.spacingXS
|
||||||
clip: false
|
clip: false
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ Rectangle {
|
|||||||
|
|
||||||
width: parent?.width ?? 200
|
width: parent?.width ?? 200
|
||||||
height: 52
|
height: 52
|
||||||
color: isSelected ? Theme.primaryPressed : isHovered ? Theme.primaryPressed : "transparent"
|
color: isSelected ? Theme.primaryPressed : isHovered ? Theme.primaryHoverLight : "transparent"
|
||||||
radius: Theme.cornerRadius
|
radius: Theme.cornerRadius
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|||||||
@@ -159,6 +159,15 @@ Item {
|
|||||||
contentHeight: sectionsColumn.height
|
contentHeight: sectionsColumn.height
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
verticalScrollBar.targetFlickable = mainFlickable;
|
||||||
|
verticalScrollBar.parent = root;
|
||||||
|
verticalScrollBar.z = 102;
|
||||||
|
verticalScrollBar.anchors.right = root.right;
|
||||||
|
verticalScrollBar.anchors.top = root.top;
|
||||||
|
verticalScrollBar.anchors.bottom = root.bottom;
|
||||||
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: sectionsColumn
|
id: sectionsColumn
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ Rectangle {
|
|||||||
width: parent?.width ?? 200
|
width: parent?.width ?? 200
|
||||||
height: 32
|
height: 32
|
||||||
color: isSticky ? "transparent" : (hoverArea.containsMouse ? Theme.surfaceHover : "transparent")
|
color: isSticky ? "transparent" : (hoverArea.containsMouse ? Theme.surfaceHover : "transparent")
|
||||||
radius: Theme.cornerRadius / 2
|
radius: Theme.cornerRadius
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: hoverArea
|
id: hoverArea
|
||||||
|
|||||||
@@ -722,7 +722,7 @@ Item {
|
|||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: "DMS"
|
text: "DMS"
|
||||||
font.pixelSize: Theme.fontSizeSmall - 2
|
font.pixelSize: Theme.fontSizeSmall - 2
|
||||||
color: Theme.primaryText
|
color: Theme.primary
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import qs.Widgets
|
|||||||
Flickable {
|
Flickable {
|
||||||
id: flickable
|
id: flickable
|
||||||
|
|
||||||
|
property alias verticalScrollBar: vbar
|
||||||
property real mouseWheelSpeed: 60
|
property real mouseWheelSpeed: 60
|
||||||
property real momentumVelocity: 0
|
property real momentumVelocity: 0
|
||||||
property bool isMomentumActive: false
|
property bool isMomentumActive: false
|
||||||
|
|||||||
@@ -5,12 +5,15 @@ import qs.Common
|
|||||||
ScrollBar {
|
ScrollBar {
|
||||||
id: scrollbar
|
id: scrollbar
|
||||||
|
|
||||||
|
property var targetFlickable: null
|
||||||
|
readonly property var _target: targetFlickable ?? parent
|
||||||
|
|
||||||
property bool _scrollBarActive: false
|
property bool _scrollBarActive: false
|
||||||
property alias hideTimer: hideScrollBarTimer
|
property alias hideTimer: hideScrollBarTimer
|
||||||
property bool _isParentMoving: parent && (parent.moving || parent.flicking || parent.isMomentumActive)
|
property bool _isParentMoving: _target && (_target.moving || _target.flicking || _target.isMomentumActive)
|
||||||
property bool _shouldShow: pressed || hovered || active || _isParentMoving || _scrollBarActive
|
property bool _shouldShow: pressed || hovered || active || _isParentMoving || _scrollBarActive
|
||||||
|
|
||||||
policy: (parent && parent.contentHeight > parent.height) ? ScrollBar.AsNeeded : ScrollBar.AlwaysOff
|
policy: (_target && _target.contentHeight > _target.height) ? ScrollBar.AsNeeded : ScrollBar.AlwaysOff
|
||||||
minimumSize: 0.08
|
minimumSize: 0.08
|
||||||
implicitWidth: 10
|
implicitWidth: 10
|
||||||
interactive: true
|
interactive: true
|
||||||
|
|||||||
Reference in New Issue
Block a user