Skip to content

Commit 13df5b8

Browse files
committed
WIP: Show default kit in drawer button
TODO: - Make prettier - Refresh on name changes
1 parent a33cf2f commit 13df5b8

File tree

2 files changed

+26
-9
lines changed

2 files changed

+26
-9
lines changed

qml/DrawerButton.qml

+25-9
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import Firebird.UIComponents 1.0
66
Rectangle {
77
property alias icon: image.source
88
property alias title: label.text
9+
property alias subtitle: subtitleLabel.text
910
property alias borderTopVisible: borderTop.visible
1011
property alias borderBottomVisible: borderBottom.visible
1112
property bool disabled: false
@@ -76,19 +77,34 @@ Rectangle {
7677
fillMode: Image.PreserveAspectFit
7778
}
7879

79-
FBLabel {
80-
id: label
81-
82-
color: "black"
83-
84-
x: image.x + image.width + spacing
85-
80+
ColumnLayout {
8681
anchors {
82+
margins: spacing
83+
left: image.right
8784
top: parent.top
8885
bottom: parent.bottom
86+
right: parent.right
8987
}
9088

91-
font.pixelSize: TextMetrics.title2Size
92-
verticalAlignment: Text.AlignVCenter
89+
FBLabel {
90+
id: label
91+
92+
color: "black"
93+
94+
font.pixelSize: TextMetrics.title2Size
95+
verticalAlignment: Text.AlignVCenter
96+
Layout.fillWidth: true
97+
Layout.fillHeight: true
98+
}
99+
100+
FBLabel {
101+
id: subtitleLabel
102+
elide: "ElideRight"
103+
104+
font.pixelSize: TextMetrics.normalSize * 0.8
105+
Layout.fillWidth: true
106+
Layout.fillHeight: true
107+
visible: text !== ""
108+
}
93109
}
94110
}

qml/MobileUIDrawer.qml

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Rectangle {
4040
id: restartButton
4141

4242
title: qsTr("Start")
43+
subtitle: qsTr("Kit: ") + Emu.kits.getDataRow(Emu.kitIndexForID(Emu.defaultKit), KitModel.NameRole)
4344
icon: "qrc:/icons/resources/icons/edit-bomb.png"
4445

4546
onClicked: {

0 commit comments

Comments
 (0)