-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLessonButton.qml
More file actions
98 lines (83 loc) · 2.86 KB
/
LessonButton.qml
File metadata and controls
98 lines (83 loc) · 2.86 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
import QtQuick 2.0
import QtQuick.Layouts 1.3
import QtGraphicalEffects 1.0
import QtQuick.Controls 2.3
Button {
id: lessonButton
implicitWidth: 125
implicitHeight: 125
property int borderThickness: 3
property double pressedScale: 0.95
property color backgroundColor: "#404040"
property color highlightColor: "#505050"
property color glowColor: "#88ffff77"
property int glowRadius: 30
property int glowSamples: 120
property alias lessonTitle: titleText
property alias lessonImage: image
background: Rectangle {
color: lessonButton.hovered || lessonButton.pressed?
lessonButton.highlightColor : lessonButton.backgroundColor
anchors.fill: parent
}
contentItem: ColumnLayout {
id: columnLayout
anchors.fill: parent
clip: false
spacing: 5
Item {
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.preferredWidth: image.width
Layout.preferredHeight: image.height
Image {
id: image
fillMode: Image.PreserveAspectFit
source: "cube.png"
}
Glow {
visible: lessonButton.hovered || lessonButton.pressed
color: lessonButton.glowColor
radius: lessonButton.glowRadius
samples: lessonButton.glowSamples
anchors.fill: image
source: image
}
scale: lessonButton.pressed? lessonButton.pressedScale : 1
}
Item {
id: item1
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
Layout.preferredWidth: parent.width * 0.9
Layout.preferredHeight: parent.height / 3
Text {
id: titleText
color: "#ffffff"
text: "Lekcja 1"
font.pixelSize: 14
anchors.fill: parent
wrapMode: Text.WrapAtWordBoundaryOrAnywhere
font.bold: true
font.family: "Arial"
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignHCenter
}
Glow {
visible: lessonButton.hovered || lessonButton.pressed
color: lessonButton.glowColor
radius: lessonButton.glowRadius
samples: lessonButton.glowSamples
anchors.fill: titleText
source: titleText
}
scale: lessonButton.pressed? lessonButton.pressedScale : 1
}
Rectangle {
id: borderRectangle
height: lessonButton.borderThickness
color: "#000000"
Layout.alignment: Qt.AlignLeft | Qt.AlignBottom
Layout.fillWidth: true
transformOrigin: Item.Bottom
}
}
}