diff --git a/CMakeLists.txt b/CMakeLists.txt index 82c642a..447c413 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,7 +12,7 @@ set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(Qt5 COMPONENTS Core DBus Quick LinguistTools REQUIRED) -find_package(MeuiKit REQUIRED) +find_package(FishUI REQUIRED) find_package(KF5KIO) find_package(KF5Solid) @@ -53,7 +53,7 @@ target_link_libraries(cutefish-filemanager KF5::KIOWidgets KF5::Solid - MeuiKit + FishUI ) file(GLOB TS_FILES translations/*.ts) diff --git a/qml/Controls/IconButton.qml b/qml/Controls/IconButton.qml index 99e3857..7786830 100644 --- a/qml/Controls/IconButton.qml +++ b/qml/Controls/IconButton.qml @@ -1,5 +1,5 @@ import QtQuick 2.12 -import MeuiKit 1.0 as Meui +import FishUI 1.0 as FishUI Item { id: control @@ -7,18 +7,18 @@ Item { height: 24 property alias source: _image.source - property color hoveredColor: Meui.Theme.darkMode ? Qt.lighter(Meui.Theme.backgroundColor, 1.1) - : Qt.darker(Meui.Theme.backgroundColor, 1.2) - property color pressedColor: Meui.Theme.darkMode ? Qt.lighter(Meui.Theme.backgroundColor, 1.2) - : Qt.darker(Meui.Theme.backgroundColor, 1.3) + property color hoveredColor: FishUI.Theme.darkMode ? Qt.lighter(FishUI.Theme.backgroundColor, 1.1) + : Qt.darker(FishUI.Theme.backgroundColor, 1.2) + property color pressedColor: FishUI.Theme.darkMode ? Qt.lighter(FishUI.Theme.backgroundColor, 1.2) + : Qt.darker(FishUI.Theme.backgroundColor, 1.3) signal clicked() Rectangle { id: _background anchors.fill: parent - radius: Meui.Theme.smallRadius - color: _mouseArea.pressed ? pressedColor : _mouseArea.containsMouse ? control.hoveredColor : Meui.Theme.backgroundColor + radius: FishUI.Theme.smallRadius + color: _mouseArea.pressed ? pressedColor : _mouseArea.containsMouse ? control.hoveredColor : FishUI.Theme.backgroundColor } Image { diff --git a/qml/Desktop/main.qml b/qml/Desktop/main.qml index 1dd61eb..f6ba0b3 100644 --- a/qml/Desktop/main.qml +++ b/qml/Desktop/main.qml @@ -4,7 +4,7 @@ import QtQuick.Layouts 1.12 import QtGraphicalEffects 1.0 import Cutefish.FileManager 1.0 -import MeuiKit 1.0 as Meui +import FishUI 1.0 as FishUI import "../" Item { @@ -48,7 +48,7 @@ Item { anchors.fill: parent source: parent color: "#000000" - opacity: Meui.Theme.darkMode && settings.dimsWallpaper ? 0.4 : 0.0 + opacity: FishUI.Theme.darkMode && settings.dimsWallpaper ? 0.4 : 0.0 Behavior on opacity { NumberAnimation { @@ -128,6 +128,8 @@ Item { dirModel.requestRename() else if (event.key === Qt.Key_A && event.modifiers & Qt.ControlModifier) dirModel.selectAll() + else if (event.key === Qt.Key_Delete) + dirModel.keyDeletePress() } } @@ -140,7 +142,7 @@ Item { width: 0 height: 0 z: 99999 - color: Meui.Theme.highlightColor + color: FishUI.Theme.highlightColor function close() { opacityAnimation.restart() diff --git a/qml/Dialogs/CreateFolderDialog.qml b/qml/Dialogs/CreateFolderDialog.qml index 6ba47fe..8b069ca 100644 --- a/qml/Dialogs/CreateFolderDialog.qml +++ b/qml/Dialogs/CreateFolderDialog.qml @@ -2,7 +2,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Window 2.12 import QtQuick.Layouts 1.12 -import MeuiKit 1.0 as Meui +import FishUI 1.0 as FishUI Window { id: control @@ -11,8 +11,8 @@ Window { flags: Qt.Dialog visible: true - width: 400 + Meui.Units.largeSpacing * 2 - height: _mainLayout.implicitHeight + Meui.Units.largeSpacing * 2 + width: 400 + FishUI.Units.largeSpacing * 2 + height: _mainLayout.implicitHeight + FishUI.Units.largeSpacing * 2 minimumWidth: width minimumHeight: height @@ -21,14 +21,14 @@ Window { Rectangle { anchors.fill: parent - color: Meui.Theme.backgroundColor + color: FishUI.Theme.backgroundColor } ColumnLayout { id: _mainLayout anchors.fill: parent - anchors.leftMargin: Meui.Units.largeSpacing - anchors.rightMargin: Meui.Units.largeSpacing + anchors.leftMargin: FishUI.Units.largeSpacing + anchors.rightMargin: FishUI.Units.largeSpacing spacing: 0 TextField { diff --git a/qml/Dialogs/PropertiesDialog.qml b/qml/Dialogs/PropertiesDialog.qml index 7ff9f38..f831ee6 100644 --- a/qml/Dialogs/PropertiesDialog.qml +++ b/qml/Dialogs/PropertiesDialog.qml @@ -2,7 +2,7 @@ import QtQuick 2.12 import QtQuick.Window 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import MeuiKit 1.0 as Meui +import FishUI 1.0 as FishUI Window { id: control @@ -13,7 +13,7 @@ Window { Rectangle { anchors.fill: parent - color: Meui.Theme.backgroundColor + color: FishUI.Theme.backgroundColor } onVisibleChanged: { @@ -45,14 +45,14 @@ Window { ColumnLayout { id: _mainLayout anchors.fill: parent - anchors.leftMargin: Meui.Units.largeSpacing * 2 - anchors.rightMargin: Meui.Units.largeSpacing * 2 - anchors.topMargin: Meui.Units.largeSpacing - anchors.bottomMargin: Meui.Units.largeSpacing - spacing: Meui.Units.largeSpacing + anchors.leftMargin: FishUI.Units.largeSpacing * 2 + anchors.rightMargin: FishUI.Units.largeSpacing * 2 + anchors.topMargin: FishUI.Units.largeSpacing + anchors.bottomMargin: FishUI.Units.largeSpacing + spacing: FishUI.Units.largeSpacing RowLayout { - spacing: Meui.Units.largeSpacing * 2 + spacing: FishUI.Units.largeSpacing * 2 Image { width: 64 @@ -73,8 +73,8 @@ Window { GridLayout { columns: 2 - columnSpacing: Meui.Units.largeSpacing - rowSpacing: Meui.Units.largeSpacing + columnSpacing: FishUI.Units.largeSpacing + rowSpacing: FishUI.Units.largeSpacing Layout.alignment: Qt.AlignTop onHeightChanged: updateWindowSize() @@ -83,7 +83,7 @@ Window { Label { text: qsTr("Type:") Layout.alignment: Qt.AlignRight - color: Meui.Theme.disabledTextColor + color: FishUI.Theme.disabledTextColor visible: mimeType.visible } @@ -96,7 +96,7 @@ Window { Label { text: qsTr("Location:") Layout.alignment: Qt.AlignRight - color: Meui.Theme.disabledTextColor + color: FishUI.Theme.disabledTextColor } Label { @@ -107,7 +107,7 @@ Window { Label { text: qsTr("Size:") Layout.alignment: Qt.AlignRight - color: Meui.Theme.disabledTextColor + color: FishUI.Theme.disabledTextColor // visible: size.visible } @@ -120,7 +120,7 @@ Window { Label { text: qsTr("Created:") Layout.alignment: Qt.AlignRight - color: Meui.Theme.disabledTextColor + color: FishUI.Theme.disabledTextColor visible: creationTime.visible } @@ -133,7 +133,7 @@ Window { Label { text: qsTr("Modified:") Layout.alignment: Qt.AlignRight - color: Meui.Theme.disabledTextColor + color: FishUI.Theme.disabledTextColor visible: modifiedTime.visible } @@ -146,7 +146,7 @@ Window { Label { text: qsTr("Accessed:") Layout.alignment: Qt.AlignRight - color: Meui.Theme.disabledTextColor + color: FishUI.Theme.disabledTextColor visible: accessTime.visible } @@ -158,12 +158,12 @@ Window { } Item { - height: Meui.Units.largeSpacing + height: FishUI.Units.largeSpacing } RowLayout { Layout.alignment: Qt.AlignRight - spacing: Meui.Units.largeSpacing + spacing: FishUI.Units.largeSpacing Button { text: qsTr("Cancel") diff --git a/qml/FolderGridItem.qml b/qml/FolderGridItem.qml index 84f860a..eb0369c 100644 --- a/qml/FolderGridItem.qml +++ b/qml/FolderGridItem.qml @@ -4,7 +4,7 @@ import QtQuick.Controls 2.12 import QtGraphicalEffects 1.0 import Cutefish.FileManager 1.0 -import MeuiKit 1.0 as Meui +import FishUI 1.0 as FishUI Item { id: control @@ -25,11 +25,11 @@ Item { Rectangle { id: _background width: Math.max(_iconItem.width, _label.paintedWidth) - height: _iconItem.height + _label.paintedHeight + Meui.Units.largeSpacing + height: _iconItem.height + _label.paintedHeight + FishUI.Units.largeSpacing x: (parent.width - width) / 2 y: _iconItem.y - color: selected || hovered ? Meui.Theme.highlightColor : "transparent" - radius: Meui.Theme.mediumRadius + color: selected || hovered ? FishUI.Theme.highlightColor : "transparent" + radius: FishUI.Theme.mediumRadius visible: selected || hovered opacity: selected ? 1.0 : 0.2 } @@ -38,11 +38,11 @@ Item { id: _iconItem anchors.top: parent.top anchors.horizontalCenter: parent.horizontalCenter - anchors.topMargin: Meui.Units.largeSpacing - anchors.bottomMargin: Meui.Units.largeSpacing + anchors.topMargin: FishUI.Units.largeSpacing + anchors.bottomMargin: FishUI.Units.largeSpacing z: 2 - width: parent.width - Meui.Units.largeSpacing * 2 + width: parent.width - FishUI.Units.largeSpacing * 2 height: control.GridView.view.iconSize Image { @@ -58,9 +58,9 @@ Item { Image { id: _image anchors.fill: parent - anchors.topMargin: Meui.Units.smallSpacing - anchors.leftMargin: Meui.Units.smallSpacing - anchors.rightMargin: Meui.Units.smallSpacing + anchors.topMargin: FishUI.Units.smallSpacing + anchors.leftMargin: FishUI.Units.smallSpacing + anchors.rightMargin: FishUI.Units.smallSpacing fillMode: Image.PreserveAspectFit visible: status === Image.Ready horizontalAlignment: Qt.AlignHCenter @@ -93,16 +93,16 @@ Item { z: 2 anchors.top: _iconItem.bottom anchors.horizontalCenter: parent.horizontalCenter - anchors.topMargin: Meui.Units.smallSpacing + anchors.topMargin: FishUI.Units.smallSpacing maximumLineCount: 2 horizontalAlignment: Text.AlignHCenter - width: parent.width - Meui.Units.largeSpacing * 2 - Meui.Units.smallSpacing + width: parent.width - FishUI.Units.largeSpacing * 2 - FishUI.Units.smallSpacing textFormat: Text.PlainText elide: Qt.ElideRight wrapMode: Text.Wrap text: model.fileName color: control.GridView.view.isDesktopView ? "white" - : selected ? Meui.Theme.highlightedTextColor : Meui.Theme.textColor + : selected ? FishUI.Theme.highlightedTextColor : FishUI.Theme.textColor } DropShadow { @@ -111,7 +111,7 @@ Item { z: 1 horizontalOffset: 1 verticalOffset: 1 - radius: Math.round(4 * Meui.Units.devicePixelRatio) + radius: Math.round(4 * FishUI.Units.devicePixelRatio) samples: radius * 2 + 1 spread: 0.35 color: Qt.rgba(0, 0, 0, 0.3) diff --git a/qml/FolderGridView.qml b/qml/FolderGridView.qml index ef96610..e4be3df 100644 --- a/qml/FolderGridView.qml +++ b/qml/FolderGridView.qml @@ -3,7 +3,7 @@ import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 import Cutefish.FileManager 1.0 -import MeuiKit 1.0 as Meui +import FishUI 1.0 as FishUI GridView { id: control @@ -188,7 +188,7 @@ GridView { } cellHeight: { - var iconHeight = iconSize + (Meui.Units.fontMetrics.height * 2) + Meui.Units.largeSpacing * 2 + var iconHeight = iconSize + (FishUI.Units.fontMetrics.height * 2) + FishUI.Units.largeSpacing * 2 if (isDesktopView) { var extraHeight = calcExtraSpacing(iconHeight, control.height - topMargin - bottomMargin) return iconHeight + extraHeight @@ -197,7 +197,7 @@ GridView { } cellWidth: { - var iconWidth = iconSize + Meui.Units.largeSpacing * 4 + var iconWidth = iconSize + FishUI.Units.largeSpacing * 4 var extraWidth = calcExtraSpacing(iconWidth, control.width - leftMargin - rightMargin) return iconWidth + extraWidth } @@ -317,7 +317,8 @@ GridView { // 弹出文件夹菜单 if (mouse.buttons & Qt.RightButton) { clearPressState() - dirModel.openContextMenu(null, mouse.modifiers) + // dirModel.openContextMenu(null, mouse.modifiers) + folderMenu.open() mouse.accepted = true } } @@ -453,8 +454,8 @@ GridView { var step = rows ? cellWidth : cellHeight var perStripe = Math.floor(axis / step) var stripes = Math.ceil(control.count / perStripe) - var cWidth = control.cellWidth - (2 * Meui.Units.smallSpacing) - var cHeight = control.cellHeight - (2 * Meui.Units.smallSpacing) + var cWidth = control.cellWidth - (2 * FishUI.Units.smallSpacing) + var cHeight = control.cellHeight - (2 * FishUI.Units.smallSpacing) var midWidth = control.cellWidth / 2 var midHeight = control.cellHeight / 2 var indices = [] @@ -482,7 +483,7 @@ GridView { // Check if the rubberband intersects this cell first to avoid doing more // expensive work. - if (control.rubberBand.intersects(Qt.rect(itemX + Meui.Units.smallSpacing, itemY + Meui.Units.smallSpacing, + if (control.rubberBand.intersects(Qt.rect(itemX + FishUI.Units.smallSpacing, itemY + FishUI.Units.smallSpacing, cWidth, cHeight))) { var item = control.contentItem.childAt(itemX + midWidth, itemY + midHeight) @@ -520,7 +521,7 @@ GridView { var extraSpacing = 0 if (availableColumns > 0) { var allColumnSize = availableColumns * cellSize - var extraSpace = Math.max(containerSize - allColumnSize, Meui.Units.largeSpacing) + var extraSpace = Math.max(containerSize - allColumnSize, FishUI.Units.largeSpacing) extraSpacing = extraSpace / availableColumns } return Math.floor(extraSpacing) @@ -565,18 +566,18 @@ GridView { wrapMode: TextEdit.Wrap horizontalAlignment: TextEdit.AlignHCenter z: 999 - topPadding: Meui.Units.smallSpacing - bottomPadding: Meui.Units.smallSpacing + topPadding: FishUI.Units.smallSpacing + bottomPadding: FishUI.Units.smallSpacing property Item targetItem: null onTargetItemChanged: { if (targetItem != null) { var pos = control.mapFromItem(targetItem, targetItem.labelArea.x, targetItem.labelArea.y) - width = targetItem.width - Meui.Units.smallSpacing - height = targetItem.labelArea.paintedHeight + Meui.Units.largeSpacing * 2 + width = targetItem.width - FishUI.Units.smallSpacing + height = targetItem.labelArea.paintedHeight + FishUI.Units.largeSpacing * 2 x = targetItem.x + Math.abs(Math.min(control.contentX, control.originX)) - y = pos.y - Meui.Units.largeSpacing + y = pos.y - FishUI.Units.largeSpacing text = targetItem.labelArea.text targetItem.labelArea.visible = false _editor.select(0, dirModel.fileExtensionBoundary(targetItem.index)) diff --git a/qml/FolderListItem.qml b/qml/FolderListItem.qml index 680c1f3..a5de58f 100644 --- a/qml/FolderListItem.qml +++ b/qml/FolderListItem.qml @@ -2,7 +2,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 import QtGraphicalEffects 1.0 -import MeuiKit 1.0 as Meui +import FishUI 1.0 as FishUI Item { id: _listItem @@ -21,10 +21,10 @@ Item { property bool selected: model.selected property bool blank: model.blank - property color hoveredColor: Meui.Theme.darkMode ? Qt.lighter(Meui.Theme.backgroundColor, 1.1) - : Qt.darker(Meui.Theme.backgroundColor, 1.05) - property color selectedColor: Meui.Theme.darkMode ? Qt.lighter(Meui.Theme.backgroundColor, 1.2) - : Qt.darker(Meui.Theme.backgroundColor, 1.15) + property color hoveredColor: FishUI.Theme.darkMode ? Qt.lighter(FishUI.Theme.backgroundColor, 1.1) + : Qt.darker(FishUI.Theme.backgroundColor, 1.05) + property color selectedColor: FishUI.Theme.darkMode ? Qt.lighter(FishUI.Theme.backgroundColor, 1.2) + : Qt.darker(FishUI.Theme.backgroundColor, 1.15) // onSelectedChanged: { // if (selected && !blank) { // _listItem.grabToImage(function(result) { @@ -39,17 +39,17 @@ Item { Rectangle { id: _background anchors.fill: parent - radius: Meui.Theme.smallRadius - color: selected ? Meui.Theme.highlightColor : hovered ? hoveredColor : "transparent" + radius: FishUI.Theme.smallRadius + color: selected ? FishUI.Theme.highlightColor : hovered ? hoveredColor : "transparent" visible: selected || hovered } RowLayout { id: _mainLayout anchors.fill: parent - anchors.leftMargin: Meui.Units.smallSpacing - anchors.rightMargin: Meui.Units.smallSpacing - spacing: Meui.Units.largeSpacing + anchors.leftMargin: FishUI.Units.smallSpacing + anchors.rightMargin: FishUI.Units.smallSpacing + spacing: FishUI.Units.largeSpacing Item { id: iconItem @@ -104,21 +104,21 @@ Item { id: _label text: model.fileName Layout.fillWidth: true - color: selected ? Meui.Theme.highlightedTextColor : Meui.Theme.textColor + color: selected ? FishUI.Theme.highlightedTextColor : FishUI.Theme.textColor elide: Qt.ElideMiddle } Label { id: _label2 text: model.fileSize - color: selected ? Meui.Theme.highlightedTextColor : Meui.Theme.disabledTextColor + color: selected ? FishUI.Theme.highlightedTextColor : FishUI.Theme.disabledTextColor Layout.fillWidth: true } } Label { text: model.modified - color: selected ? Meui.Theme.highlightedTextColor : Meui.Theme.disabledTextColor + color: selected ? FishUI.Theme.highlightedTextColor : FishUI.Theme.disabledTextColor } } } diff --git a/qml/FolderListView.qml b/qml/FolderListView.qml index c28b9b5..7e45593 100644 --- a/qml/FolderListView.qml +++ b/qml/FolderListView.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import MeuiKit 1.0 as Meui +import FishUI 1.0 as FishUI import Cutefish.FileManager 1.0 ListView { @@ -27,7 +27,7 @@ ListView { property Item editor: null property int anchorIndex: 0 - property var itemHeight: Meui.Units.fontMetrics.height * 2 + Meui.Units.largeSpacing + property var itemHeight: FishUI.Units.fontMetrics.height * 2 + FishUI.Units.largeSpacing property variant cachedRectangleSelection: null @@ -380,7 +380,7 @@ ListView { if (targetItem != null) { var pos = control.mapFromItem(targetItem, targetItem.labelArea.x, targetItem.labelArea.y) width = targetItem.labelArea.width - height = Meui.Units.fontMetrics.height + Meui.Units.largeSpacing * 2 + height = FishUI.Units.fontMetrics.height + FishUI.Units.largeSpacing * 2 x = control.mapFromItem(targetItem.labelArea, 0, 0).x y = pos.y + (targetItem.height - height) / 2 text = targetItem.labelArea.text diff --git a/qml/FolderPage.qml b/qml/FolderPage.qml index 3c8a79c..121785f 100644 --- a/qml/FolderPage.qml +++ b/qml/FolderPage.qml @@ -3,7 +3,7 @@ import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 import Cutefish.FileManager 1.0 -import MeuiKit 1.0 as Meui +import FishUI 1.0 as FishUI import "./Dialogs" @@ -24,10 +24,10 @@ Item { Rectangle { id: _background anchors.fill: parent - anchors.rightMargin: Meui.Theme.smallRadius - anchors.bottomMargin: Meui.Theme.smallRadius - radius: Meui.Theme.smallRadius - color: Meui.Theme.backgroundColor + anchors.rightMargin: FishUI.Theme.smallRadius + anchors.bottomMargin: FishUI.Theme.smallRadius + radius: FishUI.Theme.smallRadius + color: FishUI.Theme.backgroundColor } Label { @@ -60,9 +60,23 @@ Item { _viewLoader.item.contentWidth, _viewLoader.item.contentHeight) } + FishUI.DesktopMenu { + id: folderMenu + + MenuItem { + text: qsTr("Open") + onTriggered: dirModel.openSelected() + } + + MenuItem { + text: qsTr("Properties") + onTriggered: dirModel.openPropertiesDialog() + } + } + ColumnLayout { anchors.fill: parent - anchors.bottomMargin: Meui.Theme.smallRadius + anchors.bottomMargin: FishUI.Theme.smallRadius spacing: 0 Loader { @@ -103,10 +117,10 @@ Item { RowLayout { anchors.fill: parent - anchors.leftMargin: Meui.Units.largeSpacing - anchors.rightMargin: Meui.Units.largeSpacing + anchors.leftMargin: FishUI.Units.largeSpacing + anchors.rightMargin: FishUI.Units.largeSpacing anchors.bottomMargin: 1 - spacing: Meui.Units.largeSpacing + spacing: FishUI.Units.largeSpacing Label { Layout.alignment: Qt.AlignLeft @@ -144,10 +158,10 @@ Item { model: dirModel delegate: FolderGridItem {} - leftMargin: Meui.Units.largeSpacing - rightMargin: Meui.Units.largeSpacing - topMargin: Meui.Units.smallSpacing - bottomMargin: Meui.Units.smallSpacing + leftMargin: FishUI.Units.largeSpacing + rightMargin: FishUI.Units.largeSpacing + topMargin: FishUI.Units.smallSpacing + bottomMargin: FishUI.Units.smallSpacing onIconSizeChanged: { // Save @@ -167,10 +181,10 @@ Item { id: _folderListView model: dirModel - topMargin: Meui.Units.largeSpacing - leftMargin: Meui.Units.largeSpacing - rightMargin: Meui.Units.largeSpacing + Meui.Theme.smallRadius - spacing: Meui.Units.largeSpacing + topMargin: FishUI.Units.largeSpacing + leftMargin: FishUI.Units.largeSpacing + rightMargin: FishUI.Units.largeSpacing + FishUI.Theme.smallRadius + spacing: FishUI.Units.largeSpacing onCountChanged: { _fileTips.visible = count === 0 @@ -189,7 +203,7 @@ Item { width: 0 height: 0 z: 99999 - color: Meui.Theme.highlightColor + color: FishUI.Theme.highlightColor function close() { opacityAnimation.restart() diff --git a/qml/PathBar.qml b/qml/PathBar.qml index 7e46502..119dedf 100644 --- a/qml/PathBar.qml +++ b/qml/PathBar.qml @@ -3,7 +3,7 @@ import QtQuick.Controls 2.12 import QtGraphicalEffects 1.0 import Cutefish.FileManager 1.0 -import MeuiKit 1.0 as Meui +import FishUI 1.0 as FishUI Item { id: control @@ -23,7 +23,7 @@ Item { leftMargin: 3 rightMargin: 3 - spacing: Meui.Units.smallSpacing + spacing: FishUI.Units.smallSpacing onCountChanged: { _pathView.currentIndex = _pathView.count - 1 @@ -32,8 +32,8 @@ Item { Rectangle { anchors.fill: parent - color: Meui.Theme.backgroundColor - radius: Meui.Theme.smallRadius + color: FishUI.Theme.backgroundColor + radius: FishUI.Theme.smallRadius z: -1 } @@ -47,7 +47,7 @@ Item { delegate: MouseArea { id: _item height: ListView.view.height - width: _name.width + Meui.Units.largeSpacing + width: _name.width + FishUI.Units.largeSpacing z: -1 property bool selected: index === _pathView.count - 1 @@ -58,15 +58,15 @@ Item { anchors.fill: parent anchors.topMargin: 2 anchors.bottomMargin: 2 - color: Meui.Theme.highlightColor - radius: Meui.Theme.smallRadius + color: FishUI.Theme.highlightColor + radius: FishUI.Theme.smallRadius visible: selected } Label { id: _name text: model.name - color: selected ? Meui.Theme.highlightedTextColor : Meui.Theme.textColor + color: selected ? FishUI.Theme.highlightedTextColor : FishUI.Theme.textColor anchors.centerIn: parent } } @@ -80,13 +80,13 @@ Item { inputMethodHints: Qt.ImhUrlCharactersOnly | Qt.ImhNoAutoUppercase text: control.url - color: Meui.Theme.darkMode ? "white" : "black" + color: FishUI.Theme.darkMode ? "white" : "black" background: Rectangle { - radius: Meui.Theme.smallRadius - color: Meui.Theme.darkMode ? Qt.darker(Meui.Theme.backgroundColor, 1.1) : "white" - border.width: Meui.Units.extendBorderWidth - border.color: Meui.Theme.highlightColor + radius: FishUI.Theme.smallRadius + color: FishUI.Theme.darkMode ? Qt.darker(FishUI.Theme.backgroundColor, 1.1) : "white" + border.width: FishUI.Units.extendBorderWidth + border.color: FishUI.Theme.highlightColor } onAccepted: { diff --git a/qml/SideBar.qml b/qml/SideBar.qml index a63e8f2..d0043f6 100644 --- a/qml/SideBar.qml +++ b/qml/SideBar.qml @@ -3,7 +3,7 @@ import QtQuick.Layouts 1.12 import QtQuick.Controls 2.12 import QtGraphicalEffects 1.0 -import MeuiKit 1.0 as Meui +import FishUI 1.0 as FishUI import Cutefish.FileManager 1.0 ListView { @@ -18,13 +18,13 @@ ListView { model: placesModel clip: true - leftMargin: Meui.Units.smallSpacing - rightMargin: Meui.Units.smallSpacing - bottomMargin: Meui.Units.smallSpacing - spacing: Meui.Units.smallSpacing + leftMargin: FishUI.Units.smallSpacing + rightMargin: FishUI.Units.smallSpacing + bottomMargin: FishUI.Units.smallSpacing + spacing: FishUI.Units.smallSpacing ScrollBar.vertical: ScrollBar { - bottomPadding: Meui.Units.smallSpacing + bottomPadding: FishUI.Units.smallSpacing } highlightFollowsCurrentItem: true @@ -32,8 +32,8 @@ ListView { highlightResizeDuration : 0 highlight: Rectangle { - radius: Meui.Theme.smallRadius - color: Meui.Theme.highlightColor + radius: FishUI.Theme.smallRadius + color: FishUI.Theme.highlightColor } delegate: Item { @@ -42,8 +42,8 @@ ListView { height: 40 property bool checked: sideBar.currentIndex === index - property color hoveredColor: Meui.Theme.darkMode ? Qt.lighter(Meui.Theme.backgroundColor, 1.1) - : Qt.darker(Meui.Theme.backgroundColor, 1.1) + property color hoveredColor: FishUI.Theme.darkMode ? Qt.lighter(FishUI.Theme.backgroundColor, 1.1) + : Qt.darker(FishUI.Theme.backgroundColor, 1.1) MouseArea { id: _mouseArea anchors.fill: parent @@ -60,15 +60,15 @@ ListView { Rectangle { anchors.fill: parent - radius: Meui.Theme.smallRadius + radius: FishUI.Theme.smallRadius color: _mouseArea.containsMouse && !checked ? _item.hoveredColor : "transparent" } RowLayout { anchors.fill: parent - anchors.leftMargin: Meui.Units.smallSpacing - anchors.rightMargin: Meui.Units.smallSpacing - spacing: Meui.Units.smallSpacing + anchors.leftMargin: FishUI.Units.smallSpacing + anchors.rightMargin: FishUI.Units.smallSpacing + spacing: FishUI.Units.smallSpacing Image { height: _item.height * 0.55 @@ -81,14 +81,14 @@ ListView { anchors.fill: parent source: parent color: _label.color - visible: Meui.Theme.darkMode && model.iconPath || checked + visible: FishUI.Theme.darkMode && model.iconPath || checked } } Label { id: _label text: model.name - color: checked ? Meui.Theme.highlightedTextColor : Meui.Theme.textColor + color: checked ? FishUI.Theme.highlightedTextColor : FishUI.Theme.textColor elide: Text.ElideRight Layout.fillWidth: true Layout.alignment: Qt.AlignVCenter diff --git a/qml/main.qml b/qml/main.qml index 77bb93d..81e9967 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -2,11 +2,11 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 import QtQuick.Window 2.12 -import MeuiKit 1.0 as Meui +import FishUI 1.0 as FishUI import "./Controls" -Meui.Window { +FishUI.Window { id: root width: settings.width height: settings.height @@ -15,8 +15,8 @@ Meui.Window { visible: true title: qsTr("File Manager") - headerBarHeight: 35 + Meui.Units.largeSpacing - backgroundColor: Meui.Theme.secondBackgroundColor + headerBarHeight: 35 + FishUI.Units.largeSpacing + backgroundColor: FishUI.Theme.secondBackgroundColor property QtObject settings: GlobalSettings { } @@ -31,17 +31,17 @@ Meui.Window { headerBar: Item { RowLayout { anchors.fill: parent - anchors.leftMargin: Meui.Units.smallSpacing - anchors.rightMargin: Meui.Units.smallSpacing - anchors.topMargin: Meui.Units.smallSpacing - anchors.bottomMargin: Meui.Units.smallSpacing + anchors.leftMargin: FishUI.Units.smallSpacing + anchors.rightMargin: FishUI.Units.smallSpacing + anchors.topMargin: FishUI.Units.smallSpacing + anchors.bottomMargin: FishUI.Units.smallSpacing - spacing: Meui.Units.smallSpacing + spacing: FishUI.Units.smallSpacing IconButton { Layout.fillHeight: true implicitWidth: height - source: Meui.Theme.darkMode ? "qrc:/images/dark/go-previous.svg" + source: FishUI.Theme.darkMode ? "qrc:/images/dark/go-previous.svg" : "qrc:/images/light/go-previous.svg" onClicked: _folderPage.goBack() } @@ -49,7 +49,7 @@ Meui.Window { IconButton { Layout.fillHeight: true implicitWidth: height - source: Meui.Theme.darkMode ? "qrc:/images/dark/go-next.svg" + source: FishUI.Theme.darkMode ? "qrc:/images/dark/go-next.svg" : "qrc:/images/light/go-next.svg" onClicked: _folderPage.goForward() } @@ -66,8 +66,8 @@ Meui.Window { Layout.fillHeight: true implicitWidth: height - property var gridSource: Meui.Theme.darkMode ? "qrc:/images/dark/grid.svg" : "qrc:/images/light/grid.svg" - property var listSource: Meui.Theme.darkMode ? "qrc:/images/dark/list.svg" : "qrc:/images/light/list.svg" + property var gridSource: FishUI.Theme.darkMode ? "qrc:/images/dark/grid.svg" : "qrc:/images/light/grid.svg" + property var listSource: FishUI.Theme.darkMode ? "qrc:/images/dark/list.svg" : "qrc:/images/light/list.svg" source: settings.viewMethod === 0 ? listSource : gridSource @@ -86,7 +86,7 @@ Meui.Window { SideBar { id: _sideBar Layout.fillHeight: true - width: 200 + Meui.Units.largeSpacing + width: 200 + FishUI.Units.largeSpacing onClicked: _folderPage.openUrl(path) }