-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathButtonRaised.qml
46 lines (45 loc) · 1.24 KB
/
ButtonRaised.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// ekke (Ekkehard Gentz) @ekkescorner
import QtQuick 2.9
import QtQuick.Layouts 1.3
import QtQuick.Controls 2.2
import QtQuick.Controls.Material 2.2
import QtGraphicalEffects 1.0
// Raised Button
Button {
id: button
// default: textOnPrimary
property alias textColor: buttonText.color
// default: primaryColor
property alias buttonColor: buttonBackground.color
focusPolicy: Qt.NoFocus
Layout.fillWidth: true
Layout.preferredWidth : 1
leftPadding: 6
rightPadding: 6
contentItem: Text {
id: buttonText
text: button.text
opacity: enabled ? 1.0 : 0.3
color: textOnPrimary
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
font.capitalization: Font.AllUppercase
}
background:
Rectangle {
id: buttonBackground
implicitHeight: 48
color: primaryColor
radius: 2
opacity: button.pressed ? 0.75 : 1.0
layer.enabled: true
layer.effect: DropShadow {
verticalOffset: 2
horizontalOffset: 1
color: dropShadow
samples: button.pressed ? 20 : 10
spread: 0.5
}
} // background
} // button