Add Menubar

This commit is contained in:
reionwong 2021-06-23 17:29:47 +08:00
parent 129a2fcc45
commit 378e850c30
6 changed files with 136 additions and 17 deletions

View file

@ -34,7 +34,7 @@
inkscape:pageopacity="0" inkscape:pageopacity="0"
inkscape:pageshadow="2" inkscape:pageshadow="2"
inkscape:window-width="2160" inkscape:window-width="2160"
inkscape:window-height="1221" inkscape:window-height="1349"
id="namedview9" id="namedview9"
showgrid="false" showgrid="false"
inkscape:zoom="33.409091" inkscape:zoom="33.409091"
@ -43,7 +43,8 @@
inkscape:window-x="0" inkscape:window-x="0"
inkscape:window-y="42" inkscape:window-y="42"
inkscape:window-maximized="1" inkscape:window-maximized="1"
inkscape:current-layer="svg7" /> inkscape:current-layer="svg7"
inkscape:document-rotation="0" />
<defs <defs
id="defs3"> id="defs3">
<style <style
@ -52,8 +53,8 @@
</defs> </defs>
<path <path
class="ColorScheme-Text" class="ColorScheme-Text"
d="m11 4.0058c-0.12781 0-0.25558 0.04855-0.35352 0.14648l-7.0703 7.0723c-0.19587 0.19587-0.19587 0.51116 0 0.70703s0.51116 0.19587 0.70703 0l0.7168-0.7168v5.7852c0 1.108 0.892 2 2 2h8c1.108 0 2-0.892 2-2v-5.7852l0.7168 0.7168c0.19587 0.19587 0.51116 0.19587 0.70703 0s0.19587-0.51116 0-0.70703l-7.0703-7.0723c-0.09793-0.097934-0.22571-0.14648-0.35352-0.14648zm0 1.209 5 5v6.7852c0 0.554-0.446 1-1 1h-2v-3c0-1.108-0.892-2-2-2s-2 0.892-2 2v3h-2c-0.554 0-1-0.446-1-1v-6.7852z" d="m 10.999989,3.077802 c -0.135057,0 -0.270072,0.051303 -0.373565,0.1547856 L 3.1552319,10.705893 c -0.206976,0.206976 -0.206976,0.540144 0,0.74712 0.206976,0.206976 0.5401432,0.206976 0.7471193,0 L 4.6597944,10.69557 v 6.113226 c 0,1.170824 0.9425772,2.113402 2.1134018,2.113402 h 8.4536068 c 1.170825,0 2.113402,-0.942578 2.113402,-2.113402 V 10.69557 l 0.757443,0.757443 c 0.206976,0.206976 0.540143,0.206976 0.747119,0 0.206977,-0.206976 0.206977,-0.540144 0,-0.74712 L 11.373575,3.2325876 C 11.270092,3.1291006 11.135067,3.077802 11.00001,3.077802 Z m 0,1.2775514 5.283505,5.2835046 v 7.169927 c 0,0.585412 -0.471289,1.056701 -1.056701,1.056701 h -2.113402 v -3.170103 c 0,-1.170824 -0.942577,-2.113402 -2.113402,-2.113402 -1.1708246,0 -2.1134015,0.942578 -2.1134015,2.113402 v 3.170103 H 6.7731857 c -0.5854124,0 -1.056701,-0.471289 -1.056701,-1.056701 V 9.638858 Z"
fill="currentColor" fill="currentColor"
id="path5" id="path5"
style="fill:#ffffff;fill-opacity:1" /> style="fill:#ffffff;fill-opacity:1;stroke-width:1.0567" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -12,7 +12,7 @@
version="1.1" version="1.1"
id="svg7" id="svg7"
sodipodi:docname="folder-download.svg" sodipodi:docname="folder-download.svg"
inkscape:version="1.0.1 (3bc2e813f5, 2020-09-07)"> inkscape:version="1.0.2 (e86c870879, 2021-01-15)">
<metadata <metadata
id="metadata11"> id="metadata11">
<rdf:RDF> <rdf:RDF>
@ -34,16 +34,17 @@
inkscape:pageopacity="0" inkscape:pageopacity="0"
inkscape:pageshadow="2" inkscape:pageshadow="2"
inkscape:window-width="2160" inkscape:window-width="2160"
inkscape:window-height="1304" inkscape:window-height="1349"
id="namedview9" id="namedview9"
showgrid="false" showgrid="false"
inkscape:zoom="33.409091" inkscape:zoom="33.409091"
inkscape:cx="11" inkscape:cx="11"
inkscape:cy="11" inkscape:cy="11"
inkscape:window-x="0" inkscape:window-x="0"
inkscape:window-y="0" inkscape:window-y="42"
inkscape:window-maximized="1" inkscape:window-maximized="1"
inkscape:current-layer="svg7" /> inkscape:current-layer="svg7"
inkscape:document-rotation="0" />
<defs <defs
id="defs3"> id="defs3">
<style <style
@ -52,7 +53,7 @@
</defs> </defs>
<path <path
class="ColorScheme-Text" class="ColorScheme-Text"
d="m 11,3 a 8,8 0 0 0 -8,8 8,8 0 0 0 8,8 8,8 0 0 0 8,-8 8,8 0 0 0 -8,-8 z m 0,1.0666667 A 6.9333333,6.9333333 0 0 1 17.933333,11 6.9333333,6.9333333 0 0 1 11,17.933333 6.9333333,6.9333333 0 0 1 4.0666667,11 6.9333333,6.9333333 0 0 1 11,4.0666667 Z m 0,3.2 c -0.295467,0 -0.533333,0.2378666 -0.533333,0.5333333 v 5.112533 L 9.11456,11.560427 c -0.208928,-0.208928 -0.5452373,-0.208928 -0.7541653,0 -0.208928,0.208928 -0.208928,0.545237 0,0.754165 l 2.2625063,2.262507 c 0.05014,0.05014 0.110123,0.08968 0.177088,0.116672 0.128363,0.05223 0.271638,0.05223 0.4,0 0.06697,-0.02699 0.126934,-0.06652 0.177088,-0.116672 l 2.262507,-2.262507 c 0.208928,-0.208928 0.208928,-0.545237 0,-0.754165 -0.208928,-0.208928 -0.545237,-0.208928 -0.754165,0 l -1.352107,1.352106 V 7.8 c 0,-0.2954667 -0.237867,-0.5333333 -0.533333,-0.5333333 z" d="m 11,3 a 8,8 0 0 0 -8,8 8,8 0 0 0 8,8 8,8 0 0 0 8,-8 8,8 0 0 0 -8,-8 z m 0,1.0666667 A 6.9333333,6.9333333 0 0 1 17.933333,11 6.9333333,6.9333333 0 0 1 11,17.933333 6.9333333,6.9333333 0 0 1 4.0666667,11 6.9333333,6.9333333 0 0 1 11,4.0666667 Z m 0,3.2 c -0.295467,0 -0.533333,0.2378666 -0.533333,0.5333333 v 5.112533 L 9.11456,11.560427 c -0.208928,-0.208928 -0.5452371,-0.208928 -0.7541651,0 -0.208928,0.208928 -0.208928,0.545237 0,0.754165 l 2.2625061,2.262507 c 0.05014,0.05014 0.110123,0.08968 0.177088,0.116672 0.128363,0.05223 0.271638,0.05223 0.4,0 0.06697,-0.02699 0.126934,-0.06652 0.177088,-0.116672 l 2.262507,-2.262507 c 0.208928,-0.208928 0.208928,-0.545237 0,-0.754165 -0.208928,-0.208928 -0.545237,-0.208928 -0.754165,0 l -1.352107,1.352106 V 7.8 c 0,-0.2954667 -0.237867,-0.5333333 -0.533333,-0.5333333 z"
fill="currentColor" fill="currentColor"
id="path5" id="path5"
style="stroke-width:1.06667" /> style="stroke-width:1.06667" />

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -1,6 +1,60 @@
<svg width="22" height="22" version="1.1" xmlns="http://www.w3.org/2000/svg"> <?xml version="1.0" encoding="UTF-8" standalone="no"?>
<defs> <svg
<style id="current-color-scheme" type="text/css">.ColorScheme-Text { color:#363636; }</style> xmlns:dc="http://purl.org/dc/elements/1.1/"
</defs> xmlns:cc="http://creativecommons.org/ns#"
<path class="ColorScheme-Text" d="m11 4.0058c-0.12781 0-0.25558 0.04855-0.35352 0.14648l-7.0703 7.0723c-0.19587 0.19587-0.19587 0.51116 0 0.70703s0.51116 0.19587 0.70703 0l0.7168-0.7168v5.7852c0 1.108 0.892 2 2 2h8c1.108 0 2-0.892 2-2v-5.7852l0.7168 0.7168c0.19587 0.19587 0.51116 0.19587 0.70703 0s0.19587-0.51116 0-0.70703l-7.0703-7.0723c-0.09793-0.097934-0.22571-0.14648-0.35352-0.14648zm0 1.209 5 5v6.7852c0 0.554-0.446 1-1 1h-2v-3c0-1.108-0.892-2-2-2s-2 0.892-2 2v3h-2c-0.554 0-1-0.446-1-1v-6.7852z" fill="currentColor"/> xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="22"
height="22"
version="1.1"
id="svg7"
sodipodi:docname="folder-home.svg"
inkscape:version="1.0.2 (e86c870879, 2021-01-15)">
<metadata
id="metadata11">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2160"
inkscape:window-height="1349"
id="namedview9"
showgrid="false"
inkscape:zoom="33.409091"
inkscape:cx="11"
inkscape:cy="11"
inkscape:window-x="0"
inkscape:window-y="42"
inkscape:window-maximized="1"
inkscape:current-layer="svg7" />
<defs
id="defs3">
<style
id="current-color-scheme"
type="text/css">.ColorScheme-Text { color:#363636; }</style>
</defs>
<path
class="ColorScheme-Text"
d="m 10.999989,3.077802 c -0.135057,0 -0.270072,0.051303 -0.373565,0.1547856 L 3.1552319,10.705893 c -0.206976,0.206976 -0.206976,0.540144 0,0.74712 0.206976,0.206976 0.5401432,0.206976 0.7471193,0 L 4.6597944,10.69557 v 6.113226 c 0,1.170824 0.9425772,2.113402 2.1134018,2.113402 h 8.4536068 c 1.170825,0 2.113402,-0.942578 2.113402,-2.113402 V 10.69557 l 0.757443,0.757443 c 0.206976,0.206976 0.540143,0.206976 0.747119,0 0.206977,-0.206976 0.206977,-0.540144 0,-0.74712 L 11.373575,3.2325876 C 11.270092,3.1291006 11.135067,3.077802 11.00001,3.077802 Z m 0,1.2775514 5.283505,5.2835046 v 7.169927 c 0,0.585412 -0.471289,1.056701 -1.056701,1.056701 h -2.113402 v -3.170103 c 0,-1.170824 -0.942577,-2.113402 -2.113402,-2.113402 -1.1708246,0 -2.1134015,0.942578 -2.1134015,2.113402 v 3.170103 H 6.7731857 c -0.5854124,0 -1.056701,-0.471289 -1.056701,-1.056701 V 9.638858 Z"
fill="currentColor"
id="path5"
style="stroke-width:1.0567" />
</svg> </svg>

Before

Width:  |  Height:  |  Size: 726 B

After

Width:  |  Height:  |  Size: 2.5 KiB

View file

@ -20,6 +20,7 @@
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12 import QtQuick.Layouts 1.12
import Qt.labs.platform 1.0
import Cutefish.FileManager 1.0 as FM import Cutefish.FileManager 1.0 as FM
import FishUI 1.0 as FishUI import FishUI 1.0 as FishUI
@ -40,6 +41,51 @@ Item {
_viewLoader.item.forceActiveFocus() _viewLoader.item.forceActiveFocus()
} }
// Global Menu
MenuBar {
id: appMenu
Menu {
title: qsTr("File")
MenuItem {
text: qsTr("New Folder")
onTriggered: dirModel.newFolder()
}
MenuSeparator {}
MenuItem {
text: qsTr("Properties")
onTriggered: dirModel.openPropertiesDialog()
}
MenuSeparator {}
MenuItem {
text: qsTr("Quit")
onTriggered: Qt.quit()
}
}
Menu {
title: qsTr("Edit")
MenuItem {
text: qsTr("Select All")
onTriggered: dirModel.selectAll()
}
}
Menu {
title: qsTr("Help")
MenuItem {
text: qsTr("About")
}
}
}
Rectangle { Rectangle {
id: _background id: _background
anchors.fill: parent anchors.fill: parent

View file

@ -79,8 +79,16 @@ ListView {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
radius: FishUI.Theme.smallRadius radius: FishUI.Theme.mediumRadius
color: _mouseArea.containsMouse && !checked ? _item.hoveredColor : "transparent" color: _mouseArea.pressed ? Qt.rgba(FishUI.Theme.textColor.r,
FishUI.Theme.textColor.g,
FishUI.Theme.textColor.b, FishUI.Theme.darkMode ? 0.05 : 0.1) :
_mouseArea.containsMouse || checked ? Qt.rgba(FishUI.Theme.textColor.r,
FishUI.Theme.textColor.g,
FishUI.Theme.textColor.b, FishUI.Theme.darkMode ? 0.1 : 0.05) :
"transparent"
smooth: true
} }
RowLayout { RowLayout {
@ -96,6 +104,7 @@ ListView {
// source: model.iconPath ? model.iconPath : "image://icontheme/" + model.iconName // source: model.iconPath ? model.iconPath : "image://icontheme/" + model.iconName
source: "qrc:/images/" + (FishUI.Theme.darkMode || _item.checked ? "dark/" : "light/") + model.iconPath source: "qrc:/images/" + (FishUI.Theme.darkMode || _item.checked ? "dark/" : "light/") + model.iconPath
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
smooth: true
} }
Label { Label {

View file

@ -34,8 +34,16 @@ FishUI.Window {
visible: true visible: true
title: qsTr("File Manager") title: qsTr("File Manager")
header.height: 35 + FishUI.Units.smallSpacing * 3 header.height: 36 + FishUI.Units.largeSpacing
background.color: FishUI.Theme.darkMode ? "#262626" : "#F3F4F9" background.color: FishUI.Theme.darkMode ? "#262626" : "#F3F4F9"
background.opacity: 0.95
FishUI.WindowBlur {
view: root
geometry: Qt.rect(root.x, root.y, root.width, root.height)
windowRadius: root.background.radius
enabled: true
}
property QtObject settings: GlobalSettings { } property QtObject settings: GlobalSettings { }