diff --git a/examples/simpleexamples/MultipleColumnsGallery.qml b/examples/simpleexamples/MultipleColumnsGallery.qml index 4f8750df..49c5fa52 100644 --- a/examples/simpleexamples/MultipleColumnsGallery.qml +++ b/examples/simpleexamples/MultipleColumnsGallery.qml @@ -1,88 +1,96 @@ /* * Copyright 2015 Marco Martin * * 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 Library 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.0 as Controls import QtQuick.Layouts 1.2 -import org.kde.kirigami 2.4 +import org.kde.kirigami 2.8 ScrollablePage { id: page Layout.fillWidth: true implicitWidth: Units.gridUnit * (Math.floor(Math.random() * 35) + 8) title: "Multiple Columns" actions { contextualActions: [ Action { text:"Action for buttons" iconName: "bookmarks" onTriggered: print("Action 1 clicked") }, Action { text:"Action 2" iconName: "folder" enabled: false } ] } ColumnLayout { width: page.width spacing: Units.smallSpacing Controls.Label { Layout.fillWidth: true wrapMode: Text.WordWrap text: "This page is used to test multiple columns: you can push and pop an arbitrary number of pages, each new page will have a random implicit width between 8 and 35 grid units.\nIf you enlarge the window enough, you can test how the application behaves with multiple columns." } Item { Layout.minimumWidth: Units.gridUnit *2 Layout.minimumHeight: Layout.minimumWidth } Controls.Label { anchors.horizontalCenter: parent.horizontalCenter text: "Page implicitWidth: " + page.implicitWidth } Controls.Button { text: "Push Another Page" anchors.horizontalCenter: parent.horizontalCenter onClicked: pageStack.push(Qt.resolvedUrl("MultipleColumnsGallery.qml")); } Controls.Button { text: "Pop A Page" anchors.horizontalCenter: parent.horizontalCenter onClicked: pageStack.pop(); } RowLayout { anchors.horizontalCenter: parent.horizontalCenter Controls.TextField { id: edit text: page.title } Controls.Button { text: "Rename Page" onClicked: page.title = edit.text; } } + SearchField { + anchors.horizontalCenter: parent.horizontalCenter + id: searchField + onAccepted: console.log("Search text is " + searchField.text); + } + PasswordField { + anchors.horizontalCenter: parent.horizontalCenter + id: passwordField + onAccepted: console.log("Password") + } } - - } diff --git a/kirigami.qrc b/kirigami.qrc index ad0264c4..78e795f3 100644 --- a/kirigami.qrc +++ b/kirigami.qrc @@ -1,88 +1,90 @@ src/controls/AbstractApplicationWindow.qml src/controls/ContextDrawer.qml src/controls/Action.qml src/controls/Page.qml src/controls/PageRow.qml src/controls/AbstractListItem.qml src/controls/Theme.qml src/controls/AbstractCard.qml src/controls/templates/AbstractCard.qml src/controls/Card.qml src/controls/CardsLayout.qml src/controls/CardsListView.qml src/controls/CardsGridView.qml src/controls/ActionToolBar.qml src/controls/templates/InlineMessage.qml src/controls/InlineMessage.qml src/controls/ToolBarApplicationHeader.qml src/controls/ActionTextField.qml + src/controls/SearchField.qml + src/controls/PasswordField.qml src/controls/private/GlobalDrawerActionItem.qml src/controls/private/ContextDrawerActionItem.qml src/controls/private/RefreshableScrollView.qml src/controls/private/SwipeItemEventFilter.qml src/controls/private/PageActionPropertyGroup.qml src/controls/private/ActionIconGroup.qml src/controls/private/CornerShadow.qml src/controls/private/ActionButton.qml src/controls/private/DefaultListItemBackground.qml src/controls/private/BannerImage.qml src/controls/private/EdgeShadow.qml src/controls/private/globaltoolbar/AbstractPageHeader.qml src/controls/private/globaltoolbar/PageRowGlobalToolBarStyleGroup.qml src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml src/controls/private/PrivateActionToolButton.qml src/controls/private/globaltoolbar/TitlesPageHeader.qml src/controls/private/globaltoolbar/ToolBarPageHeader.qml src/controls/private/globaltoolbar/BreadcrumbControl.qml src/controls/private/globaltoolbar/TabBarControl.qml src/controls/private/ActionsMenu.qml src/controls/private/ActionMenuItem.qml src/controls/private/ActionMenuItemBase.qml src/controls/Separator.qml src/controls/OverlayDrawer.qml src/controls/OverlaySheet.qml src/controls/GlobalDrawer.qml src/controls/templates/AbstractListItem.qml src/controls/templates/private/MenuIcon.qml src/controls/templates/private/GenericDrawerIcon.qml src/controls/templates/private/PassiveNotification.qml src/controls/templates/private/ContextIcon.qml src/controls/templates/private/ScrollView.qml src/controls/templates/private/BackButton.qml src/controls/templates/private/IconPropertiesGroup.qml src/controls/templates/private/ForwardButton.qml src/controls/templates/OverlayDrawer.qml src/controls/templates/OverlaySheet.qml src/controls/templates/SwipeListItem.qml src/controls/templates/ApplicationHeader.qml src/controls/templates/AbstractApplicationHeader.qml src/controls/Units.qml src/controls/SwipeListItem.qml src/controls/ApplicationWindow.qml src/controls/AbstractApplicationItem.qml src/controls/ApplicationItem.qml src/controls/ApplicationHeader.qml src/controls/Heading.qml src/controls/ScrollablePage.qml src/controls/AboutPage.qml src/controls/UrlButton.qml src/controls/LinkButton.qml src/controls/Label.qml src/controls/BasicListItem.qml src/controls/AbstractApplicationHeader.qml src/controls/FormLayout.qml src/controls/ListItemDragHandle.qml src/styles/Material/AbstractListItem.qml src/styles/Material/Theme.qml src/styles/Material/SwipeListItem.qml src/styles/Material/Label.qml src/styles/org.kde.desktop/AbstractListItem.qml src/styles/org.kde.desktop/Theme.qml src/styles/org.kde.desktop/Units.qml src/styles/org.kde.desktop/SwipeListItem.qml src/styles/org.kde.desktop/ApplicationWindow.qml src/styles/org.kde.desktop/AbstractApplicationHeader.qml diff --git a/kirigami.qrc.in b/kirigami.qrc.in index a87df794..cc6c3965 100644 --- a/kirigami.qrc.in +++ b/kirigami.qrc.in @@ -1,88 +1,90 @@ @kirigami_QML_DIR@/src/controls/AbstractApplicationWindow.qml @kirigami_QML_DIR@/src/controls/ContextDrawer.qml @kirigami_QML_DIR@/src/controls/Action.qml @kirigami_QML_DIR@/src/controls/Page.qml @kirigami_QML_DIR@/src/controls/PageRow.qml @kirigami_QML_DIR@/src/controls/AbstractListItem.qml @kirigami_QML_DIR@/src/controls/Theme.qml @kirigami_QML_DIR@/src/controls/AbstractCard.qml @kirigami_QML_DIR@/src/controls/templates/AbstractCard.qml @kirigami_QML_DIR@/src/controls/Card.qml @kirigami_QML_DIR@/src/controls/CardsLayout.qml @kirigami_QML_DIR@/src/controls/CardsListView.qml @kirigami_QML_DIR@/src/controls/CardsGridView.qml @kirigami_QML_DIR@/src/controls/ActionToolBar.qml @kirigami_QML_DIR@/src/controls/templates/InlineMessage.qml @kirigami_QML_DIR@/src/controls/InlineMessage.qml @kirigami_QML_DIR@/src/controls/ToolBarApplicationHeader.qml @kirigami_QML_DIR@/src/controls/ActionTextField.qml + @kirigami_QML_DIR@/src/controls/SearchField.qml + @kirigami_QML_DIR@/src/controls/PasswordField.qml @kirigami_QML_DIR@/src/controls/private/PrivateActionToolButton.qml @kirigami_QML_DIR@/src/controls/private/GlobalDrawerActionItem.qml @kirigami_QML_DIR@/src/controls/private/ContextDrawerActionItem.qml @kirigami_QML_DIR@/src/controls/private/RefreshableScrollView.qml @kirigami_QML_DIR@/src/controls/private/SwipeItemEventFilter.qml @kirigami_QML_DIR@/src/controls/private/PageActionPropertyGroup.qml @kirigami_QML_DIR@/src/controls/private/ActionIconGroup.qml @kirigami_QML_DIR@/src/controls/private/CornerShadow.qml @kirigami_QML_DIR@/src/controls/private/ActionButton.qml @kirigami_QML_DIR@/src/controls/private/DefaultListItemBackground.qml @kirigami_QML_DIR@/src/controls/private/BannerImage.qml @kirigami_QML_DIR@/src/controls/private/EdgeShadow.qml @kirigami_QML_DIR@/src/controls/private/globaltoolbar/AbstractPageHeader.qml @kirigami_QML_DIR@/src/controls/private/globaltoolbar/BreadcrumbControl.qml @kirigami_QML_DIR@/src/controls/private/globaltoolbar/PageRowGlobalToolBarStyleGroup.qml @kirigami_QML_DIR@/src/controls/private/globaltoolbar/PageRowGlobalToolBarUI.qml @kirigami_QML_DIR@/src/controls/private/PrivateActionToolButton.qml @kirigami_QML_DIR@/src/controls/private/globaltoolbar/TabBarControl.qml @kirigami_QML_DIR@/src/controls/private/globaltoolbar/TitlesPageHeader.qml @kirigami_QML_DIR@/src/controls/private/globaltoolbar/ToolBarPageHeader.qml @kirigami_QML_DIR@/src/controls/private/ActionsMenu.qml @kirigami_QML_DIR@/src/controls/private/ActionMenuItem.qml @kirigami_QML_DIR@/src/controls/Separator.qml @kirigami_QML_DIR@/src/controls/OverlayDrawer.qml @kirigami_QML_DIR@/src/controls/OverlaySheet.qml @kirigami_QML_DIR@/src/controls/GlobalDrawer.qml @kirigami_QML_DIR@/src/controls/templates/AbstractListItem.qml @kirigami_QML_DIR@/src/controls/templates/private/MenuIcon.qml @kirigami_QML_DIR@/src/controls/templates/private/GenericDrawerIcon.qml @kirigami_QML_DIR@/src/controls/templates/private/PassiveNotification.qml @kirigami_QML_DIR@/src/controls/templates/private/ContextIcon.qml @kirigami_QML_DIR@/src/controls/templates/private/ScrollView.qml @kirigami_QML_DIR@/src/controls/templates/private/BackButton.qml @kirigami_QML_DIR@/src/controls/templates/private/IconPropertiesGroup.qml @kirigami_QML_DIR@/src/controls/templates/private/ForwardButton.qml @kirigami_QML_DIR@/src/controls/templates/OverlayDrawer.qml @kirigami_QML_DIR@/src/controls/templates/OverlaySheet.qml @kirigami_QML_DIR@/src/controls/templates/SwipeListItem.qml @kirigami_QML_DIR@/src/controls/templates/ApplicationHeader.qml @kirigami_QML_DIR@/src/controls/templates/AbstractApplicationHeader.qml @kirigami_QML_DIR@/src/controls/Units.qml @kirigami_QML_DIR@/src/controls/SwipeListItem.qml @kirigami_QML_DIR@/src/controls/ApplicationWindow.qml @kirigami_QML_DIR@/src/controls/AbstractApplicationItem.qml @kirigami_QML_DIR@/src/controls/ApplicationItem.qml @kirigami_QML_DIR@/src/controls/ApplicationHeader.qml @kirigami_QML_DIR@/src/controls/Heading.qml @kirigami_QML_DIR@/src/controls/ScrollablePage.qml @kirigami_QML_DIR@/src/controls/AboutPage.qml @kirigami_QML_DIR@/src/controls/UrlButton.qml @kirigami_QML_DIR@/src/controls/LinkButton.qml @kirigami_QML_DIR@/src/controls/Label.qml @kirigami_QML_DIR@/src/controls/BasicListItem.qml @kirigami_QML_DIR@/src/controls/AbstractApplicationHeader.qml @kirigami_QML_DIR@/src/controls/FormLayout.qml @kirigami_QML_DIR@/src/controls/ListItemDragHandle.qml @kirigami_QML_DIR@/src/styles/Material/AbstractListItem.qml @kirigami_QML_DIR@/src/styles/Material/Theme.qml @kirigami_QML_DIR@/src/styles/Material/SwipeListItem.qml @kirigami_QML_DIR@/src/styles/Material/Label.qml @kirigami_QML_DIR@/src/styles/org.kde.desktop/AbstractListItem.qml @kirigami_QML_DIR@/src/styles/org.kde.desktop/Theme.qml @kirigami_QML_DIR@/src/styles/org.kde.desktop/Units.qml @kirigami_QML_DIR@/src/styles/org.kde.desktop/SwipeListItem.qml @kirigami_QML_DIR@/src/styles/org.kde.desktop/ApplicationWindow.qml @kirigami_QML_DIR@/src/styles/org.kde.desktop/AbstractApplicationHeader.qml diff --git a/src/controls/ActionTextField.qml b/src/controls/ActionTextField.qml index ec45b8a6..c10fd996 100644 --- a/src/controls/ActionTextField.qml +++ b/src/controls/ActionTextField.qml @@ -1,147 +1,150 @@ /* * Copyright (C) 2019 Carl-Lucien Schwan * * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library/Lesser General Public License * version 2, or (at your option) any later version, as published by the * Free Software Foundation * * 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/Lesser 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.1 as Controls import org.kde.kirigami 2.7 as Kirigami /** * This is advanced textfield. It is recommanded to us this class when there * is a need to create a create a textfield with action boutons(e.g a clear * action). * * Example usage for a search field: * @code * import org.kde.kirigami 2.7 as Kirigami * * Kirigami.ActionTextField { * id: searchField * * placeholderText: i18n("Search...") * * focusSequence: "Ctrl+F" * * rightActions: [ * Kirigami.Action { * iconName: "edit-clear" * visible: searchField.text !== "" * onTriggered: { * searchField.text = "" * searchField.accepted() * } * } * ] * * onAccepted: console.log("Search text is " + searchField.text) * } + * @endcode + * + * @inherit QtQuick.Controls.TextField */ Controls.TextField { id: root /** * focusSequence: keysequence * This property hold the a list of shortcut sequence that put the text * field into focus. */ property string focusSequence /** * leftActions: list * This propery hold the action that is left in the field. By default this * field is null. */ property list leftActions /** * rightActions: list * This propery hold the action that is right in the field. By default this * field is null. */ property list rightActions hoverEnabled: true leftPadding: leftActionsRow.width rightPadding: rightActionsRow.width Shortcut { id: focusShortcut enabled: root.focusSequence sequence: root.focusSequence onActivated: { root.forceActiveFocus() root.selectAll() } } Controls.ToolTip { delay: Kirigami.Units.longDuration visible: root.focusSequence && root.text.length === 0 && !rightActionsRow.hovered && !leftActionsRow.hovered && hovered text: root.focusSequence ? root.focusSequence : "" } Row { id: leftActionsRow padding: Kirigami.Units.smallSpacing anchors.left: parent.left anchors.verticalCenter: parent.verticalCenter height: root.implicitHeight - 2 * Kirigami.Units.smallSpacing Repeater { model: root.leftActions Kirigami.Icon { height: parent.height width: parent.height source: modelData.icon.name.length > 0 ? modelData.icon.name : modelData.icon.source visible: modelData.visible MouseArea { anchors.fill: parent onClicked: modelData.trigger() cursorShape: Qt.PointingHandCursor } } } } Row { id: rightActionsRow padding: Kirigami.Units.smallSpacing layoutDirection: Qt.RightToLeft anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter height: root.implicitHeight - 2 * Kirigami.Units.smallSpacing Repeater { model: root.rightActions Kirigami.Icon { height: parent.height width: parent.height anchors.verticalCenter: parent.verticalCenter source: modelData.icon.name.length > 0 ? modelData.icon.name : modelData.icon.source visible: modelData.visible MouseArea { anchors.fill: parent onClicked: modelData.trigger() cursorShape: Qt.PointingHandCursor } } } } } diff --git a/src/controls/PasswordField.qml b/src/controls/PasswordField.qml new file mode 100644 index 00000000..c8c3a962 --- /dev/null +++ b/src/controls/PasswordField.qml @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2019 Carl-Lucien Schwan * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library/Lesser General Public License + * version 2, or (at your option) any later version, as published by the + * Free Software Foundation + * + * 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/Lesser 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.1 as Controls +import org.kde.kirigami 2.7 as Kirigami + +/** + * This is a standard password text field. + * + * Example usage for the password field component: + * @code + * import org.kde.kirigami 2.8 as Kirigami + * + * Kirigami.PasswordField { + * id: passwordField + * onAccepted: // check if passwordField.text is valid + * } + * @endcode + * + * @inherit org.kde.kirgami.ActionTextField + */ +Kirigami.ActionTextField +{ + id: root + + property bool showPassword: false + echoMode: root.showPassword ? TextInput.Normal : TextInput.Password + placeholderText: qsTr("Password") + rightActions: [ + Kirigami.Action { + iconName: root.showPassword ? "password-show-off" : "password-show-on" + onTriggered: root.showPassword = !root.showPassword + } + ] +} diff --git a/src/controls/SearchField.qml b/src/controls/SearchField.qml new file mode 100644 index 00000000..b604670c --- /dev/null +++ b/src/controls/SearchField.qml @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2019 Carl-Lucien Schwan * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Library/Lesser General Public License + * version 2, or (at your option) any later version, as published by the + * Free Software Foundation + * + * 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/Lesser 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.1 as Controls +import org.kde.kirigami 2.7 as Kirigami + +/** + * This is a standard textfield following KDE HIG. Using Ctrl+F as focus + * sequence and "Search..." as placeholder text. + * + * Example usage for the search field component: + * @code + * import org.kde.kirigami 2.8 as Kirigami + * + * Kirigami.SearchField { + * id: searchField + * onAccepted: console.log("Search text is " + searchField.text) + * } + * @endcode + * + * @inherit org.kde.kirgami.ActionTextField + */ +Kirigami.ActionTextField +{ + id: root + + placeholderText: qsTr("Search...") + focusSequence: "Ctrl+F" + rightActions: [ + Kirigami.Action { + iconName: LayoutMirroring.enabled ? "edit-clear-rtl" : "edit-clear" + visible: root.text.length > 0 + onTriggered: { + root.text = "" + root.accepted() + } + } + ] +} diff --git a/src/kirigamiplugin.cpp b/src/kirigamiplugin.cpp index e08242a5..a6f568ff 100644 --- a/src/kirigamiplugin.cpp +++ b/src/kirigamiplugin.cpp @@ -1,189 +1,193 @@ /* * Copyright 2009 by Alan Alpert * Copyright 2010 by Ménard Alexis * Copyright 2010 by Marco Martin * 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 Library 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 "kirigamiplugin.h" #include "columnview.h" #include "enums.h" #include "desktopicon.h" #include "settings.h" #include "formlayoutattached.h" #include "mnemonicattached.h" #include "delegaterecycler.h" #include "scenepositionattached.h" #include #include #include #include #include "libkirigami/platformtheme.h" static QString s_selectedStyle; //Q_INIT_RESOURCE(kirigami); #ifdef KIRIGAMI_BUILD_TYPE_STATIC #include #endif QUrl KirigamiPlugin::componentUrl(const QString &fileName) const { for (const QString &style : qAsConst(m_stylesFallbackChain)) { const QString candidate = QStringLiteral("styles/") + style + QLatin1Char('/') + fileName; if (QFile::exists(resolveFilePath(candidate))) { #ifdef KIRIGAMI_BUILD_TYPE_STATIC return QUrl(QStringLiteral("qrc:/org/kde/kirigami/styles/") + style + QLatin1Char('/') + fileName); #else return QUrl(resolveFileUrl(candidate)); #endif } } #ifdef KIRIGAMI_BUILD_TYPE_STATIC return QUrl(QStringLiteral("qrc:/org/kde/kirigami/") + fileName); #else return QUrl(resolveFileUrl(fileName)); #endif } void KirigamiPlugin::registerTypes(const char *uri) { Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.kirigami")); const QString style = QQuickStyle::name(); if (!qEnvironmentVariableIsSet("XDG_CURRENT_DESKTOP")) { QIcon::setThemeSearchPaths({resolveFilePath(QStringLiteral(".")), QStringLiteral(":/icons")}); QIcon::setThemeName(QStringLiteral("breeze-internal")); } #if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) //org.kde.desktop.plasma is a couple of files that fall back to desktop by purpose if ((style.isEmpty() || style == QStringLiteral("org.kde.desktop.plasma")) && QFile::exists(resolveFilePath(QStringLiteral("/styles/org.kde.desktop")))) { m_stylesFallbackChain.prepend(QStringLiteral("org.kde.desktop")); } #elif defined(Q_OS_ANDROID) if (!m_stylesFallbackChain.contains(QStringLiteral("Material"))) { m_stylesFallbackChain.prepend(QStringLiteral("Material")); } #else // do we have an iOS specific style? if (!m_stylesFallbackChain.contains(QStringLiteral("Material"))) { m_stylesFallbackChain.prepend(QStringLiteral("Material")); } #endif if (!style.isEmpty() && QFile::exists(resolveFilePath(QStringLiteral("/styles/") + style)) && !m_stylesFallbackChain.contains(style)) { m_stylesFallbackChain.prepend(style); //if we have plasma deps installed, use them for extra integration if (style == QStringLiteral("org.kde.desktop") && QFile::exists(resolveFilePath(QStringLiteral("/styles/org.kde.desktop.plasma")))) { m_stylesFallbackChain.prepend(QStringLiteral("org.kde.desktop.plasma")); } } else { #if !defined(Q_OS_ANDROID) && !defined(Q_OS_IOS) m_stylesFallbackChain.prepend(QStringLiteral("org.kde.desktop")); #endif } //At this point the fallback chain will be selected->org.kde.desktop->Fallback s_selectedStyle = m_stylesFallbackChain.first(); qmlRegisterSingletonType(uri, 2, 0, "Settings", [](QQmlEngine*, QJSEngine*) -> QObject* { Settings *settings = new Settings; settings->setStyle(s_selectedStyle); return settings; } ); qmlRegisterUncreatableType(uri, 2, 0, "ApplicationHeaderStyle", QStringLiteral("Cannot create objects of type ApplicationHeaderStyle")); //old legacy retrocompatible Theme qmlRegisterSingletonType(componentUrl(QStringLiteral("Theme.qml")), uri, 2, 0, "Theme"); qmlRegisterSingletonType(componentUrl(QStringLiteral("Units.qml")), uri, 2, 0, "Units"); qmlRegisterType(componentUrl(QStringLiteral("Action.qml")), uri, 2, 0, "Action"); qmlRegisterType(componentUrl(QStringLiteral("AbstractApplicationHeader.qml")), uri, 2, 0, "AbstractApplicationHeader"); qmlRegisterType(componentUrl(QStringLiteral("AbstractApplicationWindow.qml")), uri, 2, 0, "AbstractApplicationWindow"); qmlRegisterType(componentUrl(QStringLiteral("AbstractListItem.qml")), uri, 2, 0, "AbstractListItem"); qmlRegisterType(componentUrl(QStringLiteral("ApplicationHeader.qml")), uri, 2, 0, "ApplicationHeader"); qmlRegisterType(componentUrl(QStringLiteral("ToolBarApplicationHeader.qml")), uri, 2, 0, "ToolBarApplicationHeader"); qmlRegisterType(componentUrl(QStringLiteral("ApplicationWindow.qml")), uri, 2, 0, "ApplicationWindow"); qmlRegisterType(componentUrl(QStringLiteral("BasicListItem.qml")), uri, 2, 0, "BasicListItem"); qmlRegisterType(componentUrl(QStringLiteral("OverlayDrawer.qml")), uri, 2, 0, "OverlayDrawer"); qmlRegisterType(componentUrl(QStringLiteral("ContextDrawer.qml")), uri, 2, 0, "ContextDrawer"); qmlRegisterType(componentUrl(QStringLiteral("GlobalDrawer.qml")), uri, 2, 0, "GlobalDrawer"); qmlRegisterType(componentUrl(QStringLiteral("Heading.qml")), uri, 2, 0, "Heading"); qmlRegisterType(componentUrl(QStringLiteral("Separator.qml")), uri, 2, 0, "Separator"); qmlRegisterType(componentUrl(QStringLiteral("PageRow.qml")), uri, 2, 0, "PageRow"); qmlRegisterType(uri, 2, 0, "Icon"); qmlRegisterType(componentUrl(QStringLiteral("Label.qml")), uri, 2, 0, "Label"); //TODO: uncomment for 2.3 release //qmlRegisterTypeNotAvailable(uri, 2, 3, "Label", "Label type not supported anymore, use QtQuick.Controls.Label 2.0 instead"); qmlRegisterType(componentUrl(QStringLiteral("OverlaySheet.qml")), uri, 2, 0, "OverlaySheet"); qmlRegisterType(componentUrl(QStringLiteral("Page.qml")), uri, 2, 0, "Page"); qmlRegisterType(componentUrl(QStringLiteral("ScrollablePage.qml")), uri, 2, 0, "ScrollablePage"); qmlRegisterType(componentUrl(QStringLiteral("SplitDrawer.qml")), uri, 2, 0, "SplitDrawer"); qmlRegisterType(componentUrl(QStringLiteral("SwipeListItem.qml")), uri, 2, 0, "SwipeListItem"); //2.1 qmlRegisterType(componentUrl(QStringLiteral("AbstractItemViewHeader.qml")), uri, 2, 1, "AbstractItemViewHeader"); qmlRegisterType(componentUrl(QStringLiteral("ItemViewHeader.qml")), uri, 2, 1, "ItemViewHeader"); qmlRegisterType(componentUrl(QStringLiteral("AbstractApplicationItem.qml")), uri, 2, 1, "AbstractApplicationItem"); qmlRegisterType(componentUrl(QStringLiteral("ApplicationItem.qml")), uri, 2, 1, "ApplicationItem"); //2.2 //Theme changed from a singleton to an attached property qmlRegisterUncreatableType(uri, 2, 2, "Theme", QStringLiteral("Cannot create objects of type Theme, use it as an attached property")); //2.3 qmlRegisterType(componentUrl(QStringLiteral("FormLayout.qml")), uri, 2, 3, "FormLayout"); qmlRegisterUncreatableType(uri, 2, 3, "FormData", QStringLiteral("Cannot create objects of type FormData, use it as an attached property")); qmlRegisterUncreatableType(uri, 2, 3, "MnemonicData", QStringLiteral("Cannot create objects of type MnemonicData, use it as an attached property")); //2.4 qmlRegisterType(componentUrl(QStringLiteral("AbstractCard.qml")), uri, 2, 4, "AbstractCard"); qmlRegisterType(componentUrl(QStringLiteral("Card.qml")), uri, 2, 4, "Card"); qmlRegisterType(componentUrl(QStringLiteral("CardsListView.qml")), uri, 2, 4, "CardsListView"); qmlRegisterType(componentUrl(QStringLiteral("CardsGridView.qml")), uri, 2, 4, "CardsGridView"); qmlRegisterType(componentUrl(QStringLiteral("CardsLayout.qml")), uri, 2, 4, "CardsLayout"); qmlRegisterType(componentUrl(QStringLiteral("InlineMessage.qml")), uri, 2, 4, "InlineMessage"); qmlRegisterUncreatableType(uri, 2, 4, "MessageType", QStringLiteral("Cannot create objects of type MessageType")); qmlRegisterType(uri, 2, 4, "DelegateRecycler"); //2.5 qmlRegisterType(componentUrl(QStringLiteral("ListItemDragHandle.qml")), uri, 2, 5, "ListItemDragHandle"); qmlRegisterType(componentUrl(QStringLiteral("ActionToolBar.qml")), uri, 2, 5, "ActionToolBar"); qmlRegisterUncreatableType(uri, 2, 5, "ScenePosition", QStringLiteral("Cannot create objects of type ScenePosition, use it as an attached property")); //2.6 qmlRegisterType(componentUrl(QStringLiteral("AboutPage.qml")), uri, 2, 6, "AboutPage"); qmlRegisterType(componentUrl(QStringLiteral("LinkButton.qml")), uri, 2, 6, "LinkButton"); qmlRegisterType(componentUrl(QStringLiteral("UrlButton.qml")), uri, 2, 6, "UrlButton"); //2.7 qmlRegisterType(uri, 2, 7, "ColumnView"); qmlRegisterType(componentUrl(QStringLiteral("ActionTextField.qml")), uri, 2, 7, "ActionTextField"); + //2.8 + qmlRegisterType(componentUrl(QStringLiteral("SearchField.qml")), uri, 2, 8, "SearchField"); + qmlRegisterType(componentUrl(QStringLiteral("PasswordField.qml")), uri, 2, 8, "PasswordField"); + qmlProtectModule(uri, 2); } #include "moc_kirigamiplugin.cpp" diff --git a/src/qmldir b/src/qmldir index 07dbb5b9..739673b6 100644 --- a/src/qmldir +++ b/src/qmldir @@ -1,50 +1,52 @@ module org.kde.kirigami classname KirigamiPlugin depends QtQuick.Controls 2.0 depends QtGraphicalEffects 1.0 designersupported typeinfo plugins.qmltypes singleton Theme 2.2 Theme.qml OverlaySheet 2.5 OverlaySheet.qml ApplicationItem 2.1 ApplicationItem.qml AbstractApplicationWindow 2.5 AbstractApplicationWindow.qml FormLayout 2.5 FormLayout.qml GlobalDrawer 2.5 GlobalDrawer.qml OverlayDrawer 2.5 OverlayDrawer.qml BasicListItem 2.5 BasicListItem.qml AbstractItemViewHeader 2.1 AbstractItemViewHeader.qml Heading 2.5 Heading.qml Action 2.5 Action.qml Separator 2.5 Separator.qml ItemViewHeader 2.1 ItemViewHeader.qml SwipeListItem 2.5 SwipeListItem.qml AbstractListItem 2.5 AbstractListItem.qml Icon 2.5 Icon.qml Units 2.5 Units.qml Page 2.5 Page.qml Label 2.5 Label.qml AbstractApplicationItem 2.1 AbstractApplicationItem.qml ToolBarApplicationHeader 2.5 ToolBarApplicationHeader.qml ScrollablePage 2.5 ScrollablePage.qml ApplicationHeader 2.5 ApplicationHeader.qml AbstractApplicationHeader 2.5 AbstractApplicationHeader.qml ContextDrawer 2.5 ContextDrawer.qml ApplicationWindow 2.5 ApplicationWindow.qml PageRow 2.5 PageRow.qml AbstractCard 2.5 AbstractCard.qml Card 2.5 Card.qml CardsLayout 2.5 CardsLayout.qml CardsListView 2.5 CardsListView.qml CardsGridView 2.5 CardsGridView.qml InlineMessage 2.5 InlineMessage.qml ListItemDragHandle 2.5 ListItemDragHandle.qml ActionToolBar 2.5 ActionToolBar.qml BannerImage 2.5 private/BannerImage.qml AboutPage 2.6 AboutPage.qml UrlButton 2.6 UrlButton.qml LinkButton 2.6 LinkButton.qml ActionTextField 2.7 ActionTextField.qml +SearchField 2.8 SearchField.qml +PasswordField 2.8 PasswordField.qml