launcher: add scrollbar
Also fix height
This commit is contained in:
parent
8a32dd8614
commit
37c357ee5a
2 changed files with 39 additions and 8 deletions
|
|
@ -3,28 +3,32 @@ import "root:/services"
|
||||||
import "root:/config"
|
import "root:/config"
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property Scope launcher
|
required property Scope launcher
|
||||||
|
readonly property int padding: Appearance.padding.large
|
||||||
|
readonly property int spacing: Appearance.spacing.normal
|
||||||
|
readonly property int rounding: Appearance.rounding.large
|
||||||
|
|
||||||
implicitWidth: LauncherConfig.sizes.width
|
implicitWidth: LauncherConfig.sizes.width
|
||||||
implicitHeight: search.height + list.height + Appearance.padding.large * 5 // Don't question it
|
implicitHeight: search.height + list.height + padding * 4 + spacing
|
||||||
|
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
StyledRect {
|
StyledRect {
|
||||||
color: Appearance.alpha(Appearance.colours.m3surfaceContainerHigh, true)
|
color: Appearance.alpha(Appearance.colours.m3surfaceContainerHigh, true)
|
||||||
radius: Appearance.rounding.large
|
radius: root.rounding
|
||||||
implicitHeight: list.height + Appearance.padding.large * 2
|
implicitHeight: list.height + root.padding * 2
|
||||||
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: search.top
|
anchors.bottom: search.top
|
||||||
anchors.bottomMargin: Appearance.spacing.normal
|
anchors.bottomMargin: root.spacing
|
||||||
anchors.margins: Appearance.padding.large
|
anchors.margins: root.padding
|
||||||
|
|
||||||
ListView {
|
ListView {
|
||||||
id: list
|
id: list
|
||||||
|
|
@ -42,10 +46,21 @@ Item {
|
||||||
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.margins: Appearance.padding.large
|
anchors.margins: root.padding
|
||||||
|
|
||||||
delegate: AppItem {}
|
delegate: AppItem {}
|
||||||
|
|
||||||
|
ScrollBar.vertical: StyledScrollBar {
|
||||||
|
// Move half out
|
||||||
|
parent: list.parent
|
||||||
|
anchors.top: list.top
|
||||||
|
anchors.bottom: list.bottom
|
||||||
|
anchors.right: list.right
|
||||||
|
anchors.topMargin: root.padding / 2
|
||||||
|
anchors.bottomMargin: root.padding / 2
|
||||||
|
anchors.rightMargin: -root.padding / 2
|
||||||
|
}
|
||||||
|
|
||||||
add: Transition {
|
add: Transition {
|
||||||
Anim {
|
Anim {
|
||||||
properties: "opacity,scale"
|
properties: "opacity,scale"
|
||||||
|
|
@ -93,13 +108,13 @@ Item {
|
||||||
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.margins: Appearance.padding.large
|
anchors.margins: root.padding
|
||||||
|
|
||||||
placeholderText: qsTr("Type \">\" for commands")
|
placeholderText: qsTr("Type \">\" for commands")
|
||||||
|
|
||||||
background: StyledRect {
|
background: StyledRect {
|
||||||
color: Appearance.alpha(Appearance.colours.m3surfaceContainerHigh, true)
|
color: Appearance.alpha(Appearance.colours.m3surfaceContainerHigh, true)
|
||||||
radius: Appearance.rounding.large
|
radius: root.rounding
|
||||||
}
|
}
|
||||||
|
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
|
|
|
||||||
16
widgets/StyledScrollBar.qml
Normal file
16
widgets/StyledScrollBar.qml
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
import "root:/config"
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
|
||||||
|
ScrollBar {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
contentItem: StyledRect {
|
||||||
|
radius: Appearance.rounding.full
|
||||||
|
color: Qt.alpha(Appearance.colours.m3secondary, 0.5)
|
||||||
|
}
|
||||||
|
|
||||||
|
background: StyledRect {
|
||||||
|
implicitWidth: 10
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue