Commit 2134b048 authored by Nate Graham's avatar Nate Graham
Browse files

Move ViewSelectorDelegate code into ViewSelector

At this point it's a single simple library component item that's only
used on no place. There's no benefit to having it in a separate file.
parent 56cd2fec
Pipeline #147076 passed with stage
in 7 minutes and 46 seconds
......@@ -410,7 +410,6 @@ if (Qt5Quick_FOUND AND Qt5Widgets_FOUND)
qml/ContextView.qml
qml/ContentView.qml
qml/ViewSelector.qml
qml/ViewSelectorDelegate.qml
qml/DataGridView.qml
qml/DataListView.qml
qml/DurationSlider.qml
......
......@@ -43,15 +43,28 @@ ScrollView {
keyNavigationEnabled: true
interactive: true
delegate: ViewSelectorDelegate {
id: entry
delegate: Kirigami.BasicListItem {
height: Kirigami.Units.iconSizes.smallMedium + 3 * Kirigami.Units.smallSpacing
width: viewModeView.width
padding: Kirigami.Units.smallSpacing
separatorVisible: false
alternatingBackground: false
icon: model.image
label: model.display
Accessible.role: Accessible.ListItem
Accessible.description: model.display
Accessible.name: model.display
ToolTip.visible: labelItem.truncated && hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.text: model.display
onClicked: {
viewModeView.currentIndex = index
entry.forceActiveFocus()
forceActiveFocus()
}
}
......
/*
SPDX-FileCopyrightText: 2016 (c) Matthieu Gallien <matthieu_gallien@yahoo.fr>
SPDX-License-Identifier: LGPL-3.0-or-later
*/
import QtQuick 2.7
import QtQuick.Controls 2.2
import QtGraphicalEffects 1.0
import org.kde.kirigami 2.5 as Kirigami
Kirigami.BasicListItem {
Accessible.role: Accessible.ListItem
Accessible.description: model.display
Accessible.name: model.display
padding: Kirigami.Units.smallSpacing
separatorVisible: false
alternatingBackground: false
icon: model.image
label: model.display
ToolTip.visible: labelItem.truncated && hovered
ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval
ToolTip.text: model.display
}
......@@ -31,7 +31,6 @@
<file>qml/MediaTrackMetadataDelegate.qml</file>
<file>qml/MediaTrackMetadataForm.qml</file>
<file>qml/ImageWithFallback.qml</file>
<file>qml/ViewSelectorDelegate.qml</file>
<file>qml/HeaderFooterToolbar.qml</file>
<file>qml/TracksDiscHeader.qml</file>
<file>qml/NativeMenuItemFromAction.qml</file>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment