-
Notifications
You must be signed in to change notification settings - Fork 1
/
SmallButton.qml
36 lines (33 loc) · 1005 Bytes
/
SmallButton.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
import QtQuick 2.7
import QtQuick.Controls 2.2
import QtGraphicalEffects 1.0
import "DefaultTheme.js" as DefTheme
Button {
id: control
height: DefTheme.buttonHeight / 2.718
property bool outline: false
contentItem: Text {
id: captionText
horizontalAlignment: Qt.AlignHCenter
color: control.outline ? DefTheme.secColor : DefTheme.mainColorBg
font.pixelSize: parent.height * 0.6
verticalAlignment: Qt.AlignVCenter
elide: Text.ElideRight
leftPadding: parent.height / 4
rightPadding: parent.height / 4
text: control.text
font.bold: true
}
background: Rectangle {
anchors.fill: parent
color: control.outline ? DefTheme.mainColorBg : DefTheme.secColor
border.width: control.outline ? 1 : 0
border.color: DefTheme.secColor
layer.enabled: true
radius : height / 2.714
layer.effect: DropShadow {
transparentBorder: true
radius: parent.down ? 1 : 4
}
}
}