From 113d775b88858e34764fc74db33ca833f32f9e6d Mon Sep 17 00:00:00 2001 From: reionwong Date: Fri, 4 Sep 2026 11:09:06 -0400 Subject: [PATCH] fix(filemanager): use standard menu items in the view options menu --- qml/OptionsMenu.qml | 212 ++++---------------------------------------- 1 file changed, 19 insertions(+), 193 deletions(-) diff --git a/qml/OptionsMenu.qml b/qml/OptionsMenu.qml index 71b875f..a3334d9 100644 --- a/qml/OptionsMenu.qml +++ b/qml/OptionsMenu.qml @@ -26,220 +26,46 @@ FishUI.DesktopMenu { id: control FishUI.MenuItem { - Layout.fillWidth: true - - Image { - id: _gridIcon - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.leftMargin: FishUI.Units.largeSpacing - source: FishUI.Theme.darkMode ? "qrc:/images/dark/grid.svg" : "qrc:/images/light/grid.svg" - sourceSize: Qt.size(width, height) - width: 22 - height: width - smooth: false - } - - Text { - anchors.left: _gridIcon.right - anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: FishUI.Units.largeSpacing - text: qsTr("Icons") - color: FishUI.Theme.textColor - } - - Image { - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: FishUI.Units.largeSpacing * 1.5 - source: FishUI.Theme.darkMode ? "qrc:/images/dark/checked.svg" : "qrc:/images/light/checked.svg" - sourceSize: Qt.size(width, height) - width: 22 - height: width - visible: settings.viewMethod === 1 - smooth: false - } - + text: qsTr("Icons") + reservesCheckColumn: true + checked: settings.viewMethod === 1 onTriggered: settings.viewMethod = 1 } FishUI.MenuItem { - Layout.fillWidth: true - - Image { - id: _listIcon - anchors.verticalCenter: parent.verticalCenter - anchors.left: parent.left - anchors.leftMargin: FishUI.Units.largeSpacing - source: FishUI.Theme.darkMode ? "qrc:/images/dark/list.svg" : "qrc:/images/light/list.svg" - sourceSize: Qt.size(width, height) - width: 22 - height: width - smooth: false - } - - Text { - anchors.left: _listIcon.right - anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: FishUI.Units.largeSpacing - text: qsTr("List") - color: FishUI.Theme.textColor - } - - Image { - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: FishUI.Units.largeSpacing * 1.5 - source: FishUI.Theme.darkMode ? "qrc:/images/dark/checked.svg" : "qrc:/images/light/checked.svg" - sourceSize: Qt.size(width, height) - width: 22 - height: width - visible: settings.viewMethod === 0 - smooth: false - } - + text: qsTr("List") + reservesCheckColumn: true + checked: settings.viewMethod === 0 onTriggered: settings.viewMethod = 0 } - FishUI.MenuSeparator { - Layout.fillWidth: true - } + FishUI.MenuSeparator {} FishUI.MenuItem { - Layout.fillWidth: true - -// Image { -// id: orderByNameIcon -// anchors.verticalCenter: parent.verticalCenter -// anchors.left: parent.left -// anchors.leftMargin: FishUI.Units.largeSpacing -// source: FishUI.Theme.darkMode ? "qrc:/images/dark/order_by_name.svg" : "qrc:/images/light/order_by_name.svg" -// sourceSize: Qt.size(width, height) -// width: 22 -// height: width -// smooth: false -// } - - Text { - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: FishUI.Units.largeSpacing - text: qsTr("Name") - color: FishUI.Theme.textColor - } - - Image { - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: FishUI.Units.largeSpacing * 1.5 - source: FishUI.Theme.darkMode ? "qrc:/images/dark/checked.svg" : "qrc:/images/light/checked.svg" - sourceSize: Qt.size(width, height) - height: width - width: 22 - visible: settings.sortMode === 0 - smooth: false - } - + text: qsTr("Name") + reservesCheckColumn: true + checked: settings.sortMode === 0 onTriggered: settings.sortMode = 0 } FishUI.MenuItem { - Layout.fillWidth: true - -// Image { -// id: orderByDateIcon -// anchors.verticalCenter: parent.verticalCenter -// anchors.left: parent.left -// anchors.leftMargin: FishUI.Units.largeSpacing -// source: FishUI.Theme.darkMode ? "qrc:/images/dark/date.svg" : "qrc:/images/light/date.svg" -// sourceSize: Qt.size(width, height) -// width: 22 -// height: width -// smooth: false -// } - - Text { - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: FishUI.Units.largeSpacing - text: qsTr("Date") - color: FishUI.Theme.textColor - } - - Image { - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: FishUI.Units.largeSpacing * 1.5 - source: FishUI.Theme.darkMode ? "qrc:/images/dark/checked.svg" : "qrc:/images/light/checked.svg" - sourceSize: Qt.size(width, height) - width: 22 - height: width - visible: settings.sortMode === 2 - smooth: false - } - + text: qsTr("Date") + reservesCheckColumn: true + checked: settings.sortMode === 2 onTriggered: settings.sortMode = 2 } FishUI.MenuItem { - Text { - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: FishUI.Units.largeSpacing - text: qsTr("Type") - color: FishUI.Theme.textColor - } - - Image { - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: FishUI.Units.largeSpacing * 1.5 - source: FishUI.Theme.darkMode ? "qrc:/images/dark/checked.svg" : "qrc:/images/light/checked.svg" - sourceSize: Qt.size(width, height) - width: 22 - height: width - visible: settings.sortMode === 6 - smooth: false - } - + text: qsTr("Type") + reservesCheckColumn: true + checked: settings.sortMode === 6 onTriggered: settings.sortMode = 6 } FishUI.MenuItem { - Layout.fillWidth: true - -// Image { -// id: orderBySizeIcon -// anchors.verticalCenter: parent.verticalCenter -// anchors.left: parent.left -// anchors.leftMargin: FishUI.Units.largeSpacing -// source: FishUI.Theme.darkMode ? "qrc:/images/dark/size.svg" : "qrc:/images/light/size.svg" -// sourceSize: Qt.size(width, height) -// width: 22 -// height: width -// smooth: false -// } - - Text { - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: FishUI.Units.largeSpacing - text: qsTr("Size") - color: FishUI.Theme.textColor - } - - Image { - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: FishUI.Units.largeSpacing * 1.5 - source: FishUI.Theme.darkMode ? "qrc:/images/dark/checked.svg" : "qrc:/images/light/checked.svg" - sourceSize: Qt.size(width, height) - width: 22 - height: width - visible: settings.sortMode === 1 - smooth: false - } - + text: qsTr("Size") + reservesCheckColumn: true + checked: settings.sortMode === 1 onTriggered: settings.sortMode = 1 } }