diff --git a/demo/src/main.qml b/demo/src/main.qml index ca8a40c..e7a7c04 100644 --- a/demo/src/main.qml +++ b/demo/src/main.qml @@ -1,359 +1,355 @@ import QtQuick 2.9 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import org.kde.mauikit 1.0 as Maui import org.kde.kirigami 2.6 as Kirigami import QtQuick.Templates 2.3 as T Maui.ApplicationWindow { id: root // isWide : root.width >= Kirigami.Units.gridUnit * 10 property int currentPageIndex : 0 // about.appDescription: "MauiDemo is a gallery app displaying the MauiKit controls in conjuction with Kirigami and QQC2 controls." property alias dialog : _dialogLoader.item floatingBar: false mainMenu: [ Maui.MenuItem { text: qsTr("File dialog") icon.name: "folder-open" onTriggered: { _dialogLoader.sourceComponent = _fileDialogComponent dialog.callback = function(paths) { console.log("Selected paths >> ", paths) } dialog.open() } } ] headBar.spacing: space.huge headBar.middleContent: [ - Maui.ToolButton + ToolButton { // Layout.fillHeight: true - iconName: "nx-home" - colorScheme.textColor : root.headBarFGColor + icon.name: "nx-home" + Kirigami.Theme.textColor : root.headBarFGColor spacing: space.medium - active: currentPageIndex === 0 - showIndicator: true + checked: currentPageIndex === 0 onClicked: currentPageIndex = 0 text: qsTr("Home") }, - Maui.ToolButton + ToolButton { // Layout.fillHeight: true - iconName: "view-list-icons" - colorScheme.textColor: root.headBarFGColor + icon.name: "view-list-icons" + Kirigami.Theme.textColor: root.headBarFGColor spacing: space.medium - active: currentPageIndex === 1 - showIndicator: true + checked: currentPageIndex === 1 onClicked: currentPageIndex = 1 text: qsTr("Browser") }, - Maui.ToolButton + ToolButton { // Layout.fillHeight: true - iconName: "view-media-genre" - colorScheme.textColor: root.headBarFGColor + icon.name: "view-media-genre" + Kirigami.Theme.textColor: root.headBarFGColor spacing: space.medium - active: currentPageIndex === 2 - showIndicator: true + checked: currentPageIndex === 2 onClicked: currentPageIndex = 2 text: qsTr("Editor") }, - Maui.ToolButton + ToolButton { // Layout.fillHeight: true - iconName: "nx-software-center" - colorScheme.textColor: root.headBarFGColor + icon.name: "nx-software-center" + Kirigami.Theme.textColor: root.headBarFGColor spacing: space.medium - active: currentPageIndex === 3 - showIndicator: true + checked: currentPageIndex === 3 onClicked: currentPageIndex = 3 text: qsTr("Store") } ] - footBar.leftContent: Maui.ToolButton + footBar.leftContent: ToolButton { - iconName: "view-split-left-right" + icon.name: "view-split-left-right" onClicked: _drawer.visible = !_drawer.visible checked: _drawer.visible } footBar.rightContent: Kirigami.ActionToolBar { Layout.fillWidth: true actions: [ Kirigami.Action { iconName: "folder-new" text: "New folder" icon.width: iconSizes.medium icon.height: iconSizes.medium expandible: true Kirigami.Action { text: "exmaple" icon.name: "love" } }, Kirigami.Action { id: _findAction iconName: "edit-find" text: parent == T.ToolButton ? "Search" : undefined icon.width: iconSizes.medium icon.height: iconSizes.medium }, Kirigami.Action { iconName: "document-preview-archive" text: "Hidden files" icon.width: iconSizes.medium icon.height: iconSizes.medium } ] } globalDrawer: Maui.GlobalDrawer { id: _drawer width: Kirigami.Units.gridUnit * 14 modal: !root.isWide actions: [ Kirigami.Action { text: qsTr("Shopping") iconName: "cpu" }, Kirigami.Action { text: qsTr("Notes") iconName: "send-sms" }, Kirigami.Action { text: qsTr("Example 3") iconName: "love" } ] } content: SwipeView { anchors.fill: parent currentIndex: currentPageIndex onCurrentIndexChanged: currentPageIndex = currentIndex Maui.Page { id: _page1 Item { anchors.fill: parent ColumnLayout { anchors.centerIn: parent width: Math.max(Math.min(implicitWidth, parent.width), Math.min(400, parent.width)) Label { text: "Header bar background color" Layout.fillWidth: true } Maui.TextField { Layout.fillWidth: true placeholderText: root.headBarBGColor onAccepted: { root.headBarBGColor= text } } Label { text: "Header bar foreground color" Layout.fillWidth: true } Maui.TextField { Layout.fillWidth: true placeholderText: root.headBarFGColor onAccepted: { root.headBarFGColor = text } } Label { text: "Header bar background color" Layout.fillWidth: true } Maui.TextField { Layout.fillWidth: true onAccepted: { root.headBarBGColor= text } } // CheckBox // { // text: "Draw toolbar borders" // Layout.fillWidth: true // onCheckedChanged: // { // headBar.drawBorder = checked // footBar.drawBorder = checked // } // } } } - headBar.rightContent: Maui.ToolButton + headBar.rightContent: ToolButton { - iconName: "documentinfo" + icon.name: "documentinfo" text: qsTr("Notify") onClicked: { var callback = function() { _batteryBtn.visible = true } notify("battery", qsTr("Plug your device"), qsTr("Your device battery level is below 20%, please plug your device to a power supply"), callback, 5000) } } - headBar.leftContent: Maui.ToolButton + headBar.leftContent: ToolButton { id: _batteryBtn visible: false - iconName: "battery" + icon.name: "battery" } } Maui.FileBrowser { id: _page2 onItemClicked: openItem(index) } Maui.Page { id: _page3 margins: 0 headBar.visible: false Maui.Editor { id: _editor anchors { fill: parent // top: parent.top // right: parent.right // left: parent.left // bottom: _terminal.top } } // Maui.Terminal // { // id: _terminal //// anchors //// { //// top: _editor.top //// right: parent.right //// left: parent.left //// bottom: parent.bottom //// } // } footBar.rightContent: Maui.ToolButton { iconName: "utilities-terminal" onClicked: { // _terminal.visible = _terminal.visible } } } Maui.Store { id: _page4 list.provider: StoreList.KDELOOK list.category: StoreList.WALLPAPERS } } //Components ///Dialog loaders Loader { id: _dialogLoader } Component { id: _fileDialogComponent Maui.FileDialog { } } } diff --git a/src/controls/AboutDialog.qml b/src/controls/AboutDialog.qml index 35ee4d1..a601be1 100644 --- a/src/controls/AboutDialog.qml +++ b/src/controls/AboutDialog.qml @@ -1,237 +1,237 @@ /* * Copyright 2018 Camilo Higuita * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) 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 Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.0 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import org.kde.mauikit 1.0 as Maui Maui.Dialog { id: control property var app : ({}) property string appName : Qt.application.name property string appVersion : Qt.application.version property string organizationName : Qt.application.organization property string organizationDomain : Qt.application.domain property string appDescription : "" property string appLink: "www.maui-project.org" property string appDonation: "" property string appIcon: "qrc:/assets/mauikit-logo.png" defaultButtons: false widthHint: 0.9 heightHint: 0.8 maxWidth: unit * 400 maxHeight: unit * 250 - footBar.middleContent: Maui.ToolButton + footBar.middleContent: ToolButton { - iconName: "view-links" + icon.name: "view-links" onClicked: Maui.FM.openUrl(control.appLink) } - footBar.rightContent: Maui.ToolButton + footBar.rightContent: ToolButton { - iconName: "love" + icon.name: "love" onClicked: Maui.FM.openUrl(control.appDonation) } - footBar.leftContent: Maui.ToolButton + footBar.leftContent: ToolButton { - iconName: "documentinfo" + icon.name: "documentinfo" } RowLayout { id: layout anchors.centerIn: parent width: parent.width height: parent.height * 0.7 Item { Layout.fillHeight: true Layout.margins: space.small Layout.alignment: Qt.AlignHCenter | Qt.AlignTop Layout.minimumWidth: iconSizes.huge Layout.maximumWidth: iconSizes.huge Layout.preferredWidth: iconSizes.huge Layout.minimumHeight: iconSizes.huge clip: true Image { source: app.icon || control.appIcon width: iconSizes.huge height: width sourceSize.width: width sourceSize.height: height horizontalAlignment: Qt.AlignHCenter asynchronous: true fillMode: Image.PreserveAspectFit } } Item { id: _descriptionItem Layout.fillWidth: true Layout.fillHeight: true Layout.alignment: Qt.AlignLeft | Qt.AlignTop ScrollView { anchors.fill: parent contentHeight: _columnInfo.implicitHeight padding: 0 clip: true ColumnLayout { id: _columnInfo width: parent.width spacing: 0 Label { id: appTitle Layout.fillWidth: true // Layout.preferredHeight: implicitHeight Layout.alignment: Qt.AlignLeft clip: true width: parent.width height: parent.height color: textColor text: appName font.weight: Font.Bold font.bold: true font.pointSize: fontSizes.huge } Label { id: appVersion Layout.fillWidth: true // Layout.preferredHeight: fontSizes.default Layout.alignment: Qt.AlignLeft clip: true width: parent.width height: parent.height color: Qt.lighter(textColor, 1.2) text: app.version font.pointSize: fontSizes.default } Label { id: body // Layout.fillWidth: true // Layout.fillHeight: true Layout.preferredWidth:_descriptionItem.width padding: 0 // placeholderText: qsTr("App description") enabled: false text: appDescription textFormat : TextEdit.AutoText color: textColor font.pointSize: fontSizes.default wrapMode: TextEdit.WrapAtWordBoundaryOrAnywhere clip: true // background: Rectangle // { // color: "transparent" // } } } } } // Item // { // Layout.fillWidth: true // Layout.row: 4 // Layout.column: 2 // Layout.margins: space.small // Layout.alignment: Qt.AlignLeft | Qt.AlignTop // Label // { // color: textColor // width: parent.width // height: parent.height // // text: qsTr("Built with MauiKit and Kirigami.") // font.pointSize: fontSizes.default // wrapMode: TextEdit.WrapAnywhere // // // } // } // Item // { // Layout.fillWidth: true // Layout.fillHeight: true // Layout.row: 5 // Layout.column: 2 // Layout.margins: space.big // Layout.alignment: Qt.AlignLeft | Qt.AlignTop // // Label // { // color: textColor // width: parent.width // height: parent.height // // text: "MauiKit " + app.mauikit + " Qt " +app.qt // font.pointSize: fontSizes.default // wrapMode: TextEdit.WrapAnywhere // // } // } } onOpened : control.app = Maui.Handy.appInfo() } diff --git a/src/controls/ApplicationWindow.qml b/src/controls/ApplicationWindow.qml index 1c1ed31..a2f65a8 100644 --- a/src/controls/ApplicationWindow.qml +++ b/src/controls/ApplicationWindow.qml @@ -1,596 +1,596 @@ /* * Copyright 2018 Camilo Higuita * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) 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 Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.9 import QtQuick.Controls 2.2 import QtQuick.Window 2.0 import QtQuick.Layouts 1.3 import QtGraphicalEffects 1.0 import QtQuick.Window 2.3 import org.kde.kirigami 2.2 as Kirigami import org.kde.mauikit 1.0 as Maui import QtQuick.Controls.Material 2.1 import "private" import SyncingModel 1.0 import SyncingList 1.0 Kirigami.AbstractApplicationWindow { id: root visible: true width: Screen.width * (isMobile ? 1 : 0.4) height: Screen.height * (isMobile ? 1 : 0.4) contentItem.anchors.leftMargin: 0 contentItem.anchors.rightMargin: 0 contentItem.anchors.margins: 0 property bool showAccounts : true /***************************************************/ /******************** ALIASES *********************/ /*************************************************/ property alias page : page property alias footBar : page.footBar property alias headBar : page.headBar property alias dialog: dialogLoader.item property alias leftIcon : menuBtn property alias rightIcon : searchBtn default property alias content : page.content property alias mainMenu : mainMenu.contentData property alias about : aboutDialog property alias accounts: _accountsDialogLoader.item property alias currentAccount: _accountCombobox.currentText property alias notifyDialog: _notify //redefines here as here we can know a pointer to PageRow wideScreen: isWide /***************************************************/ /*********************** UI ***********************/ /*************************************************/ property bool isWide : root.width >= Kirigami.Units.gridUnit * 30 property int radiusV : unit * 4 property int iconSize : iconSizes.medium * (isMobile ? 0.95 : 1) readonly property int unit : Maui.Style.unit readonly property int rowHeight: Maui.Style.rowHeight readonly property int rowHeightAlt: Maui.Style.rowHeightAlt readonly property int toolBarHeight: Maui.Style.toolBarHeight readonly property int toolBarHeightAlt: Maui.Style.toolBarHeightAlt readonly property int contentMargins: space.medium readonly property var fontSizes: Maui.Style.fontSizes readonly property var space : Maui.Style.space readonly property var iconSizes : Maui.Style.iconSizes property string colorSchemeName : Qt.application.name /***************************************************/ /********************* COLORS *********************/ /*************************************************/ readonly property var colorScheme: ({ Default : 1, Light : 2, Dark: 3, Custom: 4 }) property color borderColor: Qt.tint(textColor, Qt.rgba(backgroundColor.r, backgroundColor.g, backgroundColor.b, 0.7)) property color backgroundColor: Maui.Style.backgroundColor property color textColor: Maui.Style.textColor property color highlightColor: Maui.Style.highlightColor property color highlightedTextColor: Maui.Style.highlightedTextColor property color buttonBackgroundColor: Maui.Style.buttonBackgroundColor property color viewBackgroundColor: Maui.Style.viewBackgroundColor property color altColor: Maui.Style.altColor property color altColorText: Maui.Style.altColorText property color accentColor : buttonBackgroundColor property color bgColor: viewBackgroundColor property color headBarBGColor: backgroundColor property color headBarFGColor: textColor readonly property string darkBorderColor: Qt.darker(darkBackgroundColor, 1.5) readonly property string darkBackgroundColor: "#303030" readonly property string darkTextColor: "#FAFAFA" readonly property string darkHighlightColor: "#29B6F6" readonly property string darkHighlightedTextColor: darkTextColor readonly property string darkViewBackgroundColor: "#212121" readonly property string darkDarkColor: "#191919" readonly property string darkButtonBackgroundColor : "#191919" readonly property color darkAltColor: "#333" readonly property color darkAltColorText: darkTextColor readonly property color darkAccentColor : darkButtonBackgroundColor readonly property color darkBgColor: darkBackgroundColor property color warningColor : Maui.Style.warningColor property color dangerColor : Maui.Style.dangerColor property color infoColor : Maui.Style.infoColor property color suggestedColor : Maui.Style.suggestedColor /* ANDROID THEMING*/ Material.theme: Material.Light Material.accent: highlightColor Material.background: headBarBGColor Material.primary: headBarBGColor Material.foreground: textColor /***************************************************/ /**************** READONLY PROPS ******************/ /*************************************************/ readonly property bool isMobile : Kirigami.Settings.isMobile readonly property bool isAndroid: Qt.platform.os == "android" readonly property real screenWidth : Screen.width readonly property real screenHeight : Screen.height /***************************************************/ /********************* PROPS **********************/ /*************************************************/ property bool altToolBars : isMobile property bool floatingBar : altToolBars property int footBarAligment : Qt.AlignCenter property bool footBarOverlap : false property bool allowRiseContent: floatingBar && footBarOverlap property int footBarMargins: space.big property alias searchButton : searchBtn property alias menuButton : menuBtn /***************************************************/ /******************** SIGNALS *********************/ /*************************************************/ signal menuButtonClicked(); signal searchButtonClicked(); signal goBackTriggered(); signal goFowardTriggered(); // overlay.modal: Rectangle // { // color: Color.transparent(altColor, 0.5) // } // overlay.modeless: Rectangle { // color: "transparent" // } onClosing: { if(!isMobile) { var height = root.height var width = root.width var x = root.x var y = root.y Maui.FM.saveSettings("GEOMETRY", Qt.rect(x, y, width, height), "WINDOW") } } property bool isPortrait: Screen.primaryOrientation === Qt.PortraitOrientation || Screen.primaryOrientation === Qt.InvertedPortraitOrientation onIsPortraitChanged: { if(isPortrait) { console.log("PORTARIT MODE CHANGED") width: Screen.width height: Screen.height } } onHeadBarBGColorChanged: { if(!isMobile && colorSchemeName.length > 0 && !altToolBars) Maui.KDE.setColorScheme(colorSchemeName, headBarBGColor, headBarFGColor) else if(isAndroid && !altToolBars) Maui.Android.statusbarColor(headBarBGColor, false) else if(isAndroid && altToolBars) Maui.Android.statusbarColor(viewBackgroundColor, true) } onHeadBarFGColorChanged: { if(!isAndroid && !isMobile && colorSchemeName.length > 0 && !altToolBars) Maui.KDE.setColorScheme(colorSchemeName, headBarBGColor, headBarFGColor) else if(isAndroid && !altToolBars) Maui.Android.statusbarColor(headBarBGColor, false) else if(isAndroid && altToolBars) Maui.Android.statusbarColor(viewBackgroundColor, true) } background: Rectangle { color: bgColor } // globalDrawer.height: root.height - headBar.height // globalDrawer.y: headBar.height Maui.Page { id: page anchors.fill: parent leftMargin: root.globalDrawer && (root.globalDrawer.modal === false) ? root.globalDrawer.contentItem.width * root.globalDrawer.position : 0 margins: 0 headBar.plegable: false headBar.height: toolBarHeight + space.small headBar.implicitHeight: toolBarHeight + space.small headBarExit: false altToolBars: root.altToolBars floatingBar : root.floatingBar footBarAligment : root.footBarAligment footBarOverlap : root.footBarOverlap footBarMargins: root.footBarMargins allowRiseContent: root.allowRiseContent background: Rectangle { color: bgColor } headBar.colorScheme.backgroundColor: headBarBGColor headBar.colorScheme.textColor: headBarFGColor headBar.leftContent: ToolButton { id: menuBtn icon.name: "application-menu" icon.color: headBarFGColor checked: mainMenu.visible onClicked: { menuButtonClicked() mainMenu.visible ? mainMenu.close() : mainMenu.popup(parent, parent.x , altToolBars ? 0 : parent.height+ space.medium) } Menu { id: mainMenu modal: true z: 999 width: unit * 200 Item { height: _accountCombobox.visible ? unit * 90 : 0 anchors { left: parent.left right: parent.right top: parent.top margins: space.medium } - Maui.ComboBox + ComboBox { id: _accountCombobox anchors.centerIn: parent // parent: mainMenu popup.z: 999 width: parent.width visible: (count > 1) && showAccounts textRole: "user" flat: true model: showAccounts ? accounts.model : undefined - iconButton.iconName: "user-identity" - iconButton.isMask: false +// icon.name: "user-identity" +// iconButton.isMask: false } } MenuSeparator { visible: _accountCombobox.visible } MenuItem { text: qsTr("Accounts") visible: root.showAccounts icon.name: "list-add-user" onTriggered: { if(root.accounts) accounts.open() } } MenuItem { text: qsTr("About") icon.name: "documentinfo" onTriggered: aboutDialog.open() } MenuSeparator {} } } headBar.rightContent: ToolButton { id: searchBtn icon.name: "edit-find" icon.color: headBarFGColor onClicked: searchButtonClicked() } Keys.onBackPressed: { goBackTriggered(); console.log("GO BACK CLICKED") event.accepted = true } Shortcut { sequence: "Forward" onActivated: goFowardTriggered(); } Shortcut { sequence: StandardKey.Forward onActivated: goFowardTriggered(); } Shortcut { sequence: StandardKey.Back onActivated: goBackTriggered(); } } Maui.AboutDialog { id: aboutDialog } Loader { id: _accountsDialogLoader sourceComponent: root.showAccounts ? _accountsDialogComponent : undefined } Component { id: _accountsDialogComponent AccountsHelper {} } Maui.Dialog { id: _notify property var cb : ({}) verticalAlignment: Qt.AlignTop defaultButtons: false colorScheme.backgroundColor: altColor colorScheme.textColor: altColorText maxHeight: Math.max(unit * 120, (_notifyLayout.implicitHeight)) maxWidth: isMobile ? parent.width * 0.9 : unit * 500 Timer { id: _notifyTimer onTriggered: _notify.close() } onClosed: _notifyTimer.stop() MouseArea { anchors.fill: parent onClicked: { if(_notify.cb) _notify.cb() _notify.close() } } GridLayout { anchors.fill: parent columns: 2 rows: 1 Item { Layout.fillHeight: true Layout.preferredWidth: iconSizes.huge + space.big Layout.row: 1 Layout.column: 1 ToolButton { id: _notifyIcon icon.width: iconSizes.large anchors.centerIn: parent // isMask: false } } Item { Layout.fillHeight: true Layout.fillWidth: true Layout.row: 1 Layout.column: 2 ColumnLayout { anchors.fill: parent id: _notifyLayout Label { id: _notifyTitle Layout.fillHeight: true Layout.fillWidth: true font.weight: Font.Bold font.bold: true font.pointSize: fontSizes.big color: _notify.colorScheme.textColor elide: Qt.ElideRight wrapMode: Text.Wrap } Label { id: _notifyBody Layout.fillHeight: true Layout.fillWidth: true font.pointSize: fontSizes.default color: _notify.colorScheme.textColor elide: Qt.ElideRight wrapMode: Text.Wrap } } } } function show(callback) { _notify.cb = callback _notifyTimer.start() _notify.open() } } Loader { id: dialogLoader } Component.onCompleted: { if(isAndroid && altToolBars) Maui.Android.statusbarColor(backgroundColor, true) if(!isMobile) { var rect = Maui.FM.loadSettings("GEOMETRY", "WINDOW", Qt.rect(root.x, root.y, root.width, root.height)) root.x = rect.x root.y = rect.y root.width = rect.width root.height = rect.height } } // Connections // { // target: Maui.FM // // onNewItem: notify("dialog-information", qsTr("File uploaded"), "Your file has been uploaded to your account /n"+path) // onWarningMessage: notify("dialog-information", "Oops!", message) // } function switchColorScheme(variant) { switch(variant) { case colorScheme.Default: backgroundColor = Maui.Style.backgroundColor textColor = Maui.Style.textColor highlightColor = Maui.Style.highlightColor highlightedTextColor = Maui.Style.highlightedTextColor buttonBackgroundColor = Maui.Style.buttonBackgroundColor viewBackgroundColor = Maui.Style.viewBackgroundColor altColor = Maui.Style.altColor borderColor = Maui.Style.borderColor if(isAndroid) Maui.Android.statusbarColor(backgroundColor, true) break case colorScheme.Dark: borderColor = darkBorderColor backgroundColor = darkBackgroundColor textColor = darkTextColor highlightColor = darkHighlightColor highlightedTextColor = darkHighlightedTextColor buttonBackgroundColor = darkButtonBackgroundColor viewBackgroundColor = darkViewBackgroundColor altColor = darkDarkColor altColorText = darkAltColorText bgColor =darkBgColor if(isAndroid) Maui.Android.statusbarColor(backgroundColor, false) break } } function notify(icon, title, body, callback, timeout) { _notifyIcon.iconName = icon _notifyTitle.text = title _notifyBody.text = body _notifyTimer.interval = timeout ? timeout : 2500 _notify.show(callback) } /** FUNCTIONS **/ // function riseContent() // { // if(allowRiseContent) // flickable.flick(0, flickable.contentHeight* -2) // } // function dropContent() // { // if(allowRiseContent) // flickable.flick(0, flickable.contentHeight* 2) // } } diff --git a/src/controls/ComboBox.qml b/src/controls/ComboBox.qml index 4df2e16..4d1f676 100644 --- a/src/controls/ComboBox.qml +++ b/src/controls/ComboBox.qml @@ -1,138 +1,138 @@ /* * Copyright 2017 Marco Martin * Copyright 2017 The Qt Company Ltd. * * GNU Lesser General Public License Usage * Alternatively, this file may be used under the terms of the GNU Lesser * General Public License version 3 as published by the Free Software * Foundation and appearing in the file LICENSE.LGPLv3 included in the * packaging of this file. Please review the following information to * ensure the GNU Lesser General Public License version 3 requirements * will be met: https://www.gnu.org/licenses/lgpl.html. * * GNU General Public License Usage * Alternatively, this file may be used under the terms of the GNU * General Public License version 2.0 or later as published by the Free * Software Foundation and appearing in the file LICENSE.GPL included in * the packaging of this file. Please review the following information to * ensure the GNU General Public License version 2.0 requirements will be * met: http://www.gnu.org/licenses/gpl-2.0.html. */ import QtQuick 2.6 import QtQuick.Window 2.2 import QtQuick.Controls 2.3 import QtGraphicalEffects 1.0 import org.kde.kirigami 2.2 as Kirigami import org.kde.mauikit 1.0 as Maui import "private" ComboBox { id: control ColorScheme { id: colorScheme } property alias colorScheme : colorScheme property alias iconButton : _iconButton property alias indicatorButton : _indicatorButton implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth + leftPadding + rightPadding) implicitHeight: Math.max(background ? background.implicitHeight : 0, Math.max(contentItem.implicitHeight, indicator ? indicator.implicitHeight : 0) + topPadding + bottomPadding) baselineOffset: contentItem.y + contentItem.baselineOffset leftPadding: padding + (!control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) rightPadding: padding + (control.mirrored || !indicator || !indicator.visible ? 0 : indicator.width + spacing) - Maui.ToolButton + ToolButton { id: _iconButton visible: iconName.length - size: iconSizes.medium + icon.width: iconSizes.medium enabled: false - iconColor: control.pressed || control.down ? control.colorScheme.highlightedTextColor : control.colorScheme.textColor + icon.color: control.pressed || control.down ? control.colorScheme.highlightedTextColor : control.colorScheme.textColor anchors.left: control.left anchors.verticalCenter: control.verticalCenter anchors.margins: space.small } - indicator: Maui.ToolButton + indicator: ToolButton { id: _indicatorButton - size: iconSizes.small + icon.width: iconSizes.small enabled: false - iconName: _popup.visible ? "go-up" : "go-down" - iconColor: control.pressed || control.down ? control.colorScheme.highlightedTextColor : control.colorScheme.textColor + icon.name: _popup.visible ? "go-up" : "go-down" + icon.color: control.pressed || control.down ? control.colorScheme.highlightedTextColor : control.colorScheme.textColor anchors.right: control.right anchors.verticalCenter: control.verticalCenter anchors.margins: space.small } delegate: Maui.ListDelegate { label: control.textRole ? (Array.isArray(control.model) ? modelData[control.textRole] : model[control.textRole]) : modelData // highlighted: control.highlightedIndex == index } contentItem: Text { leftPadding: iconButton.width + space.small rightPadding: control.indicator.width + control.spacing text: control.displayText font: control.font color: control.pressed || control.down ? control.colorScheme.highlightedTextColor : control.colorScheme.textColor verticalAlignment: TextInput.AlignVCenter horizontalAlignment: Text.AlignHCenter elide: Text.ElideRight } background: Rectangle { implicitWidth: iconSizes.medium * 2 implicitHeight: iconSizes.medium + space.small color: control.pressed || control.down ? control.colorScheme.highlightColor : control.colorScheme.viewBackgroundColor border.color: control.pressed ? control.colorScheme.highlightColor : control.colorScheme.borderColor border.width: control.visualFocus ? 2 : 1 radius: radiusV } popup: Popup { id: _popup y: control.height + space.small width: control.width // implicitWidth: 100 * unit implicitHeight: contentItem.implicitHeight + space.small padding: unit * 2 z: control.parent.z + 1 contentItem: ListView { clip: true implicitHeight: contentHeight model: control.popup.visible ? control.delegateModel : null currentIndex: control.highlightedIndex ScrollIndicator.vertical: ScrollIndicator { } } background: Rectangle { radius: radiusV color: control.colorScheme.backgroundColor border.color: control.colorScheme.borderColor } } } diff --git a/src/controls/FileDialog.qml b/src/controls/FileDialog.qml index c914b6a..d772862 100644 --- a/src/controls/FileDialog.qml +++ b/src/controls/FileDialog.qml @@ -1,308 +1,303 @@ /* * Copyright 2018 Camilo Higuita * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) 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 Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.9 import QtQuick.Controls 2.2 import org.kde.kirigami 2.6 as Kirigami import org.kde.mauikit 1.0 as Maui import QtQuick.Layouts 1.3 Maui.Dialog { id: control maxHeight: isMobile ? parent.height * 0.95 : unit * 500 maxWidth: unit * 700 page.margins: 0 defaultButtons: false property string initPath property string suggestedFileName : "" property var filters: [] property int filterType: Maui.FMList.NONE property bool onlyDirs: false property int sortBy: Maui.FMList.MODIFIED property bool searchBar : false readonly property var modes : ({OPEN: 0, SAVE: 1}) property int mode : modes.OPEN property var callback : ({}) property alias textField: _textField Maui.Dialog { id: _confirmationDialog // anchors.centerIn: parent acceptButton.text: qsTr("Accept") rejectButton.text: qsTr("Cancel") title: qsTr(textField.text+" already exists!") message: qsTr("If you are sure you want to replace the existing file click on Accept, otherwise click on cancel and change the name of the file to something different...") onAccepted: control.done() onRejected: close() } Maui.Page { id: page anchors.fill: parent leftPadding: 0 margins: 0 rightPadding: leftPadding topPadding: leftPadding bottomPadding: leftPadding headBarExit: false headBar.plegable: false headBarTitleVisible: false headBar.implicitHeight: toolBarHeight + space.medium Component { id: _pathBarComponent Maui.PathBar { anchors.fill: parent // colorScheme.backgroundColor: "#fff" // colorScheme.textColor: "#333" // colorScheme.borderColor: Qt.darker(headBarBGColor, 1.4) onPathChanged: browser.openFolder(path) url: browser.currentPath onHomeClicked: browser.openFolder(Maui.FM.homePath()) onPlaceClicked: browser.openFolder(path) } } Component { id: _searchFieldComponent Maui.TextField { anchors.fill: parent placeholderText: qsTr("Search for files... ") onAccepted: browser.openFolder("Search/"+text) // onCleared: browser.goBack() onGoBackTriggered: { searchBar = false clear() // browser.goBack() } background: Rectangle { border.color: borderColor radius: radiusV } } } headBar.middleContent: Item { id: _pathBarLoader Layout.fillWidth: true Layout.margins: space.medium height: iconSizes.big Loader { anchors.fill: parent sourceComponent: searchBar ? _searchFieldComponent : _pathBarComponent } } - headBar.rightContent: Maui.ToolButton + headBar.rightContent: ToolButton { id: searchButton - iconName: "edit-find" + icon.name: "edit-find" onClicked: searchBar = !searchBar - iconColor: searchBar ? searchButton.colorScheme.highlightColor : searchButton.colorScheme.textColor + checked: searchBar } Kirigami.PageRow { id: pageRow anchors.fill: parent clip: true - property int sidebarWidth: sidebar.isCollapsed ? sidebar.iconSize * 2 : - Kirigami.Units.gridUnit * (isMobile? 15 : 8) - + property int sidebarWidth: Kirigami.Units.gridUnit * (isMobile? 15 : 8) separatorVisible: wideMode initialPage: [sidebar, content] defaultColumnWidth: sidebarWidth // interactive: currentIndex === 1 Maui.PlacesSidebar { - id: sidebar - width: isCollapsed ? iconSize*2 : parent.width - height: parent.height - + id: sidebar onPlaceClicked: { pageRow.currentIndex = 1 browser.openFolder(path) } list.groups: control.mode === modes.OPEN ? [ Maui.FMList.PLACES_PATH, Maui.FMList.CLOUD_PATH, Maui.FMList.REMOTE_PATH, Maui.FMList.DRIVES_PATH, Maui.FMList.TAGS_PATH] : [Maui.FMList.PLACES_PATH, Maui.FMList.REMOTE_PATH, Maui.FMList.CLOUD_PATH, Maui.FMList.DRIVES_PATH] } ColumnLayout { id: content Maui.FileBrowser { id: browser Layout.fillWidth: true Layout.fillHeight: true altToolBars: false previewer.parent: ApplicationWindow.overlay trackChanges: false selectionMode: control.mode === modes.OPEN list.onlyDirs: control.onlyDirs list.filters: control.filters list.sortBy: control.sortBy list.filterType: control.filterType onItemClicked: { switch(control.mode) { case modes.OPEN : { openItem(index) break } case modes.SAVE: { if(Maui.FM.isDir(list.get(index).path)) openItem(index) else textField.text = list.get(index).label break } } } onCurrentPathChanged: { for(var i=0; i < sidebar.count; i++) if(currentPath === sidebar.list.get(i).path) sidebar.currentIndex = i } } Maui.ToolBar { id: _bottomBar position: ToolBar.Footer drawBorder: true Layout.fillWidth: true middleContent: Maui.TextField { id: _textField visible: control.mode === modes.SAVE width: _bottomBar.middleLayout.width * 0.9 placeholderText: qsTr("File name") text: suggestedFileName } rightContent: Row { spacing: space.big Button { id: _acceptButton Kirigami.Theme.textColor: "white" Kirigami.Theme.backgroundColor: suggestedColor text: qsTr("Accept") onClicked: { console.log("CURRENT PATHb", browser.currentPath+"/"+textField.text) if(control.mode === modes.SAVE && Maui.FM.fileExists(browser.currentPath+"/"+textField.text)) { _confirmationDialog.open() }else { done() } } } } } } } } function show(cb) { callback = cb if(initPath) browser.openFolder(initPath) else browser.openFolder(browser.currentPath) open() } function closeIt() { browser.clearSelection() close() } function done() { var paths = browser.selectionBar && browser.selectionBar.visible ? browser.selectionBar.selectedPaths : browser.currentPath if(control.mode === modes.SAVE) { if (typeof paths == 'string') { paths = paths + "/" + textField.text }else { for(var i in paths) paths[i] = paths[i] + "/" + textField.text } } callback(paths) control.closeIt() } } diff --git a/src/controls/FilePreviewer.qml b/src/controls/FilePreviewer.qml index 263f06e..f6234ae 100644 --- a/src/controls/FilePreviewer.qml +++ b/src/controls/FilePreviewer.qml @@ -1,211 +1,211 @@ import QtQuick 2.9 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import org.kde.kirigami 2.6 as Kirigami import org.kde.mauikit 1.0 as Maui import "private" Maui.Dialog { id: control colorScheme.backgroundColor: "#2d2d2d" colorScheme.textColor: "#fafafa" property string currentUrl: "" property var iteminfo : ({}) property bool isDir : false property string mimetype : "" property bool showInfo: true signal shareButtonClicked(string url) maxHeight: unit * 800 maxWidth: unit * 500 defaultButtons: false - footBar.leftContent: Maui.ToolButton + footBar.leftContent: ToolButton { - iconColor: control.colorScheme.textColor - iconName: "document-open" + icon.color: control.colorScheme.textColor + icon.name: "document-open" text: qsTr("Open") onClicked: { if(typeof(previewLoader.item.player) !== "undefined") previewLoader.item.player.stop() openFile(currentUrl) } } footBar.middleContent: [ - Maui.ToolButton + ToolButton { visible: !isDir - iconColor: control.colorScheme.textColor - iconName: "document-share" + icon.color: control.colorScheme.textColor + icon.name: "document-share" text: qsTr("Share") onClicked: { shareButtonClicked(currentUrl) close() } }, - Maui.ToolButton + ToolButton { - iconName: "love" - iconColor: control.colorScheme.textColor + icon.name: "love" + icon.color: control.colorScheme.textColor text: qsTr("Fav") } ] - footBar.rightContent: Maui.ToolButton + footBar.rightContent: ToolButton { - iconName: "documentinfo" + icon.name: "documentinfo" text: qsTr("Info") checkable: true checked: showInfo onClicked: showInfo = !showInfo - iconColor: control.colorScheme.textColor + icon.color: control.colorScheme.textColor } Component { id: imagePreview ImagePreview { id: imagePreviewer } } Component { id: defaultPreview DefaultPreview { id: defaultPreviewer } } Component { id: audioPreview AudioPreview { id: audioPreviewer } } Component { id: videoPreview VideoPreview { id: videoPreviewer } } ColumnLayout { anchors.fill: parent spacing: 0 clip: true Label { Layout.fillWidth: true Layout.margins: space.medium horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: iteminfo.name color: colorScheme.textColor } Loader { id: previewLoader Layout.fillWidth: true Layout.fillHeight: true sourceComponent: switch(mimetype) { case "audio" : audioPreview break case "video" : videoPreview break case "text" : defaultPreview break case "image" : imagePreview break case "inode" : default: defaultPreview } } Maui.TagsBar { id: _tagsBar Layout.fillWidth: true Layout.margins: 0 // height: 64 list.urls: [control.currentUrl] allowEditMode: true clip: true onTagRemovedClicked: list.removeFromUrls(index) onTagsEdited: list.updateToUrls(tags) // colorScheme: control.colorScheme Kirigami.Theme.textColor: control.colorScheme.textColor Kirigami.Theme.backgroundColor: control.colorScheme.backgroundColor onAddClicked: { dialogLoader.sourceComponent = tagsDialogComponent dialog.composerList.urls = [control.currentUrl] dialog.open() } } } onClosed: { if(previewLoader.item.player) previewLoader.item.player.stop() } function show(path) { control.currentUrl = path control.iteminfo = Maui.FM.getFileInfo(path) if(iteminfo.mime.indexOf("/")) control.mimetype = iteminfo.mime.slice(0, iteminfo.mime.indexOf("/")) else control.mimetype = "" control.isDir = mimetype === "inode" showInfo = mimetype === "image" || mimetype === "video" ? false : true console.log("MIME TYPE FOR PREVEIWER", mimetype, iteminfo.icon) open() } } diff --git a/src/controls/PieButton.qml b/src/controls/PieButton.qml index d01e277..a6bc532 100644 --- a/src/controls/PieButton.qml +++ b/src/controls/PieButton.qml @@ -1,100 +1,100 @@ /* * Copyright 2018 Camilo Higuita * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) 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 Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.6 import QtQuick.Controls 2.2 import org.kde.mauikit 1.0 as Maui import org.kde.kirigami 2.0 as Kirigami import "private" -Maui.ToolButton +ToolButton { id: control /* Controlc color scheming */ ColorScheme {id: colorScheme} property alias colorScheme : colorScheme /***************************/ property int alignment : Qt.AlignLeft property int barHeight : 0 property int maxWidth : ApplicationWindow.overlay.width *( isMobile ? 1 : 0.5) property alias content : content.middleContent onClicked: popup.visible ? close(): open() layer.enabled: true clip: true z: 1 Popup { id: popup height: barHeight implicitWidth: content.middleLayout.implicitWidth + space.big + space.small width: implicitWidth > maxWidth ? maxWidth : (content.middleLayout.implicitWidth > ApplicationWindow.overlay.width ? ApplicationWindow.overlay.width : implicitWidth) padding: 0 margins: 0 x: alignment === Qt.AlignLeft ? (control.x - width) - space.big : (control.x + control.width) + space.big y: parent.height / 2 - height / 2 background: Rectangle { radius: radiusV color: colorScheme.backgroundColor border.color: colorScheme.borderColor } onFocusChanged: !activeFocus || !focus ? close() : undefined enter: Transition { // grow_fade_in NumberAnimation { property: "scale"; from: 0.9; to: 1.0; easing.type: Easing.OutQuint; duration: 220 } NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; easing.type: Easing.OutCubic; duration: 150 } } exit: Transition { // shrink_fade_out NumberAnimation { property: "scale"; from: 1.0; to: 0.9; easing.type: Easing.OutQuint; duration: 220 } NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; easing.type: Easing.OutCubic; duration: 150 } } Maui.ToolBar { id: content anchors.fill: parent implicitHeight: parent.height spacing: space.enormous colorScheme.backgroundColor: "transparent" drawBorder: false } } function open() { popup.open() } function close() { popup.close() } } diff --git a/src/controls/SearchBar.qml b/src/controls/SearchBar.qml index 7df4ae4..f507b08 100644 --- a/src/controls/SearchBar.qml +++ b/src/controls/SearchBar.qml @@ -1,57 +1,57 @@ /* * Copyright 2018 Camilo Higuita * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) 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 Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.9 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.2 import QtQuick.Controls.Material 2.1 import org.kde.kirigami 2.2 as Kirigami import org.kde.mauikit 1.0 as Maui Maui.ToolBar { id: control height: 30 width: 30 signal search(string query) - leftContent: Maui.ToolButton + leftContent: ToolButton { - iconName: "view-filter" + icon.name: "view-filter" } middleContent: Maui.TextField { id: searchInput placeholderText: qsTr("Search...") width: footBar.middleLayout.width * 0.9 onAccepted: search(searchInput.text) } - rightContent : Maui.ToolButton + rightContent : ToolButton { - iconName: "edit-clear" + icon.name: "edit-clear" Layout.alignment: Qt.AlignRight onClicked: searchInput.clear() } } diff --git a/src/controls/Store.qml b/src/controls/Store.qml index 0630ffa..4d02572 100644 --- a/src/controls/Store.qml +++ b/src/controls/Store.qml @@ -1,594 +1,592 @@ import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import QtQuick 2.9 import org.kde.kirigami 2.0 as Kirigami import org.kde.mauikit 1.0 as Maui import StoreModel 1.0 import StoreList 1.0 import "private" Maui.Page { id: control /*props*/ property int itemSize : isMobile ? iconSizes.huge * 1.5 : iconSizes.enormous property int itemSpacing: isMobile ? space.medium : space.big property int itemRadius : unit * 6 property bool showLabels : true property bool fitPreviews : false property bool detailsView : false property alias holder: holder property alias list : _storeList property alias model: _storeModel property alias layout : _layoutLoader.item /*signals*/ signal openFile(string filePath) signal fileReady(var item) floatingBar: false footBarOverlap: false footBar.drawBorder: false headBar.drawBorder: false altToolBars: false headBarExit: false headBar.visible: !holder.visible margins: control.detailsView ? 0 : space.big StoreModel { id: _storeModel list: _storeList } StoreList { id: _storeList limit : 20 onDownloadReady: { notify("dialog-information", "Download ready...", item.label + " is ready to use.\nFile has been saved in your machine at:\n"+item.path, function() { openFile(item.path) }) fileReady(item) } } footBar.middleContent: [ - Maui.ToolButton + ToolButton { id: _previousPageButton - iconName: "go-previous" - tooltipText: qsTr("Previous") + icon.name: "go-previous" + text: qsTr("Previous") enabled: _storeList.contentReady onClicked: { _storeList.page = _storeList.page === 0 ? 0 : _storeList.page-1 } }, Label { color: control.colorScheme.textColor text: _storeList.page font.bold: true font.weight: Font.Bold font.pointSize: fontSizes.big enabled: _storeList.contentReady anchors.verticalCenter: _previousPageButton.verticalCenter }, - Maui.ToolButton + ToolButton { id: _nextPageButton - iconName: "go-next" - tooltipText: qsTr("Next") + icon.name: "go-next" + text: qsTr("Next") enabled: _storeList.contentReady onClicked: { _storeList.page = _storeList.page+1 } } ] headBar.middleContent: Maui.TextField { Layout.fillWidth: true placeholderText: qsTr("Search...") onAccepted: _storeList.query = text onCleared: _storeList.query = "" } footBar.rightContent: [ - Maui.ToolButton + ToolButton { id:_filterButton - iconName: "view-filter" - iconColor: _filterDrawer.visible ? colorScheme.highlightColor : colorScheme.textColor + icon.name: "view-filter" + icon.color: _filterDrawer.visible ? colorScheme.highlightColor : colorScheme.textColor onClicked: _filterDrawer.visible ? _filterDrawer.close() : _filterDrawer.open() } ] footBar.leftContent: [ - Maui.ToolButton - { - - iconName: control.detailsView ? "view-list-icons" : "view-list-details" + ToolButton + { + icon.name: control.detailsView ? "view-list-icons" : "view-list-details" onClicked: control.detailsView = !control.detailsView }, - Maui.ToolButton + ToolButton { id:_sortButton - iconName: "view-sort" + icon.name: "view-sort" onClicked: sortMenu.popup() - Maui.Menu + Menu { id: sortMenu - Maui.MenuItem + MenuItem { text: qsTr("Title") checkable: true checked: _storeList.sortBy === StoreList.LABEL onTriggered: _storeList.sortBy = StoreList.LABEL } - Maui.MenuItem + MenuItem { text: qsTr("Rating") checkable: true checked: _storeList.sortBy === StoreList.RATE onTriggered: _storeList.sortBy = StoreList.RATE } - Maui.MenuItem + MenuItem { text: qsTr("Downloads") checkable: true checked: _storeList.sortBy === StoreList.COUNT onTriggered: _storeList.sortBy = StoreList.COUNT } - Maui.MenuItem + MenuItem { text: qsTr("Newest") checkable: true checked: _storeList.sortBy === StoreList.DATE onTriggered: _storeList.sortBy = StoreList.DATE } } } ] Maui.Holder { id: holder visible: _storeList.contentEmpty emojiSize: iconSizes.huge emoji: if(!_storeList.contentReady) "qrc:/assets/animat-diamond-color.gif" else "qrc:/assets/ElectricPlug.png" isGif: !_storeList.contentReady isMask: false title : if(!_storeList.contentReady) qsTr("Loading content!") else qsTr("Nothing here") body: if(!_storeList.contentReady) qsTr("Almost ready!") else qsTr("Make sure you're online and your cloud account is working") } Component { id: gridDelegate StoreDelegate { id: delegate isDetails: control.detailsView showDetailsInfo: control.detailsView showLabel: control.showLabels height: control.detailsView ? control.itemSize * 0.5 : layout.cellHeight * 0.9 width: control.detailsView ? control.width : layout.cellWidth * 0.9 fitImage: control.fitPreviews Connections { target: delegate onClicked: { layout.currentIndex = index _previewerDialog.open() } } } } Component { id: listViewBrowser Maui.ListBrowser { showEmblem: false leftEmblem: "list-add" showDetailsInfo: true model: _storeModel delegate: gridDelegate section.delegate: Maui.LabelDelegate { id: delegate label: section labelTxt.font.pointSize: fontSizes.big isSection: true boldLabel: true height: toolBarHeightAlt } } } Component { id: gridViewBrowser Maui.GridBrowser { height: parent.height width: parent.width adaptContent: true itemSize: control.itemSize spacing: control.itemSpacing cellWidth: control.itemSize cellHeight: control.itemSize model: _storeModel delegate: gridDelegate } } Loader { id: _layoutLoader anchors.fill: parent sourceComponent: control.detailsView ? listViewBrowser : gridViewBrowser } Maui.Drawer { id: _filterDrawer y: 0 // height: parent.height - footBar.implicitHeight - headBar.implicitHeight edge: Qt.RightEdge bg: control // parent: control height: parent.height - (footBar.height) ListView { id: _filterList anchors.fill: parent anchors.margins: space.medium model: ListModel{id: _filterModel} delegate: Maui.ListDelegate { id: delegate radius: radiusV Connections { target: delegate onClicked: { _filterList.currentIndex = index } } } focus: true interactive: true highlightFollowsCurrentItem: true highlightMoveDuration: 0 } } Component.onCompleted: { var list = _storeList.getCategoryList() for(var i in list) _filterModel.append(list[i]) } Maui.Dialog { id: _previewerDialog property var currentItem : ({}) maxHeight: parent.height maxWidth: unit * 800 page.margins: 0 acceptButton.text: qsTr("Download") rejectButton.visible: false - footBar.rightContent: Maui.Button + footBar.rightContent: Button { id: _openButton text: qsTr("Open...") onClicked: { openFile(_storeList.itemLocalPath(layout.currentIndex)) _previewerDialog.close() } } - footBar.leftContent: [ - + footBar.leftContent: [ - Maui.ToolButton + ToolButton { id: _linkButton - iconName: "view-links" + icon.name: "view-links" onClicked: Maui.FM.openUrl(_previewerDialog.currentItem.source) } ] onAccepted: { _storeList.download(layout.currentIndex) _previewerDialog.close() } ColumnLayout { anchors.fill: parent spacing: 0 ListView { id: _previewerList Layout.fillWidth: true Layout.preferredHeight: parent.height * 0.5 Layout.margins: 0 orientation: ListView.Horizontal clip: true focus: true interactive: true // currentIndex: currentTrackIndex highlightFollowsCurrentItem: true highlightMoveDuration: 0 snapMode: ListView.SnapOneItem model: ListModel { id: _previewerModel } delegate: ItemDelegate { id: delegate height: _previewerList.height width: _previewerList.width background: Rectangle { } Maui.ImageViewer { clip: true anchors.top: parent.top anchors.horizontalCenter: parent.horizontalCenter anchors.verticalCenter: parent.verticalCenter image.source: model.thumbnail image.horizontalAlignment: Qt.AlignHCenter image.verticalAlignment: Qt.AlignVCenter image.fillMode: Image.PreserveAspectCrop image.cache: false image.asynchronous: true height: Math.min( parent.height, image.sourceSize.height) width: Math.min( parent.width, image.sourceSize.width) // sourceSize.width: Math.min(width, sourceSize.width) // sourceSize.height: Math.min(height, sourceSize.height) } Rectangle { height: iconSizes.medium width: height anchors { horizontalCenter: parent.horizontalCenter bottom: parent.bottom margins: space.big } color: viewBackgroundColor radius: Math.max(height, width) Label { anchors.fill: parent text: index horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter color: textColor font.bold: true font.weight: Font.bold font.pointSize: fontSizes.big } } } } Label { Layout.fillWidth: true Layout.preferredHeight: rowHeight wrapMode: Text.Wrap elide: Qt.ElideRight text: _previewerDialog.currentItem.label horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter color: textColor font.bold: true font.weight: Font.bold font.pointSize: fontSizes.big } Label { Layout.fillWidth: true Layout.preferredHeight: rowHeightAlt wrapMode: Text.Wrap elide: Qt.ElideRight text: _previewerDialog.currentItem.owner horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter color: textColor font.pointSize: fontSizes.small opacity: 0.5 } Label { Layout.fillWidth: true Layout.leftMargin: space.big Layout.preferredHeight: rowHeightAlt wrapMode: Text.Wrap elide: Qt.ElideRight text: qsTr("Rating: ") + _previewerDialog.currentItem.rate horizontalAlignment: Qt.AlignLeft verticalAlignment: Qt.AlignVCenter color: textColor font.pointSize: fontSizes.small } Label { Layout.fillWidth: true Layout.leftMargin: space.big Layout.preferredHeight: rowHeightAlt wrapMode: Text.Wrap elide: Qt.ElideRight text: qsTr("Downloads: ") + _previewerDialog.currentItem.count horizontalAlignment: Qt.AlignLeft verticalAlignment: Qt.AlignVCenter color: textColor font.pointSize: fontSizes.small } // Label // { // Layout.fillWidth: true // Layout.leftMargin: space.big // // Layout.preferredHeight: rowHeightAlt // wrapMode: Text.Wrap // elide: Qt.ElideRight // text: qsTr("License: ") + _previewerDialog.currentItem.license // horizontalAlignment: Qt.AlignLeft // verticalAlignment: Qt.AlignVCenter // color: textColor // font.pointSize: fontSizes.small // } Label { Layout.fillWidth: true Layout.leftMargin: space.big Layout.preferredHeight: rowHeightAlt wrapMode: Text.Wrap elide: Qt.ElideRight text: qsTr("Date: ") + _previewerDialog.currentItem.date horizontalAlignment: Qt.AlignLeft verticalAlignment: Qt.AlignVCenter color: textColor font.pointSize: fontSizes.small } Label { Layout.fillWidth: true Layout.preferredHeight: rowHeightAlt Layout.leftMargin: space.big wrapMode: Text.Wrap elide: Qt.ElideRight text: qsTr("Tags: ") + _previewerDialog.currentItem.tag horizontalAlignment: Qt.AlignLeft verticalAlignment: Qt.AlignVCenter color: textColor font.pointSize: fontSizes.small } Label { Layout.fillWidth: true Layout.fillHeight: true Layout.leftMargin: space.big text: _previewerDialog.currentItem.description horizontalAlignment: Qt.AlignLeft verticalAlignment: Qt.AlignVCenter color: textColor wrapMode: Text.Wrap elide: Qt.ElideRight font.pointSize: fontSizes.default } } onOpened: { _openButton.visible = _storeList.fileExists(layout.currentIndex) var item = _storeList.get(layout.currentIndex) _previewerDialog.currentItem = item var list = [item.url, item.thumbnail, item.thumbnail_1, item.thumbnail_2 , item.thumbnail_3] _previewerModel.clear() for(var i in list) _previewerModel.append({thumbnail : list[i]}) } } } diff --git a/src/controls/SyncDialog.qml b/src/controls/SyncDialog.qml index 290d3af..5839906 100644 --- a/src/controls/SyncDialog.qml +++ b/src/controls/SyncDialog.qml @@ -1,105 +1,105 @@ /* * Copyright 2018 Camilo Higuita * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) 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 Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.0 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import org.kde.mauikit 1.0 as Maui Maui.Dialog { id: control property bool customServer: false acceptText: qsTr("Sign In") rejectText: qsTr("Cancel") rejectButton.visible: false property alias serverField: serverField property alias userField: userField property alias passwordField: passwordField maxHeight: unit * 300 maxWidth: maxHeight - footBar.leftContent: Maui.ToolButton + footBar.leftContent: ToolButton { - iconName: "filename-space-amarok" + icon.name: "filename-space-amarok" // text: qsTr("Custom server") checkable: true checked: customServer onClicked: customServer = !customServer } onRejected: close() Item { anchors.fill: parent ColumnLayout { anchors.centerIn: parent width: parent.width Image { visible: !customServer Layout.alignment: Qt.AlignCenter Layout.preferredWidth: width Layout.preferredHeight: height Layout.margins: space.big width: iconSizes.huge height: width sourceSize.width: width sourceSize.height: height source: "qrc:/assets/opendesktop.png" } Maui.TextField { id: serverField visible: customServer Layout.fillWidth: true placeholderText: qsTr("Server address...") text: "https://cloud.opendesktop.cc/remote.php/webdav/" } Maui.TextField { id: userField Layout.fillWidth: true placeholderText: qsTr("User name...") inputMethodHints: Qt.ImhNoAutoUppercase } Maui.TextField { id: passwordField Layout.fillWidth: true placeholderText: qsTr("User password...") echoMode: TextInput.PasswordEchoOnEdit inputMethodHints: Qt.ImhNoAutoUppercase } } } } diff --git a/src/controls/TagsBar.qml b/src/controls/TagsBar.qml index cfa7fc8..bd064a9 100644 --- a/src/controls/TagsBar.qml +++ b/src/controls/TagsBar.qml @@ -1,179 +1,179 @@ /* * Copyright 2018 Camilo Higuita * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) 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 Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.0 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import org.kde.kirigami 2.6 as Kirigami import org.kde.mauikit 1.0 as Maui import "private" Item { id: control clip : true width: parent.width height: rowHeight property alias listView : tagsList property alias count : tagsList.count property color bgColor: "transparent" property bool editMode : false property bool allowEditMode : false property alias list : tagsList.list signal addClicked() signal tagRemovedClicked(int index) signal tagClicked(string tag) signal tagsEdited(var tags) Rectangle { anchors.fill: parent color: bgColor z: -1 } RowLayout { anchors.fill: parent spacing: 0 Item { Layout.fillHeight: true Layout.fillWidth: true visible: !editMode RowLayout { anchors.fill: parent spacing: 0 - Maui.ToolButton + ToolButton { Layout.alignment: Qt.AlignLeft visible: allowEditMode - iconName: "list-add" + icon.name: "list-add" onClicked: addClicked() - iconColor: control.Kirigami.Theme.textColor + icon.color: control.Kirigami.Theme.textColor } TagList { id: tagsList Layout.leftMargin: contentMargins Layout.alignment: Qt.AlignCenter Layout.fillHeight: true Layout.fillWidth: true showPlaceHolder: allowEditMode showDeleteIcon: allowEditMode onTagRemoved: tagRemovedClicked(index) onTagClicked: control.tagClicked(tagsList.model.get(index).tag) Kirigami.Theme.textColor: control.colorScheme.textColor Kirigami.Theme.backgroundColor: control.colorScheme.backgroundColor MouseArea { anchors.fill: parent z: tagsList.z -1 propagateComposedEvents: true onClicked: if(allowEditMode) goEditMode() } } } } Item { Layout.fillHeight: true Layout.fillWidth: true visible: editMode RowLayout { anchors.fill: parent spacing: 0 Item { Layout.fillHeight: true Layout.fillWidth:true Layout.leftMargin: space.medium // Layout.margins: space.big TextInput { id: editTagsEntry anchors.fill: parent horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter selectByMouse: !isMobile focus: true wrapMode: TextEdit.Wrap color: colorScheme.textColor selectionColor: highlightColor selectedTextColor: highlightedTextColor onFocusChanged: editMode = false onAccepted: saveTags() } } - Maui.ToolButton + ToolButton { Layout.alignment: Qt.AlignLeft - iconName: "checkbox" + icon.name: "checkbox" onClicked: saveTags() } } } } function clear() { // tagsList.model.clear() } function goEditMode() { var currentTags = [] for(var i = 0 ; i < tagsList.count; i++) currentTags.push(list.get(i).tag) editTagsEntry.text = currentTags.join(", ") editMode = true editTagsEntry.forceActiveFocus() } function saveTags() { tagsEdited(getTags()) editMode = false } function getTags() { var tags = [] if(editTagsEntry.text.trim().length > 0) { var list = editTagsEntry.text.split(",") if(list.length > 0) for(var i in list) tags.push(list[i].trim()) } return tags } } diff --git a/src/controls/TagsDialog.qml b/src/controls/TagsDialog.qml index c445721..87d7b74 100644 --- a/src/controls/TagsDialog.qml +++ b/src/controls/TagsDialog.qml @@ -1,196 +1,196 @@ import QtQuick 2.0 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import org.kde.mauikit 1.0 as Maui import TagsModel 1.0 import TagsList 1.0 Maui.Dialog { property var urls : [] property alias taglist :_tagsList property alias listView: _listView property alias composerList: tagListComposer.list signal tagsReady(var tags) defaultButtons: true maxHeight: unit * 500 onAccepted: setTags() onRejected: close() headBar.plegable: false - headBar.leftContent: Maui.ToolButton + headBar.leftContent: ToolButton { - iconName: "view-sort" - tooltipText: qsTr("Sort by...") + icon.name: "view-sort" + text: qsTr("Sort by...") onClicked: sortMenu.popup() Menu { id: sortMenu MenuItem { text: qsTr("Name") checkable: true checked: _tagsList.sortBy === TagsList.TAG onTriggered: _tagsList.sortBy = TagsList.TAG } MenuItem { text: qsTr("Date") checkable: true checked: _tagsList.sortBy === TagsList.ADD_DATE onTriggered: _tagsList.sortBy = TagsList.ADD_DATE } } } headBar.middleContent: Maui.TextField { id: tagText width: headBar.middleLayout.width * 0.9 placeholderText: qsTr("New tags...") onAccepted: { var tags = tagText.text.split(",") for(var i in tags) { var myTag = tags[i].trim() _tagsList.insert(myTag) tagListComposer.list.append(myTag) } clear() } } - headBar.rightContent: Maui.ToolButton + headBar.rightContent: ToolButton { - iconName: "view-refresh" - tooltipText: qsTr("Refresh...") + icon.name: "view-refresh" +// text: qsTr("Refresh...") onClicked: taglist.refresh() } ColumnLayout { anchors.fill: parent Item { Layout.fillHeight: true Layout.fillWidth: true ListView { id: _listView clip: true anchors.fill: parent signal tagClicked(int index) focus: true interactive: true highlightFollowsCurrentItem: true highlightMoveDuration: 0 TagsModel { id: _tagsModel list: _tagsList } TagsList { id: _tagsList } Maui.Holder { id: holder emoji: "qrc:/img/assets/Electricity.png" visible: _listView.count === 0 isMask: false title : "No tags!" body: "Start tagging your pics" emojiSize: iconSizes.huge } model: _tagsModel delegate: Maui.ListDelegate { id: delegate label: tag radius: radiusV Connections { target: delegate onClicked: { _listView.currentIndex = index tagListComposer.list.append(_tagsList.get(index).tag) } } } } } Maui.TagList { id: tagListComposer Layout.fillWidth: true Layout.leftMargin: contentMargins Layout.rightMargin: contentMargins height: 64 width: parent.width onTagRemoved: list.remove(index) placeholderText: "" } } function setTags() { var tags = [] for(var i = 0; i < tagListComposer.count; i++) tags.push(tagListComposer.list.get(i).tag) tagsReady(tags) close() } // function show(urls) // { // control.urls = urls // tagListComposer.list.urls = picUrls // // open() // } // // // function addTagsToPic(urls, tags) // { // if(tags.length < 1) // return // // for(var j in urls) // { // var url = urls[j] // // if(!dba.checkExistance("images", "url", url)) // if(!dba.addPic(url)) // return // // for(var i in tags) // if(PIX.addTagToPic(tags[i], url)) // picTagged(tags[i], url) // // } // close() // } } diff --git a/src/controls/private/AudioPreview.qml b/src/controls/private/AudioPreview.qml index 96159fc..f3a029e 100644 --- a/src/controls/private/AudioPreview.qml +++ b/src/controls/private/AudioPreview.qml @@ -1,383 +1,382 @@ import QtQuick 2.9 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import QtMultimedia 5.8 import org.kde.mauikit 1.0 as Maui ColumnLayout { id: layout anchors.fill: parent property alias player: player // Rectangle // { // Layout.fillWidth: true // Layout.fillHeight: true // color: "yellow" // height: 300 // } Item { Layout.fillWidth: true // Layout.fillHeight: true Layout.preferredHeight: parent.width * 0.3 Layout.margins: contentMargins MediaPlayer { id: player source: "file://"+currentUrl autoLoad: true autoPlay: true } - Maui.ToolButton + ToolButton { anchors.centerIn: parent - isMask: false flat: true - size: iconSizes.huge - iconName: iteminfo.icon - iconFallback: "qrc:/assets/application-x-zerosize.svg" + icon.width: iconSizes.huge + icon.name: iteminfo.icon + icon.source: "qrc:/assets/application-x-zerosize.svg" onClicked: player.playbackState === MediaPlayer.PlayingState ? player.pause() : player.play() } Rectangle { height: iconSizes.big width: height radius: height color: "black" anchors.centerIn: parent - Maui.ToolButton + ToolButton { anchors.centerIn: parent - iconName: player.playbackState === MediaPlayer.PlayingState ? "media-playback-pause" : "media-playback-start" - iconColor: "white" + icon.name: player.playbackState === MediaPlayer.PlayingState ? "media-playback-pause" : "media-playback-start" + icon.color: "white" onClicked: player.playbackState === MediaPlayer.PlayingState ? player.pause() : player.play() } } } Item { visible: showInfo Layout.fillWidth: true Layout.fillHeight: true ScrollView { anchors.fill: parent contentHeight: _columnInfo.implicitHeight ColumnLayout { id: _columnInfo width: parent.width spacing: space.large // spacing: rowHeight Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.mime text: qsTr("Title") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.title color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.date text: qsTr("Artist") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.albumArtist color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.modified text: qsTr("Album") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.albumTitle color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.owner text: qsTr("Author") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.author color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.tags text: qsTr("Codec") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.audioCodec color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.permissions text: qsTr("Copyright") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.copyright color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.permissions text: qsTr("Duration") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.duration color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.permissions text: qsTr("Track") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.trackNumber color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.permissions text: qsTr("Year") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.year color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.permissions text: qsTr("Rating") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.userRating color: colorScheme.textColor } } } } } } diff --git a/src/controls/private/DefaultPreview.qml b/src/controls/private/DefaultPreview.qml index d21b7be..8e78798 100644 --- a/src/controls/private/DefaultPreview.qml +++ b/src/controls/private/DefaultPreview.qml @@ -1,231 +1,230 @@ import QtQuick 2.9 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import org.kde.mauikit 1.0 as Maui Item { anchors.fill: parent ColumnLayout { anchors.fill: parent Item { Layout.fillWidth: true Layout.preferredHeight: iconSizes.huge + space.big Layout.margins: contentMargins - Maui.ToolButton + ToolButton { anchors.centerIn: parent - isMask: false flat: true - size: iconSizes.huge - iconName: iteminfo.icon + icon.width: iconSizes.huge + icon.name: iteminfo.icon } } Item { Layout.fillWidth: true Layout.fillHeight: true ScrollView { anchors.fill: parent contentHeight: _columnInfo.implicitHeight ColumnLayout { id: _columnInfo width: parent.width spacing: space.large // spacing: rowHeight Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.mime text: qsTr("Type") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: iteminfo.mime color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.date text: qsTr("Date") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: iteminfo.date color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.modified text: qsTr("Modified") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: iteminfo.modified color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.owner text: qsTr("Owner") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: iteminfo.owner color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.tags text: qsTr("Tags") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: iteminfo.tags color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.permissions text: qsTr("Permissions") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: iteminfo.permissions color: colorScheme.textColor } } } } } } } diff --git a/src/controls/private/PieButtonDelegate.qml b/src/controls/private/PieButtonDelegate.qml index 8d2560c..52511db 100644 --- a/src/controls/private/PieButtonDelegate.qml +++ b/src/controls/private/PieButtonDelegate.qml @@ -1,48 +1,48 @@ import QtQuick 2.6 import QtQuick.Controls 2.2 import QtGraphicalEffects 1.0 import org.kde.mauikit 1.0 as Maui ItemDelegate { id: control property bool isCurrent: PathView.isCurrentItem property alias size : controlIcon.size background: Rectangle { color: "transparent" } DropShadow { anchors.fill: bg visible: bg.visible horizontalOffset: 0 verticalOffset: 3 radius: 8.0 samples: 17 color: "#80000000" source: bg } Rectangle { id: bg anchors.fill: parent color: isCurrent ? highlightColor : viewBackgroundColor radius: Math.max(control.height, control.width) } - Maui.ToolButton + ToolButton { id: controlIcon anchors.centerIn: parent enabled: false - iconName: model.iconName + icon.name: model.iconName text: model.text - iconColor: isCurrent ? highlightedTextColor : textColor + icon.color: isCurrent ? highlightedTextColor : textColor } } diff --git a/src/controls/private/StoreDelegate.qml b/src/controls/private/StoreDelegate.qml index 2ae2751..cc450aa 100644 --- a/src/controls/private/StoreDelegate.qml +++ b/src/controls/private/StoreDelegate.qml @@ -1,324 +1,323 @@ /* * Copyright 2018 Camilo Higuita * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) 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 Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ import QtQuick 2.0 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import org.kde.kirigami 2.2 as Kirigami import org.kde.mauikit 1.0 as Maui import QtGraphicalEffects 1.0 ItemDelegate { id: control property bool isDetails : false property bool showDetailsInfo: false property int emblemSize: iconSizes.medium property bool isHovered : hovered property bool showLabel : true property bool showEmblem : true property bool showSelectionBackground : true property bool showTooltip : false property bool showThumbnails : false property bool emblemAdded : false property bool keepEmblemOverlay : false property bool isCurrentListItem : ListView.isCurrentItem property bool fitImage : true property color labelColor : (isCurrentListItem || GridView.isCurrentItem || (keepEmblemOverlay && emblemAdded)) && !hovered && showSelectionBackground ? highlightedTextColor : textColor property color hightlightedColor : GridView.isCurrentItem || hovered || (keepEmblemOverlay && emblemAdded) ? highlightColor : "transparent" property string rightEmblem property string leftEmblem : "list-add" signal rightClicked() signal emblemClicked(int index) signal rightEmblemClicked(int index) signal leftEmblemClicked(int index) focus: true clip: true hoverEnabled: !isMobile background: Rectangle { color: !isDetails? "transparent" : (isCurrentListItem ? highlightColor : index % 2 === 0 ? Qt.lighter(backgroundColor,1.2) : backgroundColor) } MouseArea { anchors.fill: parent acceptedButtons: Qt.RightButton onClicked: { if(!isMobile && mouse.button === Qt.RightButton) rightClicked() } } Maui.Badge { id: leftEmblemIcon iconName: leftEmblem visible: (isHovered || keepEmblemOverlay) && showEmblem && leftEmblem z: 999 anchors.top: parent.top anchors.left: parent.left onClicked: leftEmblemClicked(index) // Component.onCompleted: leftEmblemIcon.item.isMask = false size: iconSizes.small } Maui.Badge { id: rightEmblemIcon iconName: rightEmblem visible: (isHovered || keepEmblemOverlay) && showEmblem && rightEmblem z: 999 size: iconSizes.medium anchors.top: parent.top anchors.right: parent.right onClicked: rightEmblemClicked(index) } Component { id: imgComponent Item { anchors.fill: parent Image { id: img clip: true anchors.centerIn: parent source: model.thumbnail height: parent.height width: isDetails ? parent.width : control.width * 0.9 sourceSize.width: width sourceSize.height: height horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter fillMode: fitImage ? Image.PreserveAspectFit : Image.PreserveAspectCrop cache: true asynchronous: true layer.enabled: true layer.effect: OpacityMask { maskSource: Item { width: img.sourceSize.width height: img.sourceSize.height Rectangle { anchors.centerIn: parent width: img.sourceSize.width height: img.sourceSize.height radius: radiusV } } } } Loader { anchors.centerIn: parent sourceComponent: img.status === Image.Ready ? undefined : iconComponent } } } Component { id: iconComponent - Maui.ToolButton + ToolButton { - iconName: model.icon - iconFallback: "qrc:/assets/application-x-zerosize.svg" - isMask: size <= iconSizes.medium - iconColor: labelColor - size: Math.min(iconSizes.huge, Math.min(control.width, control.height)) + icon.name: model.icon + icon.source: "qrc:/assets/application-x-zerosize.svg" + icon.color: (size <= iconSizes.medium ? "transparent" : labelColor) + icon.width: Math.min(iconSizes.huge, Math.min(control.width, control.height)) enabled: false } } Component { id: labelComponent Item { anchors.fill: parent Label { id: label text: model.label width: parent.width height: parent.height horizontalAlignment: isDetails? Qt.AlignLeft : Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.default color: labelColor Rectangle { visible: parent.visible && showSelectionBackground && !isDetails anchors.fill: parent z: -1 radius: radiusV color: hightlightedColor opacity: hovered ? 0.25 : 0.5 } } } } Component { id: detailsComponent RowLayout { anchors.fill: parent ColumnLayout { Layout.fillHeight: true Layout.fillWidth: true Layout.alignment: Qt.AlignRight width: parent.width height: parent.height Label { Layout.alignment: Qt.AlignRight Layout.fillWidth: true Layout.fillHeight: true horizontalAlignment: Qt.AlignRight verticalAlignment: Qt.AlignBottom elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.small color: labelColor opacity: isCurrentListItem ? 1 : 0.5 text: model.owner } Label { Layout.alignment: Qt.AlignRight Layout.fillWidth: true Layout.fillHeight: true text: model.description horizontalAlignment: Qt.AlignRight verticalAlignment: Qt.AlignTop elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.small color: labelColor opacity: isCurrentListItem ? 1 : 0.5 } } } } GridLayout { id: delegatelayout anchors.fill: parent rows: isDetails ? 1 : 2 columns: isDetails && showDetailsInfo ? 3 : (isDetails && !showDetailsInfo ? 2 : 1) rowSpacing: space.tiny columnSpacing: space.tiny Item { Layout.fillHeight: true Layout.fillWidth: true Layout.maximumHeight: parent.height * 0.8 Layout.maximumWidth: isDetails ? parent.height * 0.8 : parent.width Layout.row: 1 Layout.column: 1 Layout.alignment: Qt.AlignCenter Layout.leftMargin: isDetails ? space.medium : 0 Loader { id: loader anchors.centerIn: parent anchors.fill: parent sourceComponent: imgComponent } ToolTip.delay: 1000 ToolTip.timeout: 5000 ToolTip.visible: hovered && showTooltip ToolTip.text: model.tooltip ? model.tooltip : model.path } Loader { id: labelLoader Layout.fillWidth: true Layout.fillHeight: !isDetails Layout.maximumHeight: (isDetails ? parent.height : parent.height * 0.2) Layout.minimumHeight: (isDetails ? parent.height : parent.height * 0.1) Layout.preferredHeight: (isDetails ? parent.height : parent.height * 0.2) Layout.row: isDetails ? 1 : 2 Layout.column: isDetails ? 2 : 1 Layout.leftMargin: isDetails ? space.medium : 0 sourceComponent: labelComponent } Loader { id: detailsInfoLoader sourceComponent: isDetails && showDetailsInfo ? detailsComponent : undefined Layout.fillWidth: isDetails && showDetailsInfo Layout.maximumHeight: isDetails ? (showDetailsInfo ? parent.height : fontSizes.default * 5) : undefined Layout.minimumHeight: isDetails ? ( showDetailsInfo ? parent.height : control.height - space.tiny) : undefined Layout.preferredHeight: isDetails ? (showDetailsInfo ? parent.height : control.height - space.tiny) : undefined Layout.maximumWidth: control.width * (isMobile ? 0.5 : 0.3) Layout.row: isDetails && showDetailsInfo ? 1 : 2 Layout.column: isDetails && showDetailsInfo ? 3 : 0 Layout.rightMargin: space.medium // Layout.leftMargin: isDetails ? space.medium : 0 } } } diff --git a/src/controls/private/TagDelegate.qml b/src/controls/private/TagDelegate.qml index 06ac4be..2164c32 100644 --- a/src/controls/private/TagDelegate.qml +++ b/src/controls/private/TagDelegate.qml @@ -1,84 +1,84 @@ import QtQuick 2.0 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import org.kde.mauikit 1.0 as Maui ItemDelegate { id: control /* Controlc color scheming */ ColorScheme {id: colorScheme} property alias colorScheme : colorScheme /***************************/ clip: true property int tagWidth: iconSizes.medium * 5 property int tagHeight: iconSizes.medium property bool showDeleteIcon: true signal removeTag(int index) hoverEnabled: !isMobile height: tagHeight width: tagWidth anchors.verticalCenter: parent.verticalCenter ToolTip.visible: hovered ToolTip.text: model.tag background: Image { source: "qrc:/assets/tag.svg" sourceSize.width: tagWidth sourceSize.height: tagHeight width: tagWidth height: tagHeight } RowLayout { anchors.fill: parent Item { Layout.fillHeight: true Layout.fillWidth: true Layout.leftMargin: tagWidth *0.2 Label { id: tagLabel text: tag height: parent.height width: parent.width anchors.centerIn: parent verticalAlignment: Qt.AlignVCenter horizontalAlignment: Qt.AlignHCenter elide: Qt.ElideRight font.pointSize: fontSizes.medium color: colorScheme.textColor } } Item { Layout.fillHeight: true width: showDeleteIcon? iconSizes.small : 0 Layout.maximumWidth: iconSizes.small Layout.margins: space.small - Maui.ToolButton + ToolButton { anchors.centerIn: parent visible: showDeleteIcon - iconName: "window-close" - size: iconSizes.small + icon.name: "window-close" + icon.width: iconSizes.small onClicked: removeTag(index) - iconColor: colorScheme.textColor + icon.color: colorScheme.textColor } } } } diff --git a/src/controls/private/VideoPreview.qml b/src/controls/private/VideoPreview.qml index 8af6c5a..e16487a 100644 --- a/src/controls/private/VideoPreview.qml +++ b/src/controls/private/VideoPreview.qml @@ -1,383 +1,382 @@ import QtQuick 2.9 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.3 import QtMultimedia 5.8 import org.kde.mauikit 1.0 as Maui ColumnLayout { anchors.fill: parent property alias player: player Item { Layout.fillWidth: true Layout.fillHeight: true Layout.margins: 0 - Maui.ToolButton + ToolButton { anchors.centerIn: parent - isMask: false + icon.color: "transparent" flat: true - size: iconSizes.huge - iconName: iteminfo.icon + icon.width: iconSizes.huge + icon.name: iteminfo.icon } Video { id: player anchors.centerIn: parent anchors.fill: parent source: "file://"+currentUrl autoLoad: true autoPlay: true } MouseArea { anchors.fill: parent onClicked: player.playbackState === MediaPlayer.PlayingState ? player.pause() : player.play() } Rectangle { height: iconSizes.big width: height radius: height color: "black" anchors.centerIn: parent - Maui.ToolButton + ToolButton { anchors.centerIn: parent - iconName: player.playbackState === MediaPlayer.PlayingState ? "media-playback-pause" : "media-playback-start" - iconColor: "white" + icon.name: player.playbackState === MediaPlayer.PlayingState ? "media-playback-pause" : "media-playback-start" + icon.color: "white" onClicked: player.playbackState === MediaPlayer.PlayingState ? player.pause() : player.play() } } } Item { visible: showInfo Layout.fillWidth: visible Layout.fillHeight: visible Layout.minimumHeight: control.height * 0.3 ScrollView { anchors.fill: parent contentHeight: _columnInfo.implicitHeight ColumnLayout { id: _columnInfo width: parent.width spacing: space.large // spacing: rowHeight - Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.mime text: qsTr("Camera") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.cameraModel color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.date text: qsTr("Zoom ratio") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.digitalZoomRatio color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.modified text: qsTr("Author") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.author color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.owner text: qsTr("Codec") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.videoCodec color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.tags text: qsTr("Copyright") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.copyright color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.permissions text: qsTr("Duration") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.duration color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.permissions text: qsTr("Frame rate") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.videoFrameRate color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.permissions text: qsTr("Year") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.year color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.permissions text: qsTr("Aspect ratio") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.pixelAspectRatio color: colorScheme.textColor } } Column { Layout.fillWidth: true spacing: space.small Label { visible: iteminfo.permissions text: qsTr("Resolution") font.pointSize: fontSizes.default font.weight: Font.Light color: colorScheme.textColor } Label { horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter elide: Qt.ElideRight wrapMode: Text.Wrap font.pointSize: fontSizes.big font.weight: Font.Bold font.bold: true text: player.metaData.resolution color: colorScheme.textColor } } } } } } diff --git a/src/mauikit.cpp b/src/mauikit.cpp index 95433a7..45fbaa6 100644 --- a/src/mauikit.cpp +++ b/src/mauikit.cpp @@ -1,187 +1,174 @@ /* * Copyright 2018 Camilo Higuita * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2, or * (at your option) 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 Library General Public * License along with this program; if not, write to the * Free Software Foundation, Inc., * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "mauikit.h" #include #include #include "fm.h" #include "fmh.h" #include "basemodel.h" #include "modellist.h" #include "placeslist.h" #include "fmlist.h" #include "pathlist.h" #include "syncingmodel.h" #include "syncinglist.h" #include "tagsmodel.h" #include "tagslist.h" #include "storemodel.h" #include "storelist.h" #include "handy.h" #include "documenthandler.h" #include "mauiapp.h" #ifdef Q_OS_ANDROID #include "mauiandroid.h" #include #else #include "mauikde.h" #endif QUrl MauiKit::componentUrl(const QString &fileName) const { #ifdef MAUI_APP return QUrl(QStringLiteral("qrc:/maui/kit/") + fileName); #else return QUrl(resolveFileUrl(fileName)); #endif } void MauiKit::registerTypes(const char *uri) { Q_ASSERT(uri == QLatin1String("org.kde.mauikit")); qmlRegisterSingletonType(componentUrl(QStringLiteral("Style.qml")), uri, 1, 0, "Style"); qmlRegisterType(componentUrl(QStringLiteral("ToolBar.qml")), uri, 1, 0, "ToolBar"); - -// #if QT_VERSION == QT_VERSION_CHECK(5, 12, 0) - #ifdef Q_OS_ANDROID - qmlRegisterType(componentUrl(QStringLiteral("ToolButton2.qml")), uri, 1, 0, "ToolButton"); - #else - qmlRegisterType(componentUrl(QStringLiteral("ToolButton.qml")), uri, 1, 0, "ToolButton"); - #endif - qmlRegisterType(componentUrl(QStringLiteral("ApplicationWindow.qml")), uri, 1, 0, "ApplicationWindow"); qmlRegisterType(componentUrl(QStringLiteral("Page.qml")), uri, 1, 0, "Page"); qmlRegisterType(componentUrl(QStringLiteral("ShareDialog.qml")), uri, 1, 0, "ShareDialog"); qmlRegisterType(componentUrl(QStringLiteral("PieButton.qml")), uri, 1, 0, "PieButton"); qmlRegisterType(componentUrl(QStringLiteral("SideBar.qml")), uri, 1, 0, "SideBar"); qmlRegisterType(componentUrl(QStringLiteral("Holder.qml")), uri, 1, 0, "Holder"); qmlRegisterType(componentUrl(QStringLiteral("Drawer.qml")), uri, 1, 0, "Drawer"); qmlRegisterType(componentUrl(QStringLiteral("GlobalDrawer.qml")), uri, 1, 0, "GlobalDrawer"); qmlRegisterType(componentUrl(QStringLiteral("ListDelegate.qml")), uri, 1, 0, "ListDelegate"); qmlRegisterType(componentUrl(QStringLiteral("SelectionBar.qml")), uri, 1, 0, "SelectionBar"); qmlRegisterType(componentUrl(QStringLiteral("IconDelegate.qml")), uri, 1, 0, "IconDelegate"); qmlRegisterType(componentUrl(QStringLiteral("LabelDelegate.qml")), uri, 1, 0, "LabelDelegate"); qmlRegisterType(componentUrl(QStringLiteral("NewDialog.qml")), uri, 1, 0, "NewDialog"); qmlRegisterType(componentUrl(QStringLiteral("Dialog.qml")), uri, 1, 0, "Dialog"); -// qmlRegisterType(componentUrl(QStringLiteral("Button.qml")), uri, 1, 0, "Button"); qmlRegisterType(componentUrl(QStringLiteral("AboutDialog.qml")), uri, 1, 0, "AboutDialog"); qmlRegisterType(componentUrl(QStringLiteral("Popup.qml")), uri, 1, 0, "Popup"); qmlRegisterType(componentUrl(QStringLiteral("TextField.qml")), uri, 1, 0, "TextField"); qmlRegisterType(componentUrl(QStringLiteral("SearchBar.qml")), uri, 1, 0, "SearchBar"); qmlRegisterType(componentUrl(QStringLiteral("TagsBar.qml")), uri, 1, 0, "TagsBar"); qmlRegisterType(componentUrl(QStringLiteral("TagsDialog.qml")), uri, 1, 0, "TagsDialog"); qmlRegisterType(componentUrl(QStringLiteral("Badge.qml")), uri, 1, 0, "Badge"); qmlRegisterType(componentUrl(QStringLiteral("GridView.qml")), uri, 1, 0, "GridView"); -// qmlRegisterType(componentUrl(QStringLiteral("Item.qml")), uri, 1, 0, "Item"); -// qmlRegisterType(componentUrl(QStringLiteral("Menu.qml")), uri, 1, 0, "Menu"); -// qmlRegisterType(componentUrl(QStringLiteral("MenuItem.qml")), uri, 1, 0, "MenuItem"); qmlRegisterType(componentUrl(QStringLiteral("ColorsBar.qml")), uri, 1, 0, "ColorsBar"); qmlRegisterType(componentUrl(QStringLiteral("ComboBox.qml")), uri, 1, 0, "ComboBox"); qmlRegisterType(componentUrl(QStringLiteral("ImageViewer.qml")), uri, 1, 0, "ImageViewer"); -// qmlRegisterType(componentUrl(QStringLiteral("ActionBar.qml")), uri, 1, 0, "ActionBar"); qmlRegisterType(componentUrl(QStringLiteral("private/TagList.qml")), uri, 1, 0, "TagList"); /** STORE CONTROLS **/ qmlRegisterType(componentUrl(QStringLiteral("private/StoreDelegate.qml")), uri, 1, 0, "StoreDelegate"); qmlRegisterType(componentUrl(QStringLiteral("Store.qml")), uri, 1, 0, "Store"); /** BROWSING CONTROLS **/ qmlRegisterType(componentUrl(QStringLiteral("ListBrowser.qml")), uri, 1, 0, "ListBrowser"); qmlRegisterType(componentUrl(QStringLiteral("GridBrowser.qml")), uri, 1, 0, "GridBrowser"); /** FM CONTROLS **/ qmlRegisterType(componentUrl(QStringLiteral("FileBrowser.qml")), uri, 1, 0, "FileBrowser"); qmlRegisterType(componentUrl(QStringLiteral("PlacesSidebar.qml")), uri, 1, 0, "PlacesSidebar"); qmlRegisterType(componentUrl(QStringLiteral("FilePreviewer.qml")), uri, 1, 0, "FilePreviewer"); qmlRegisterType(componentUrl(QStringLiteral("FileDialog.qml")), uri, 1, 0, "FileDialog"); qmlRegisterType(componentUrl(QStringLiteral("PathBar.qml")), uri, 1, 0, "PathBar"); qmlRegisterType(componentUrl(QStringLiteral("SyncDialog.qml")), uri, 1, 0, "SyncDialog"); qmlRegisterType(componentUrl(QStringLiteral("SyncDialog.qml")), uri, 1, 0, "SyncDialog"); /** EDITOR CONTROLS **/ qmlRegisterType(componentUrl(QStringLiteral("Editor.qml")), uri, 1, 0, "Editor"); #ifdef Q_OS_ANDROID qmlRegisterSingletonType(uri, 1, 0, "Android", [](QQmlEngine*, QJSEngine*) -> QObject* { MAUIAndroid *android = new MAUIAndroid; return android; }); #else qmlRegisterType(componentUrl(QStringLiteral("Terminal.qml")), uri, 1, 0, "Terminal"); qmlRegisterSingletonType(uri, 1, 0, "KDE", [](QQmlEngine*, QJSEngine*) -> QObject* { MAUIKDE *kde = new MAUIKDE; return kde; }); #endif qmlRegisterType(uri, 1, 0, "BaseModel"); //BASE MODEL qmlRegisterUncreatableType(uri, 1, 0, "ModelList", QStringLiteral("ModelList should not be created in QML")); qmlRegisterType(uri, 1, 0, "PlacesList"); qmlRegisterType(uri, 1, 0, "FMList"); qmlRegisterType(uri, 1, 0, "PathList"); qmlRegisterType("SyncingList", 1, 0, "SyncingList"); qmlRegisterType("SyncingModel", 1, 0, "SyncingModel"); qmlRegisterType("TagsList", 1, 0, "TagsList"); qmlRegisterType("TagsModel", 1, 0, "TagsModel"); qmlRegisterType("StoreList", 1, 0, "StoreList"); qmlRegisterType("StoreModel", 1, 0, "StoreModel"); // qmlRegisterType(uri, 1, 0, "App"); qmlRegisterType("DocumentHandler", 1, 0, "DocumentHandler"); qmlRegisterSingletonType(uri, 1, 0, "FM", [](QQmlEngine*, QJSEngine*) -> QObject* { auto fm = new FM(); return fm; }); qmlRegisterSingletonType(uri, 1, 0, "Handy", [](QQmlEngine*, QJSEngine*) -> QObject* { auto handy = new Handy; return handy; }); #ifdef Q_OS_ANDROID QIcon::setThemeSearchPaths({":/icons/luv-icon-theme"}); QIcon::setThemeName("Luv"); QQuickStyle::setStyle(":/style"); // #else // QQuickStyle::setStyle("maui-style"); #endif qmlProtectModule(uri, 1); }