Debian Codegraph @

richtext-editor/example/EditorButton.qml

raw
1 import QtQuick 2.4
2 import Lomiri.Components 1.3
3
4 Item {
5 id: root
6 implicitWidth: height
7 property alias text: textField.text
8 property alias iconName: icon.name
9 property alias iconSource: icon.source
10 property alias iconColor: icon.color
11 // Set to true when format option is currently enabld
12 property bool active: false
13 property alias font: textField.font
14 property alias textSize: textField.textSize
15
16 signal clicked()
17
18 opacity: enabled ? 1 : 0.5
19
20 AbstractButton {
21 activeFocusOnPress: false
22 anchors.fill: parent
23 onClicked: root.clicked()
24 }
25
26 Rectangle {
27 anchors.fill: parent
28 color: LomiriColors.porcelain
29 visible: root.active
30 }
31
32 Icon {
33 id: icon
34 anchors { centerIn: parent }
35 height: units.gu(2.5)
36 width: height
37 visible: source.toString().length > 0
38 }
39
40 Label {
41 id: textField
42 anchors { centerIn: parent }
43 }
44 }