Skip to content

Commit

Permalink
WIP: Show default kit in drawer button
Browse files Browse the repository at this point in the history
TODO:
- Make prettier
- Refresh on name changes
  • Loading branch information
Vogtinator committed Nov 4, 2022
1 parent 00a1fb3 commit afb6de6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 9 deletions.
34 changes: 25 additions & 9 deletions qml/DrawerButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Firebird.UIComponents 1.0
Rectangle {
property alias icon: image.source
property alias title: label.text
property alias subtitle: subtitleLabel.text
property alias borderTopVisible: borderTop.visible
property alias borderBottomVisible: borderBottom.visible
property bool disabled: false
Expand Down Expand Up @@ -76,19 +77,34 @@ Rectangle {
fillMode: Image.PreserveAspectFit
}

FBLabel {
id: label

color: "black"

x: image.x + image.width + spacing

ColumnLayout {
anchors {
margins: spacing
left: image.right
top: parent.top
bottom: parent.bottom
right: parent.right
}

font.pixelSize: TextMetrics.title2Size
verticalAlignment: Text.AlignVCenter
FBLabel {
id: label

color: "black"

font.pixelSize: TextMetrics.title2Size
verticalAlignment: Text.AlignVCenter
Layout.fillWidth: true
Layout.fillHeight: true
}

FBLabel {
id: subtitleLabel
elide: "ElideRight"

font.pixelSize: TextMetrics.normalSize * 0.8
Layout.fillWidth: true
Layout.fillHeight: true
visible: text !== ""
}
}
}
1 change: 1 addition & 0 deletions qml/MobileUIDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ Rectangle {
id: restartButton

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

onClicked: {
Expand Down

0 comments on commit afb6de6

Please sign in to comment.