mirror of
https://invent.kde.org/marcoa/a-la-karte.git
synced 2026-02-09 13:03:09 +00:00
Initial release of A-La-Karte, a unified game launcher for KDE Plasma. Includes the QML UI, platform importers, AppStream metadata, icons, and developer documentation.
83 lines
2.4 KiB
QML
83 lines
2.4 KiB
QML
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
// SPDX-FileCopyrightText: 2024 A-La-Karte Contributors
|
|
|
|
import QtQuick
|
|
import QtQuick.Controls as QQC2
|
|
import QtQuick.Layouts
|
|
import org.kde.kirigami as Kirigami
|
|
import org.kde.alakarte
|
|
|
|
QQC2.ToolBar {
|
|
id: searchHeader
|
|
|
|
property alias searchField: searchFieldContainer.data
|
|
property int currentSortMode: 0
|
|
|
|
signal searchChanged(string text)
|
|
signal sortChanged(int mode)
|
|
|
|
leftPadding: 0
|
|
rightPadding: 0
|
|
topPadding: Kirigami.Units.smallSpacing
|
|
bottomPadding: Kirigami.Units.smallSpacing
|
|
|
|
contentItem: RowLayout {
|
|
spacing: Kirigami.Units.mediumSpacing
|
|
|
|
Item {
|
|
id: searchFieldContainer
|
|
Layout.fillWidth: true
|
|
Layout.preferredHeight: children.length > 0 ? children[0].implicitHeight : 0
|
|
}
|
|
|
|
QQC2.ToolButton {
|
|
icon.name: "view-sort"
|
|
text: i18n("Sort")
|
|
display: QQC2.AbstractButton.IconOnly
|
|
|
|
hoverEnabled: true
|
|
icon.width: Kirigami.Units.iconSizes.smallMedium
|
|
icon.height: Kirigami.Units.iconSizes.smallMedium
|
|
|
|
QQC2.ToolTip.text: text
|
|
QQC2.ToolTip.visible: hovered
|
|
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
|
|
|
|
onClicked: sortMenu.open()
|
|
|
|
QQC2.Menu {
|
|
id: sortMenu
|
|
|
|
QQC2.MenuItem {
|
|
text: i18n("Last Played")
|
|
checkable: true
|
|
checked: searchHeader.currentSortMode === 0
|
|
onTriggered: {
|
|
searchHeader.currentSortMode = 0
|
|
searchHeader.sortChanged(0)
|
|
}
|
|
}
|
|
|
|
QQC2.MenuItem {
|
|
text: i18n("Name")
|
|
checkable: true
|
|
checked: searchHeader.currentSortMode === 1
|
|
onTriggered: {
|
|
searchHeader.currentSortMode = 1
|
|
searchHeader.sortChanged(1)
|
|
}
|
|
}
|
|
|
|
QQC2.MenuItem {
|
|
text: i18n("Play Time")
|
|
checkable: true
|
|
checked: searchHeader.currentSortMode === 2
|
|
onTriggered: {
|
|
searchHeader.currentSortMode = 2
|
|
searchHeader.sortChanged(2)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|