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 Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
||||
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
|
||||
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.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
StyledRect {
|
||||
color: Appearance.alpha(Appearance.colours.m3surfaceContainerHigh, true)
|
||||
radius: Appearance.rounding.large
|
||||
implicitHeight: list.height + Appearance.padding.large * 2
|
||||
radius: root.rounding
|
||||
implicitHeight: list.height + root.padding * 2
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: search.top
|
||||
anchors.bottomMargin: Appearance.spacing.normal
|
||||
anchors.margins: Appearance.padding.large
|
||||
anchors.bottomMargin: root.spacing
|
||||
anchors.margins: root.padding
|
||||
|
||||
ListView {
|
||||
id: list
|
||||
|
|
@ -42,10 +46,21 @@ Item {
|
|||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.margins: Appearance.padding.large
|
||||
anchors.margins: root.padding
|
||||
|
||||
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 {
|
||||
Anim {
|
||||
properties: "opacity,scale"
|
||||
|
|
@ -93,13 +108,13 @@ Item {
|
|||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.margins: Appearance.padding.large
|
||||
anchors.margins: root.padding
|
||||
|
||||
placeholderText: qsTr("Type \">\" for commands")
|
||||
|
||||
background: StyledRect {
|
||||
color: Appearance.alpha(Appearance.colours.m3surfaceContainerHigh, true)
|
||||
radius: Appearance.rounding.large
|
||||
radius: root.rounding
|
||||
}
|
||||
|
||||
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