launcher: add content
Also use surfaceContainer as background
This commit is contained in:
parent
fc87280dcf
commit
651378d496
8 changed files with 111 additions and 21 deletions
|
|
@ -59,7 +59,7 @@ Singleton {
|
||||||
}
|
}
|
||||||
|
|
||||||
component Transparency: QtObject {
|
component Transparency: QtObject {
|
||||||
readonly property bool enabled: true
|
readonly property bool enabled: false
|
||||||
readonly property real base: 0.78
|
readonly property real base: 0.78
|
||||||
readonly property real layers: 0.58
|
readonly property real layers: 0.58
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@ StyledRect {
|
||||||
}
|
}
|
||||||
|
|
||||||
vertical: BarConfig.vertical
|
vertical: BarConfig.vertical
|
||||||
color: Appearance.alpha(Appearance.colours.m3surface, false)
|
color: Appearance.alpha(Appearance.colours.m3surfaceContainer, false)
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
BoxLayout {
|
BoxLayout {
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ BoxLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
component Pill: PaddedRect {
|
component Pill: PaddedRect {
|
||||||
color: Appearance.alpha(Appearance.colours.m3surface, false)
|
color: Appearance.alpha(Appearance.colours.m3surfaceContainer, false)
|
||||||
radius: Appearance.rounding.full
|
radius: Appearance.rounding.full
|
||||||
padding: BarConfig.vertical ? [Appearance.padding.large, 0] : [0, Appearance.padding.large]
|
padding: BarConfig.vertical ? [Appearance.padding.large, 0] : [0, Appearance.padding.large]
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ Shape {
|
||||||
|
|
||||||
ShapePath {
|
ShapePath {
|
||||||
strokeWidth: -1
|
strokeWidth: -1
|
||||||
fillColor: Appearance.colours.m3surface
|
fillColor: Appearance.colours.m3surfaceContainer
|
||||||
|
|
||||||
startY: root.wrapperHeight
|
startY: root.wrapperHeight
|
||||||
|
|
||||||
|
|
|
||||||
68
modules/launcher/Content.qml
Normal file
68
modules/launcher/Content.qml
Normal file
|
|
@ -0,0 +1,68 @@
|
||||||
|
import "root:/widgets"
|
||||||
|
import "root:/config"
|
||||||
|
import Quickshell
|
||||||
|
import QtQuick
|
||||||
|
|
||||||
|
Item {
|
||||||
|
implicitWidth: LauncherConfig.sizes.width
|
||||||
|
implicitHeight: search.height + list.height + Appearance.padding.large * 5 // Don't question it
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
||||||
|
StyledRect {
|
||||||
|
color: Appearance.alpha(Appearance.colours.m3surfaceContainerHigh, true)
|
||||||
|
radius: Appearance.rounding.large
|
||||||
|
implicitHeight: list.height + Appearance.padding.large * 2
|
||||||
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.bottom: search.top
|
||||||
|
anchors.bottomMargin: Appearance.spacing.normal
|
||||||
|
anchors.margins: Appearance.padding.large
|
||||||
|
|
||||||
|
ListView {
|
||||||
|
id: list
|
||||||
|
|
||||||
|
model: DesktopEntries.applications.values.filter(x => x.name.toLowerCase().includes(search.text.toLowerCase()))
|
||||||
|
|
||||||
|
orientation: Qt.Vertical
|
||||||
|
verticalLayoutDirection: Qt.BottomToTop
|
||||||
|
height: 100
|
||||||
|
width: 100
|
||||||
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.margins: Appearance.padding.large
|
||||||
|
|
||||||
|
delegate: PaddedRect {
|
||||||
|
id: entry
|
||||||
|
|
||||||
|
required property DesktopEntry modelData
|
||||||
|
|
||||||
|
width: LauncherConfig.sizes.width
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: modelData.name
|
||||||
|
font.family: Appearance.font.family.sans
|
||||||
|
font.pointSize: Appearance.font.size.smaller
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledTextField {
|
||||||
|
id: search
|
||||||
|
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.bottom: parent.bottom
|
||||||
|
anchors.margins: Appearance.padding.large
|
||||||
|
|
||||||
|
placeholderText: "Type \">\" for commands"
|
||||||
|
|
||||||
|
background: StyledRect {
|
||||||
|
color: Appearance.alpha(Appearance.colours.m3surfaceContainerHigh, true)
|
||||||
|
radius: Appearance.rounding.large
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
import "root:/widgets"
|
import "root:/widgets"
|
||||||
import "root:/config"
|
import "root:/config"
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import QtQuick
|
import Quickshell.Wayland
|
||||||
import QtQuick.Shapes
|
|
||||||
import Qt5Compat.GraphicalEffects
|
|
||||||
|
|
||||||
Scope {
|
Scope {
|
||||||
id: root
|
id: root
|
||||||
|
|
@ -20,6 +18,8 @@ Scope {
|
||||||
id: win
|
id: win
|
||||||
|
|
||||||
name: "launcher"
|
name: "launcher"
|
||||||
|
keyboardFocus: root.launcherVisible ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
|
||||||
|
visible: wrapper.shouldBeVisible
|
||||||
|
|
||||||
width: content.width + bg.rounding * 2
|
width: content.width + bg.rounding * 2
|
||||||
height: content.implicitHeight
|
height: content.implicitHeight
|
||||||
|
|
@ -37,17 +37,8 @@ Scope {
|
||||||
|
|
||||||
launcherVisible: root.launcherVisible
|
launcherVisible: root.launcherVisible
|
||||||
|
|
||||||
PaddedRect {
|
Content {
|
||||||
id: content
|
id: content
|
||||||
|
|
||||||
width: LauncherConfig.sizes.width
|
|
||||||
padding: Appearance.padding.large
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
|
|
||||||
StyledText {
|
|
||||||
text: "Launcher"
|
|
||||||
font.pointSize: 80
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,13 +5,13 @@ Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property bool launcherVisible
|
required property bool launcherVisible
|
||||||
|
property bool shouldBeVisible
|
||||||
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
|
|
||||||
height: 0
|
height: 0
|
||||||
visible: false
|
|
||||||
|
|
||||||
clip: true
|
clip: true
|
||||||
|
|
||||||
|
|
@ -21,7 +21,7 @@ Item {
|
||||||
|
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
root.height: content.height
|
root.height: content.height
|
||||||
root.visible: true
|
root.shouldBeVisible: true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -33,7 +33,7 @@ Item {
|
||||||
SequentialAnimation {
|
SequentialAnimation {
|
||||||
PropertyAction {
|
PropertyAction {
|
||||||
target: root
|
target: root
|
||||||
property: "visible"
|
property: "shouldBeVisible"
|
||||||
}
|
}
|
||||||
NumberAnimation {
|
NumberAnimation {
|
||||||
target: root
|
target: root
|
||||||
|
|
@ -58,7 +58,7 @@ Item {
|
||||||
}
|
}
|
||||||
PropertyAction {
|
PropertyAction {
|
||||||
target: root
|
target: root
|
||||||
property: "visible"
|
property: "shouldBeVisible"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
31
widgets/StyledTextField.qml
Normal file
31
widgets/StyledTextField.qml
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
|
import "root:/config"
|
||||||
|
import QtQuick
|
||||||
|
import QtQuick.Controls
|
||||||
|
|
||||||
|
TextField {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
renderType: TextField.NativeRendering
|
||||||
|
color: Appearance.colours.m3onSurface
|
||||||
|
placeholderTextColor: Appearance.colours.m3outline
|
||||||
|
font.family: Appearance.font.family.sans
|
||||||
|
font.pointSize: Appearance.font.size.smaller
|
||||||
|
|
||||||
|
Behavior on color {
|
||||||
|
ColorAnimation {
|
||||||
|
duration: Appearance.anim.durations.normal
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: Appearance.anim.curves.standard
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Behavior on placeholderTextColor {
|
||||||
|
ColorAnimation {
|
||||||
|
duration: Appearance.anim.durations.normal
|
||||||
|
easing.type: Easing.BezierSpline
|
||||||
|
easing.bezierCurve: Appearance.anim.curves.standard
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Add table
Reference in a new issue