forked from rh-lab-q/confla-android
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButton.qml
More file actions
33 lines (28 loc) · 716 Bytes
/
Button.qml
File metadata and controls
33 lines (28 loc) · 716 Bytes
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
import QtQuick 2.0
import "Theme.js" as Theme
Rectangle {
id: button;
width: dpix * 0.5;
height: dpiy * 0.5;
anchors.margins: Theme.paddingMedium
property alias image: icon.source;
radius: 3;
color: mouse.pressed ? Theme.background_color_pressed : Theme.background_color;
border.color: Theme.background_color_pressed ;
border.width: 1;
signal clicked();
Image {
id: icon
anchors.centerIn: parent;
width: button.width * 0.8;
height: button.height * 0.8;
fillMode: Image.PreserveAspectFit
}
MouseArea {
id: mouse;
anchors.fill: parent;
onClicked: {
button.clicked();
}
}
}