filemanager/qml/OptionsMenu.qml

246 lines
7.9 KiB
QML
Raw Permalink Normal View History

2021-05-24 04:01:26 -07:00
/*
* Copyright (C) 2021 CutefishOS Team.
*
* Author: revenmartin <revenmartin@gmail.com>
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
2021-04-19 01:07:58 -07:00
import QtQuick 2.12
import QtQuick.Layouts 1.12
import QtQuick.Controls 2.12
import FishUI 1.0 as FishUI
FishUI.DesktopMenu {
id: control
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"
2021-08-07 18:29:04 -07:00
sourceSize: Qt.size(width, height)
2021-04-19 01:07:58 -07:00
width: 22
height: width
2021-08-07 18:29:04 -07:00
smooth: false
2021-04-19 01:07:58 -07:00
}
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"
2021-08-07 18:29:04 -07:00
sourceSize: Qt.size(width, height)
2021-04-19 01:07:58 -07:00
width: 22
height: width
visible: settings.viewMethod === 1
2021-08-07 18:29:04 -07:00
smooth: false
2021-04-19 01:07:58 -07:00
}
onTriggered: settings.viewMethod = 1
}
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"
2021-08-07 18:29:04 -07:00
sourceSize: Qt.size(width, height)
2021-04-19 01:07:58 -07:00
width: 22
height: width
2021-08-07 18:29:04 -07:00
smooth: false
2021-04-19 01:07:58 -07:00
}
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"
2021-08-07 18:29:04 -07:00
sourceSize: Qt.size(width, height)
2021-04-19 01:07:58 -07:00
width: 22
height: width
visible: settings.viewMethod === 0
2021-08-07 18:29:04 -07:00
smooth: false
2021-04-19 01:07:58 -07:00
}
onTriggered: settings.viewMethod = 0
}
2021-08-31 13:39:44 -07:00
MenuSeparator {
Layout.fillWidth: true
}
2021-04-19 01:07:58 -07:00
MenuItem {
Layout.fillWidth: true
2021-08-31 13:39:44 -07:00
// 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
// }
2021-04-19 01:07:58 -07:00
Text {
2021-08-31 13:39:44 -07:00
anchors.left: parent.left
2021-04-19 01:07:58 -07:00
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
2021-08-31 13:39:44 -07:00
source: FishUI.Theme.darkMode ? "qrc:/images/dark/checked.svg" : "qrc:/images/light/checked.svg"
2021-08-07 18:29:04 -07:00
sourceSize: Qt.size(width, height)
2021-04-19 01:07:58 -07:00
height: width
width: 22
2021-08-31 13:39:44 -07:00
visible: settings.sortMode === 0
2021-08-07 18:29:04 -07:00
smooth: false
2021-04-19 01:07:58 -07:00
}
2021-08-31 13:39:44 -07:00
onTriggered: settings.sortMode = 0
2021-04-19 01:07:58 -07:00
}
MenuItem {
Layout.fillWidth: true
2021-08-31 13:39:44 -07:00
// 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
// }
2021-04-19 01:07:58 -07:00
Text {
2021-08-31 13:39:44 -07:00
anchors.left: parent.left
2021-04-19 01:07:58 -07:00
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
2021-08-31 13:39:44 -07:00
source: FishUI.Theme.darkMode ? "qrc:/images/dark/checked.svg" : "qrc:/images/light/checked.svg"
2021-08-07 18:29:04 -07:00
sourceSize: Qt.size(width, height)
2021-04-19 01:07:58 -07:00
width: 22
height: width
2021-08-31 13:39:44 -07:00
visible: settings.sortMode === 2
2021-08-07 18:29:04 -07:00
smooth: false
2021-04-19 01:07:58 -07:00
}
2021-08-31 13:39:44 -07:00
onTriggered: settings.sortMode = 2
2021-04-19 01:07:58 -07:00
}
MenuItem {
2021-08-31 13:39:44 -07:00
Text {
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: FishUI.Units.largeSpacing
text: qsTr("Type")
color: FishUI.Theme.textColor
}
2021-04-19 01:07:58 -07:00
Image {
anchors.verticalCenter: parent.verticalCenter
2021-08-31 13:39:44 -07:00
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"
2021-08-07 18:29:04 -07:00
sourceSize: Qt.size(width, height)
2021-04-19 01:07:58 -07:00
width: 22
height: width
2021-08-31 13:39:44 -07:00
visible: settings.sortMode === 6
2021-08-07 18:29:04 -07:00
smooth: false
2021-04-19 01:07:58 -07:00
}
2021-08-31 13:39:44 -07:00
onTriggered: settings.sortMode = 6
}
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
// }
2021-04-19 01:07:58 -07:00
Text {
2021-08-31 13:39:44 -07:00
anchors.left: parent.left
2021-04-19 01:07:58 -07:00
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
2021-08-31 13:39:44 -07:00
source: FishUI.Theme.darkMode ? "qrc:/images/dark/checked.svg" : "qrc:/images/light/checked.svg"
2021-08-07 18:29:04 -07:00
sourceSize: Qt.size(width, height)
2021-04-19 01:07:58 -07:00
width: 22
height: width
2021-08-31 13:39:44 -07:00
visible: settings.sortMode === 1
2021-08-07 18:29:04 -07:00
smooth: false
2021-04-19 01:07:58 -07:00
}
2021-08-31 13:39:44 -07:00
onTriggered: settings.sortMode = 1
2021-04-19 01:07:58 -07:00
}
}