blob: c44f1a34166d0928859ba94fc42129b12611fe94 (
plain)
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
|
import QtQuick 2.15
import QtQuick.Controls 2.15
Button {
id: button
property int currentIndex: 0
property bool doesntEmbed: Qt.platform.os === "android"
|| Qt.platform.os === "linux"
|| Qt.platform.os === "osx"
|| Qt.platform.os === "unix"
|| Qt.platform.os === "windows"
FontLoader {
id: regular
source: doesntEmbed ? "" : "Roboto/Roboto-Regular.ttf"
}
height: 38
horizontalPadding: 16
verticalPadding: 8
text: modelData
contentItem: Text {
text: button.text
color: index == currentIndex ? "white" : "#066ac9"
font {
family: doesntEmbed ? "Roboto" : regular.name
pointSize: 15
}
}
background: Rectangle {
color: index == currentIndex ? "#066ac9" : "transparent"
radius: 5.2
}
}
|