feat: make right bar side dependant on devices
This commit is contained in:
1 parent
c7fb3f9c02
commit
832d2544da
13 files changed
+630
-17
No files matched your search
@@ -0,0 +1,48 @@
|
||||
import QtQuick
|
||||
import "."
|
||||
|
||||
Rectangle {
|
||||
id: button
|
||||
|
||||
// "primary" | "secondary" | "accent" | "destructive"
|
||||
property string variant: "primary"
|
||||
property string text: ""
|
||||
signal clicked()
|
||||
|
||||
readonly property bool filled: variant === "primary" || variant === "accent"
|
||||
readonly property color tint: variant === "accent" ? Theme.colors.accent
|
||||
: variant === "destructive" ? Theme.colors.alert
|
||||
: Theme.colors.primary
|
||||
|
||||
implicitWidth: label.implicitWidth + Theme.geometry.padding * 2
|
||||
implicitHeight: label.implicitHeight + Theme.geometry.padding
|
||||
|
||||
radius: Theme.geometry.radius
|
||||
color: filled
|
||||
? (mouseArea.pressed ? Qt.darker(tint, 1.1) : tint)
|
||||
: (mouseArea.containsMouse ? Qt.alpha(tint, 0.22) : Qt.alpha(tint, 0.15))
|
||||
border.width: filled ? 0 : 1
|
||||
border.color: Qt.alpha(tint, 0.3)
|
||||
|
||||
Behavior on color { ColorAnimation { duration: Theme.animation.durationFast } }
|
||||
Behavior on scale { SpringAnimation { spring: 4; damping: 0.3 } }
|
||||
scale: mouseArea.pressed ? 0.97 : 1.0
|
||||
|
||||
Text {
|
||||
id: label
|
||||
anchors.centerIn: parent
|
||||
text: button.text
|
||||
font.family: Theme.font.family
|
||||
font.pixelSize: 13
|
||||
font.bold: true
|
||||
color: button.filled ? Theme.colors.background : button.tint
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: button.clicked()
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user