fix(navigation): restore open media cascade
cx
This commit is contained in:
1 file changed
+8
-4
@@ -171,6 +171,7 @@ Item {
|
|||||||
? QbzLocal.localEphemeralLabel
|
? QbzLocal.localEphemeralLabel
|
||||||
: (QbzSession.offline ? nav.trs("Open media") : nav.trs("Open")),
|
: (QbzSession.offline ? nav.trs("Open media") : nav.trs("Open")),
|
||||||
"icon": "folder-open", "view": "", "tab": "", "enabled": true,
|
"icon": "folder-open", "view": "", "tab": "", "enabled": true,
|
||||||
|
"hasSubmenu": true,
|
||||||
"submenu": nav.openMediaEntries() }
|
"submenu": nav.openMediaEntries() }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@@ -378,6 +379,9 @@ Item {
|
|||||||
property var entry: null
|
property var entry: null
|
||||||
property int rowIndex: -1
|
property int rowIndex: -1
|
||||||
readonly property bool rowEnabled: entry && entry.enabled !== false
|
readonly property bool rowEnabled: entry && entry.enabled !== false
|
||||||
|
// QVariantList conversion makes runtime array introspection unreliable.
|
||||||
|
// The catalog explicitly marks the sole cascading entry instead.
|
||||||
|
readonly property bool hasSubmenu: !!(entry && entry.hasSubmenu === true)
|
||||||
|
|
||||||
width: parent ? parent.width : 0
|
width: parent ? parent.width : 0
|
||||||
height: 32
|
height: 32
|
||||||
@@ -402,7 +406,7 @@ Item {
|
|||||||
height: parent.height
|
height: parent.height
|
||||||
width: parent.width
|
width: parent.width
|
||||||
- (row.entry && row.entry.icon !== "" ? 23 : 0)
|
- (row.entry && row.entry.icon !== "" ? 23 : 0)
|
||||||
- (row.entry && row.entry.submenu ? 19 : 0)
|
- (row.hasSubmenu ? 19 : 0)
|
||||||
text: row.entry ? row.entry.label : ""
|
text: row.entry ? row.entry.label : ""
|
||||||
color: theme.textSecondary
|
color: theme.textSecondary
|
||||||
font.pixelSize: 13
|
font.pixelSize: 13
|
||||||
@@ -410,7 +414,7 @@ Item {
|
|||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
QbzIcon {
|
QbzIcon {
|
||||||
visible: row.entry && row.entry.submenu
|
visible: row.hasSubmenu
|
||||||
width: visible ? 11 : 0
|
width: visible ? 11 : 0
|
||||||
height: 11
|
height: 11
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
@@ -426,7 +430,7 @@ Item {
|
|||||||
hoverEnabled: row.rowEnabled
|
hoverEnabled: row.rowEnabled
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (row.entry && row.entry.submenu)
|
if (row.hasSubmenu)
|
||||||
panel.openCascade(row, row.entry)
|
panel.openCascade(row, row.entry)
|
||||||
else
|
else
|
||||||
nav.activate(row.entry)
|
nav.activate(row.entry)
|
||||||
@@ -437,7 +441,7 @@ Item {
|
|||||||
onContainsMouseChanged: {
|
onContainsMouseChanged: {
|
||||||
if (containsMouse) {
|
if (containsMouse) {
|
||||||
panel.hoveredRow = row.rowIndex
|
panel.hoveredRow = row.rowIndex
|
||||||
if (row.entry && row.entry.submenu)
|
if (row.hasSubmenu)
|
||||||
panel.openCascade(row, row.entry)
|
panel.openCascade(row, row.entry)
|
||||||
else
|
else
|
||||||
panel.scheduleCascadeClose()
|
panel.scheduleCascadeClose()
|
||||||
|
|||||||
Reference in new issue
Block a user