punktdateien/kde/plasma/plasmoids/com.siezi.plasma.mpdWidget/contents/ui/Components/Elements/GlobalNav.qml

45 lines
1.3 KiB
QML
Raw Normal View History

2024-02-14 21:14:16 +01:00
import QtQuick 2.15
import QtQuick.Controls 2.3 as QQC2
import QtQuick.Layouts 1.15
import "../../Mpdw.js" as Mpdw
RowLayout {
Repeater {
model: [
{
icon: Mpdw.icons.placeQueue,
page: queuePage,
shortcut: queuePage.globalShortcut,
text: qsTr("Queue"),
tooltip: qsTr("Show Queue")
},
{
icon: Mpdw.icons.placeArtist,
page: albumartistsPage,
shortcut: albumartistsPage.globalShortcut,
text: qsTr("Artists"),
tooltip: qsTr("Show Artists")
},
{
icon: Mpdw.icons.placePlaylist,
page: playlistPage,
shortcut: playlistPage.globalShortcut,
text: qsTr("Playlists"),
tooltip: qsTr("Show Playlists"),
}
]
QQC2.ToolButton {
icon.name: modelData.icon
text: appWindow.narrowLayout ? "" : modelData.text
checkable: true
checked: modelData.page.visible
onClicked: appWindow.showPage(modelData.page)
QQC2.ToolTip {
text: modelData.tooltip + " (" + modelData.shortcut + ")"
}
}
}
}