diff --git a/demo/src/main.qml b/demo/src/main.qml index 046bb14..7d4d035 100644 --- a/demo/src/main.qml +++ b/demo/src/main.qml @@ -1,344 +1,346 @@ import QtQuick 2.9 import QtQuick.Controls 2.3 import org.kde.mauikit 1.0 as Maui import QtQuick.Layouts 1.3 import org.kde.kirigami 2.6 as Kirigami import StoreList 1.0 Maui.ApplicationWindow { id: root 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 - +altToolBars: 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 { - Layout.fillHeight: true +// Layout.fillHeight: true iconName: "nx-home" - iconColor: root.headBarFGColor + colorScheme.textColor : root.headBarFGColor spacing: space.medium active: currentPageIndex === 0 showIndicator: true onClicked: currentPageIndex = 0 text: qsTr("Home") + }, Maui.ToolButton { - Layout.fillHeight: true +// Layout.fillHeight: true iconName: "view-list-icons" - iconColor: root.headBarFGColor + colorScheme.textColor: root.headBarFGColor spacing: space.medium active: currentPageIndex === 1 showIndicator: true onClicked: currentPageIndex = 1 text: qsTr("Browser") }, Maui.ToolButton { - Layout.fillHeight: true +// Layout.fillHeight: true iconName: "view-media-genre" - iconColor: root.headBarFGColor + colorScheme.textColor: root.headBarFGColor spacing: space.medium active: currentPageIndex === 2 showIndicator: true onClicked: currentPageIndex = 2 text: qsTr("Editor") }, Maui.ToolButton { - Layout.fillHeight: true +// Layout.fillHeight: true iconName: "nx-software-center" - iconColor: root.headBarFGColor + colorScheme.textColor: root.headBarFGColor spacing: space.medium active: currentPageIndex === 3 showIndicator: true onClicked: currentPageIndex = 3 text: qsTr("Store") } ] footBar.leftContent: Maui.ToolButton { iconName: "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: 16 }, Kirigami.Action { iconName: "edit-find" text: "Search" icon.width: 16 }, Kirigami.Action { iconName: "document-preview-archive" text: "Hidden files" icon.width: 16 } ] } 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 { iconName: "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 { id: _batteryBtn visible: false iconName: "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/ToolButton.qml b/src/controls/ToolButton.qml index 25762d4..bc95abc 100644 --- a/src/controls/ToolButton.qml +++ b/src/controls/ToolButton.qml @@ -1,201 +1,211 @@ /* * 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 QtQuick.Controls.impl 2.3 import QtQuick.Layouts 1.3 import org.kde.kirigami 2.4 as Kirigami import "private" ToolButton { id: control + + readonly property var indicatorStyles : ({ + underline: 0, + box: 1 + }) + focusPolicy: Qt.NoFocus /* Controlc color scheming */ ColorScheme { id: colorScheme backgroundColor: "transparent" borderColor: "transparent" } property alias colorScheme : colorScheme /***************************/ // property alias backgroundRec: _background property bool isMask: true property string iconName: "" property string iconFallback: "" property int size: iconSize - property color iconColor: colorScheme.textColor + property color iconColor: control.active && control.indicatorStyle === control.indicatorStyles.box ? control.colorScheme.highlightColor : colorScheme.textColor property bool anim: false property string tooltipText : "" property bool showIndicator: false property bool active: false - + property int indicatorStyle: indicatorStyles.box hoverEnabled: false + + // implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, // implicitContentWidth + leftPadding + rightPadding) // implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, // implicitContentHeight + topPadding + bottomPadding) height: control.visible ? (control.display === ToolButton.IconOnly ? size + space.medium : implicitHeight) : 0 width: control.visible ? (control.display === ToolButton.IconOnly ? height : implicitWidth + space.small) : 0 icon.name: control.iconName icon.source: control.iconFallback icon.width: control.size icon.height: control.size icon.color: !control.isMask ? "transparent" : (down || pressed || checked) ? colorScheme.highlightColor : iconColor onClicked: if(anim) animIcon.running = true flat: true highlighted: !isMask font.pointSize: control.display === ToolButton.TextUnderIcon ? fontSizes.small : undefined display: control.active ? (control.text.length > 0 ? (isWide ? ToolButton.TextBesideIcon : ToolButton.TextUnderIcon) : ToolButton.IconOnly) : ToolButton.IconOnly spacing: space.tiny Kirigami.Theme.textColor: control.icon.color Rectangle { id: _indicator color: control.colorScheme.highlightColor - height: visible ? unit * 5 : 0 + height: control.indicatorStyle == indicatorStyles.box ? control.height : (indicatorStyle === indicatorStyles.underline ? unit * 5 : 0) width: visible ? (control.width) : 0 - + radius: control.indicatorStyle == indicatorStyles.box ? radiusV : 0 + opacity: control.indicatorStyle == indicatorStyles.box ? 0.3 : 1 anchors.bottom: parent.bottom anchors.horizontalCenter: control.horizontalCenter visible: control.showIndicator && control.visible && control.active + z: background.z -1 } // background: Rectangle // { // id: _background // implicitHeight: control.visible ? control.size : 0 // implicitWidth: control.visible ? control.size : 0 // // anchors.centerIn: control.icon // color: /*(down || pressed || checked) */ checked && enabled ? // Qt.lighter(colorScheme.highlightColor, 1.2) : colorScheme.backgroundColor // radius: unit * 3 // opacity: (down || pressed || checked) && enabled ? 0.5 : 1 // border.color: colorScheme.borderColor // } // // contentItem: IconLabel // { // id: _iconLabel // spacing: control.display === ToolButton.TextUnderIcon ? space.tiny : control.spacing // mirrored: control.mirrored // display: control.display // icon: control.icon // text: control.text // font: control.font // color: control.icon.color // } // background: Rectangle // { // implicitHeight: control.visible ? control.height : 0 // implicitWidth: control.visible ? control.width : 0 // // anchors.centerIn: control // color: /*(down || pressed || checked) */ checked && enabled ? // Qt.lighter(colorScheme.highlightColor, 1.2) : colorScheme.backgroundColor // radius: unit * 3 // opacity: (down || pressed || checked) && enabled ? 0.5 : 1 // border.color: colorScheme.borderColor // } // // contentItem: GridLayout // { // id: _contentLayout // anchors.fill: control // // columns: (control.display === ToolButton.TextUnderIcon) || (control.display === ToolButton.IconOnly)? 1 : 2 // rows: (control.display === ToolButton.TextUnderIcon) ? 2 : 1 // // columnSpacing: 0 // rowSpacing: 0 // // Item // { // Layout.fillWidth: true // Layout.fillHeight: true // Layout.row: 1 // Layout.column: 1 // Layout.alignment: Qt.AlignBottom // // Kirigami.Icon // { // anchors.centerIn: parent // source: control.iconName // isMask: control.isMask // height: size // width: height // color: isMask ? control.iconColor : "transparent" // } // } // // Item // { // visible: control.text.length && control.text // Layout.fillWidth: true // Layout.fillHeight: true // Layout.row: (control.display === ToolButton.TextUnderIcon) ? 2 : 1 // Layout.column: (control.display === ToolButton.TextUnderIcon) || (control.display === ToolButton.IconOnly)? 1 : 2 // Layout.alignment: Qt.AlignTop // // Label // { // anchors.fill: parent // font: control.font // text: control.text // color: control.iconColor // horizontalAlignment: Qt.AlignHCenter // verticalAlignment: Qt.AlignVCenter // } // } // } SequentialAnimation { id: animIcon PropertyAnimation { target: control property: "icon.color" easing.type: Easing.InOutQuad from: colorScheme.highlightColor to: iconColor duration: 500 } } ToolTip.delay: 1000 ToolTip.timeout: 5000 ToolTip.visible: hovered && !isMobile && tooltipText.length > 0 ToolTip.text: tooltipText } diff --git a/src/controls/ToolButton2.qml b/src/controls/ToolButton2.qml index 2654a32..f6831ab 100644 --- a/src/controls/ToolButton2.qml +++ b/src/controls/ToolButton2.qml @@ -1,204 +1,211 @@ /* * 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 QtQuick.Controls.impl 2.3 import QtQuick.Layouts 1.3 import org.kde.kirigami 2.4 as Kirigami import "private" ToolButton { id: control + + readonly property var indicatorStyles : ({ + underline: 0, + box: 1 + }) + focusPolicy: Qt.NoFocus /* Controlc color scheming */ ColorScheme { id: colorScheme backgroundColor: "transparent" borderColor: "transparent" } property alias colorScheme : colorScheme /***************************/ -// property alias backgroundRec: _background + // property alias backgroundRec: _background property bool isMask: true property string iconName: "" property string iconFallback: "" property int size: iconSize - property color iconColor: colorScheme.textColor + property color iconColor: control.active && control.indicatorStyle === control.indicatorStyles.box ? control.colorScheme.highlightColor : colorScheme.textColor property bool anim: false property string tooltipText : "" property bool showIndicator: false + property bool active: false + property int indicatorStyle: indicatorStyles.box + hoverEnabled: false + - hoverEnabled: !isMobile - implicitWidth: Math.max(background ? background.implicitWidth : 0, - contentItem.implicitWidth + leftPadding + rightPadding) - implicitHeight: Math.max(background ? background.implicitHeight : 0, - contentItem.implicitHeight + topPadding + bottomPadding) + + // implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, + // implicitContentWidth + leftPadding + rightPadding) + // implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset, + // implicitContentHeight + topPadding + bottomPadding) height: control.visible ? (control.display === ToolButton.IconOnly ? size + space.medium : implicitHeight) : 0 width: control.visible ? (control.display === ToolButton.IconOnly ? height : implicitWidth + space.small) : 0 icon.name: control.iconName icon.source: control.iconFallback icon.width: control.size icon.height: control.size icon.color: !control.isMask ? "transparent" : (down || pressed || checked) ? colorScheme.highlightColor : iconColor onClicked: if(anim) animIcon.running = true flat: true highlighted: !isMask font.pointSize: control.display === ToolButton.TextUnderIcon ? fontSizes.small : undefined - display: control.text.length > 0 ? (isWide ? ToolButton.TextBesideIcon : ToolButton.TextUnderIcon) : ToolButton.IconOnly + display: control.active ? (control.text.length > 0 ? (isWide ? ToolButton.TextBesideIcon : ToolButton.TextUnderIcon) : ToolButton.IconOnly) : ToolButton.IconOnly spacing: space.tiny - - - - background: Rectangle - { - id: _background - implicitHeight: control.visible ? iconSizes.medium : 0 - implicitWidth: control.visible ? iconSizes.medium : 0 - - anchors.centerIn: control.icon - color: /*(down || pressed || checked) */ checked && enabled ? - Qt.lighter(colorScheme.highlightColor, 1.2) : colorScheme.backgroundColor - radius: unit * 3 - opacity: (down || pressed || checked) && enabled ? 0.5 : 1 - border.color: colorScheme.borderColor - - - } - + Kirigami.Theme.textColor: control.icon.color Rectangle { id: _indicator - visible: control.visible && control.showIndicator color: control.colorScheme.highlightColor - height: unit * 5 - width: control.width - space.small - + height: control.indicatorStyle == indicatorStyles.box ? control.height : (indicatorStyle === indicatorStyles.underline ? unit * 5 : 0) + width: visible ? (control.width) : 0 + radius: control.indicatorStyle == indicatorStyles.box ? radiusV : 0 + opacity: control.indicatorStyle == indicatorStyles.box ? 0.3 : 1 anchors.bottom: parent.bottom - anchors.horizontalCenter: parent.horizontalCenter + anchors.horizontalCenter: control.horizontalCenter + visible: control.showIndicator && control.visible && control.active + z: background.z -1 } - contentItem: IconLabel - { - id: _iconLabel - visible: control.visible - spacing: control.display === ToolButton.TextUnderIcon ? space.tiny : control.spacing - mirrored: control.mirrored - display: control.display - icon: control.icon - text: control.text - font: control.font - color: control.iconColor - } + background: Rectangle + { + id: _background + implicitHeight: control.visible ? control.size : 0 + implicitWidth: control.visible ? control.size : 0 + + anchors.centerIn: control.icon + color: /*(down || pressed || checked) */ checked && enabled ? + Qt.lighter(colorScheme.highlightColor, 1.2) : colorScheme.backgroundColor + radius: unit * 3 + opacity: (down || pressed || checked) && enabled ? 0.5 : 1 + border.color: colorScheme.borderColor + } + + contentItem: IconLabel + { + id: _iconLabel + spacing: control.display === ToolButton.TextUnderIcon ? space.tiny : control.spacing + mirrored: control.mirrored + display: control.display + icon: control.icon + text: control.text + font: control.font + color: control.icon.color + } -// background: Rectangle -// { -// implicitHeight: control.visible? control.height : 0 -// implicitWidth: control.visible? control.width : 0 -// -// anchors.centerIn: control -// color: /*(down || pressed || checked) */ checked && enabled ? -// Qt.lighter(colorScheme.highlightColor, 1.2) : colorScheme.backgroundColor -// radius: unit * 3 -// opacity: (down || pressed || checked) && enabled ? 0.5 : 1 -// border.color: colorScheme.borderColor -// } -// -// contentItem: GridLayout -// { -// id: _contentLayout -// anchors.fill: control -// -// columns: (control.display === ToolButton.TextUnderIcon) || (control.display === ToolButton.IconOnly)? 1 : 2 -// rows: (control.display === ToolButton.TextUnderIcon) ? 2 : 1 -// -// columnSpacing: 0 -// rowSpacing: 0 -// -// Item -// { -// Layout.fillWidth: true -// Layout.fillHeight: true -// Layout.row: 1 -// Layout.column: 1 -// Layout.alignment: Qt.AlignBottom -// -// Kirigami.Icon -// { -// anchors.centerIn: parent -// source: control.iconName -// isMask: control.isMask -// height: size -// width: height -// color: isMask ? control.iconColor : "transparent" -// } -// } -// -// Item -// { -// visible: control.text.length && control.text -// Layout.fillWidth: true -// Layout.fillHeight: true -// Layout.row: (control.display === ToolButton.TextUnderIcon) ? 2 : 1 -// Layout.column: (control.display === ToolButton.TextUnderIcon) || (control.display === ToolButton.IconOnly)? 1 : 2 -// Layout.alignment: Qt.AlignTop -// -// Label -// { -// anchors.fill: parent -// font: control.font -// text: control.text -// color: control.iconColor -// horizontalAlignment: Qt.AlignHCenter -// verticalAlignment: Qt.AlignVCenter -// } -// } -// } + // background: Rectangle + // { + // implicitHeight: control.visible ? control.height : 0 + // implicitWidth: control.visible ? control.width : 0 + // + // anchors.centerIn: control + // color: /*(down || pressed || checked) */ checked && enabled ? + // Qt.lighter(colorScheme.highlightColor, 1.2) : colorScheme.backgroundColor + // radius: unit * 3 + // opacity: (down || pressed || checked) && enabled ? 0.5 : 1 + // border.color: colorScheme.borderColor + // } + // + // contentItem: GridLayout + // { + // id: _contentLayout + // anchors.fill: control + // + // columns: (control.display === ToolButton.TextUnderIcon) || (control.display === ToolButton.IconOnly)? 1 : 2 + // rows: (control.display === ToolButton.TextUnderIcon) ? 2 : 1 + // + // columnSpacing: 0 + // rowSpacing: 0 + // + // Item + // { + // Layout.fillWidth: true + // Layout.fillHeight: true + // Layout.row: 1 + // Layout.column: 1 + // Layout.alignment: Qt.AlignBottom + // + // Kirigami.Icon + // { + // anchors.centerIn: parent + // source: control.iconName + // isMask: control.isMask + // height: size + // width: height + // color: isMask ? control.iconColor : "transparent" + // } + // } + // + // Item + // { + // visible: control.text.length && control.text + // Layout.fillWidth: true + // Layout.fillHeight: true + // Layout.row: (control.display === ToolButton.TextUnderIcon) ? 2 : 1 + // Layout.column: (control.display === ToolButton.TextUnderIcon) || (control.display === ToolButton.IconOnly)? 1 : 2 + // Layout.alignment: Qt.AlignTop + // + // Label + // { + // anchors.fill: parent + // font: control.font + // text: control.text + // color: control.iconColor + // horizontalAlignment: Qt.AlignHCenter + // verticalAlignment: Qt.AlignVCenter + // } + // } + // } SequentialAnimation { id: animIcon PropertyAnimation { target: control property: "icon.color" easing.type: Easing.InOutQuad from: colorScheme.highlightColor to: iconColor duration: 500 } } ToolTip.delay: 1000 ToolTip.timeout: 5000 ToolTip.visible: hovered && !isMobile && tooltipText.length > 0 ToolTip.text: tooltipText } diff --git a/src/mauikit.cpp b/src/mauikit.cpp index a9ee9eb..3f6107f 100644 --- a/src/mauikit.cpp +++ b/src/mauikit.cpp @@ -1,185 +1,186 @@ /* * 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 "fmmodel.h" #include "fmlist.h" #include "placeslist.h" #include "placesmodel.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) - qmlRegisterType(componentUrl(QStringLiteral("ToolButton.qml")), uri, 1, 0, "ToolButton"); +// #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("PlacesList", 1, 0, "PlacesList"); qmlRegisterType("PlacesModel", 1, 0, "PlacesModel"); qmlRegisterType("FMModel", 1, 0, "FMModel"); qmlRegisterType("FMList", 1, 0, "FMList"); 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); }