diff --git a/.appveyor.yml b/.appveyor.yml new file mode 100644 index 00000000..8a9074f2 --- /dev/null +++ b/.appveyor.yml @@ -0,0 +1,39 @@ +version: '{build}' +pull_requests: + do_not_increment_build_number: true +configuration: Release +branches: + except: + - /^(?i:continuous)$/ +skip_tags: true +environment: + matrix: + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + QT_PROFILE: msvc2015 + QTDIR: C:\Qt\5.10.1\msvc2015 + QBS_PROFILE: MSVC2015-x86 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + QT_PROFILE: msvc2017_64 + QTDIR: C:\Qt\5.10.1\msvc2017_64 + QBS_PROFILE: MSVC2017-x86_x64 +init: +- set PATH=%QTDIR%\bin;%PATH% +install: +- choco install -y qbs --version 1.11.0 +before_build: +- qbs setup-toolchains --detect +- qbs setup-qt %QTDIR%\bin\qmake.exe appveyor-qt5 +- qbs config profiles.appveyor-qt5.baseProfile %QBS_PROFILE% +- qbs config defaultProfile appveyor-qt5 +- qbs config preferences.qbsSearchPaths %cd%/fluid/qbs/shared +build_script: +- git submodule update --init --recursive +- qbs -d build --all-products config:release project.autotestEnabled:false project.useSystemQbsShared:false project.deploymentEnabled:false project.withDocumentation:false +- dir build\release\install-root +notifications: +- provider: Slack + incoming_webhook: https://hooks.slack.com/services/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 + channel: '#events' + on_build_success: true + on_build_failure: true + on_build_status_changed: true diff --git a/.gitattributes b/.gitattributes index f90a194d..a25c0c4e 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4,3 +4,4 @@ .gitmodules export-ignore .travis export-ignore .travis.yml export-ignore +.mailmap export-ignore diff --git a/.travis/build.sh b/.travis/build.sh index a19e6fbb..b2407c1b 100755 --- a/.travis/build.sh +++ b/.travis/build.sh @@ -4,6 +4,12 @@ set -e source /usr/local/share/liri-travis/functions +# Install packages +travis_start "install_packages" +msg "Install packages..." +sudo apt-get install -y desktop-file-utils appstream-util +travis_end "install_packages" + # Configure qbs travis_start "qbs_setup" msg "Setup qbs..." @@ -26,3 +32,11 @@ qbs -d build -j $(nproc) --all-products profile:travis-qt5 \ projects.Fluid.useSystemQbsShared:false \ projects.Fluid.deploymentEnabled:true travis_end "build" + +# Validate desktop file and appdata +for filename in $(find . -type f -name "*.desktop"); do + desktop-file-validate $filename +done +for filename in $(find . -type f -name "*.appdata.xml"); do + appstream-util validate-relax --nonet $filename +done diff --git a/.travis/deploy.sh b/.travis/deploy.sh index 0ea38476..dadd22d4 100755 --- a/.travis/deploy.sh +++ b/.travis/deploy.sh @@ -43,5 +43,5 @@ openssl aes-256-cbc -K $encrypted_a841ddf051d0_key -iv $encrypted_a841ddf051d0_i chmod 600 /tmp/github_deploy_key_liri_ci eval "$(ssh-agent -s)" ssh-add /tmp/github_deploy_key_liri_ci -rsync -crvz --rsh="ssh" --delete-after --delete-excluded build/default/fluid-online-doc.*/qdoc_html/ $DEPLOY_USER@$DEPLOY_HOST:$TRAVIS_BRANCH +rsync -crvz --rsh="ssh" --delete-after --delete-excluded build/default/fluid-offline-doc.*/qdoc_html/ $DEPLOY_USER@$DEPLOY_HOST:$TRAVIS_BRANCH scp $filename $DEPLOY_USER@$DEPLOY_HOST:$TRAVIS_BRANCH/$destfilename diff --git a/README.md b/README.md index 2eb1c846..2bfd6d07 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,6 @@ Fluid ===== -[![ZenHub.io](https://img.shields.io/badge/supercharged%20by-zenhub.io-blue.svg)](https://zenhub.io) - [![License](https://img.shields.io/badge/license-MPL2-blue.svg)](https://www.mozilla.org/en-US/MPL/2.0/) [![GitHub release](https://img.shields.io/github/release/lirios/fluid.svg)](https://github.com/lirios/fluid) [![Build Status](https://travis-ci.org/lirios/fluid.svg?branch=develop)](https://travis-ci.org/lirios/fluid) diff --git a/doc/doc.qbs b/doc/doc.qbs index b0426078..e4387911 100644 --- a/doc/doc.qbs +++ b/doc/doc.qbs @@ -11,7 +11,6 @@ Project { condition: project.withDocumentation && !qbs.targetOS.contains("android") references: [ - "online.qbs", "offline.qbs", ] } diff --git a/doc/fluid-online.qdocconf b/doc/fluid-online.qdocconf deleted file mode 100644 index 8331ca4f..00000000 --- a/doc/fluid-online.qdocconf +++ /dev/null @@ -1,67 +0,0 @@ -include(config/fluid-project.qdocconf) -include($QT_INSTALL_DOCS/global/qt-html-templates-offline.qdocconf) - -HTML.nonavigationbar = "false" - -HTML.navigationseparator = "" - -HTML.stylesheets = \ - template/style/base.css \ - template/style/liri.css \ - template/style/liri.eot \ - template/style/liri.svg \ - template/style/liri.ttf \ - template/style/liri.woff - -HTML.headerstyles = \ - "\n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - " \n" \ - "\n" \ - -HTML.headerscripts = \ - " \n" \ - -HTML.endheader = \ - "\n" - -HTML.postheader = \ - "\n" \ - "\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - " \n" \ - " Liri\n" \ - " Fluid API\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - " \n" \ - "
\n" \ - "
    \n" \ - "\n" \ - -HTML.postpostheader = \ - "\n" \ - "
\n" \ - "\n" \ - -HTML.prologue = "" - -HTML.footer = \ - "\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "
\n" \ - "\n" \ diff --git a/doc/offline.qbs b/doc/offline.qbs index b72320af..3f1401d8 100644 --- a/doc/offline.qbs +++ b/doc/offline.qbs @@ -15,8 +15,63 @@ Product { ]) files: [ - "config/*.qdocconf", - "src/*.qdoc", + "config/fluid-project.qdocconf", + "config/macros.qdocconf", + "src/controls/Action.qdoc", + "src/controls/AlertDialog.qdoc", + "src/controls/AppBar.qdoc", + "src/controls/AppToolBar.qdoc", + "src/controls/ApplicationWindow.qdoc", + "src/controls/BodyLabel.qdoc", + "src/controls/BottomSheet.qdoc", + "src/controls/BottomSheetGrid.qdoc", + "src/controls/BottomSheetList.qodc", + "src/controls/CaptionLabel.qdoc", + "src/controls/Card.qdoc", + "src/controls/Chip.qdoc", + "src/controls/CircleImage.qdoc", + "src/controls/DatePickerDialog.qdoc", + "src/controls/DateTimePickerDialog.qdoc", + "src/controls/DialogLabel.qdoc", + "src/controls/DisplayLabel.qdoc", + "src/controls/FloatingActionButton.qdoc", + "src/controls/HeadlineLabel.qdoc", + "src/controls/Icon.qdoc", + "src/controls/InputDialog.qdoc", + "src/controls/ListItem.qdoc", + "src/controls/Loadable.qdoc", + "src/controls/NavigationDrawer.qdoc", + "src/controls/NavigationListView.qdoc", + "src/controls/NoiseBackground.qdoc", + "src/controls/OverlayView.qdoc", + "src/controls/Page.qdoc", + "src/controls/PageSidebar.qdoc", + "src/controls/PageStack.qdoc", + "src/controls/Placeholder.qdoc", + "src/controls/Ripple.qdoc", + "src/controls/SearchBar.qdoc", + "src/controls/Showable.qdoc", + "src/controls/Sidebar.qdoc", + "src/controls/SmoothFadeImage.qdoc", + "src/controls/SmoothFadeLoader.qdoc", + "src/controls/SnackBar.qdoc", + "src/controls/Subheader.qdoc", + "src/controls/SubheadingLabel.qdoc", + "src/controls/Tab.qdoc", + "src/controls/TabbedPage.qdoc", + "src/controls/ThinDivider.qdoc", + "src/controls/TimePickerDialog.qdoc", + "src/controls/TitleLabel.qdoc", + "src/controls/ToolButton.qdoc", + "src/controls/Units.qdoc", + "src/controls/Wave.qdoc", + "src/deployment.qdoc", + "src/fluidcontrols-qmltypes.qdoc", + "src/fluidcore-qmltypes.qdoc", + "src/fluideffects-qmltypes.qdoc", + "src/fluidlayouts-qmltypes.qdoc", + "src/fluidtemplates-qmltypes.qdoc", + "src/index.qdoc", ] Group { @@ -28,7 +83,14 @@ Product { Group { name: "Style" prefix: "template/style/" - files: "**" + files: [ + "base.css", + "liri.css", + "liri.eot", + "liri.svg", + "liri.ttf", + "liri.woff", + ] } Group { diff --git a/doc/online.qbs b/doc/online.qbs deleted file mode 100644 index 88735664..00000000 --- a/doc/online.qbs +++ /dev/null @@ -1,40 +0,0 @@ -import qbs 1.0 - -Product { - name: "fluid-online-doc" - builtByDefault: false - type: "qdoc-output" - - Depends { name: "lirideployment" } - Depends { name: "Qt.core"; versionAtLeast: project.minimumQtVersion } - - Qt.core.qdocEnvironment: project.qdocEnvironment.concat([ - "SRCDIR=" + path, - "QT_INSTALL_DOCS=" + Qt.core.docPath, - "QT_VERSION=" + Qt.core.version - ]) - - files: [ - "config/*.qdocconf", - "src/*.qdoc", - ] - - Group { - name: "Online qdocconf file" - files: "fluid-online.qdocconf" - fileTags: "qdocconf-main" - } - - Group { - name: "Style" - prefix: "template/style/" - files: "**" - } - - Group { - fileTagsFilter: ["qdoc-output"] - qbs.install: true - qbs.installDir: qbs.targetOS.contains("linux") ? lirideployment.docDir + "/fluid/online-html" : "Docs" - qbs.installSourceBase: Qt.core.qdocOutputDir - } -} diff --git a/doc/src/controls/Action.qdoc b/doc/src/controls/Action.qdoc new file mode 100644 index 00000000..2d48d916 --- /dev/null +++ b/doc/src/controls/Action.qdoc @@ -0,0 +1,62 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * Copyright (C) 2018 Michael Spencer + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype Action + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Represents an action shown in an action bar, context menu, or list. + + One of the most common uses of actions is displaying actions in the action bar of a page + using the \l Page::actions property. See the example for \l Page for more details. + + Actions may contain \l text, an \l icon, a \l toolTip and a \l shortcut. + + \snippet fluidcontrols-action.qml action +*/ + +/*! + \qmlproperty string Fluid.Controls::Action::toolTip + + The tool tip displayed for the action. +*/ + +/*! + \qmlproperty bool Fluid.Controls::Action::visible + + Set to \c false to hide the action in the UI. + + This property is \c true by default. +*/ + +/*! + \qmlproperty bool Fluid.Controls::Action::hasDividerAfter + + Set to \c true to display a divider after the control bound to this action. + + This property is \c false by default. +*/ + +/*! + \qmlproperty bool Fluid.Controls::Action::hoverAnimation + + Set to \c true to rotate the icon 90 degrees on mouseover. + + This property is \c false by default. +*/ diff --git a/doc/src/controls/AlertDialog.qdoc b/doc/src/controls/AlertDialog.qdoc new file mode 100644 index 00000000..2080a1c2 --- /dev/null +++ b/doc/src/controls/AlertDialog.qdoc @@ -0,0 +1,41 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype AlertDialog + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Alert dialogs are urgent interruptions to inform the user about a situation. + + An alert dialog is used to interrupt the user's workflow to inform them about + a situation that requires their acknowledgement. + + Most alert don't need a title and they summarize a decision in a sentence or two + by either asking a question or making a statement related to the action buttons. + + \snippet fluidcontrols-alertdialog.qml file + + For more information you can read the + \l{https://material.io/guidelines/components/dialogs.html}{Material Design guidelines}. +*/ + +/*! + \qmlproperty string Fluid.Controls::AlertDialog::text + + Informative text to display. +*/ diff --git a/doc/src/controls/AppBar.qdoc b/doc/src/controls/AppBar.qdoc new file mode 100644 index 00000000..1cf08dd6 --- /dev/null +++ b/doc/src/controls/AppBar.qdoc @@ -0,0 +1,154 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * Copyright (C) 2018 Michael Spencer + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype AppBar + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Application tool bar. + + For more information you can read the + \l{https://material.io/guidelines/layout/structure.html#structure-app-bar}{Material Design guidelines}. +*/ + +/*! + \qmlproperty Action Fluid.Controls::AppBar::leftAction + + The back action to display to the left of the title in the action bar. + When used with a page, this will pick up the page's back action, which + by default is a back arrow when there is a page behind the current page + on the page stack. However, you can customize this, for example, to show + a navigation drawer at the root of your app. + + When using an action bar in a page, set the \l Page::leftAction instead of + directly setting this property. +*/ + +/*! + \qmlproperty list Fluid.Controls::AppBar::actions + + A list of actions to show in the action bar. These actions will be shown + anchored to the right, and will overflow if there are more than the + maximum number of actions as defined in \l maxActionCount. + + When used with a page, the actions will be set to the page's \l Page::actions + property, so set that instead of changing this directly. +*/ + +/*! + \qmlproperty int Fluid.Controls::AppBar::elevation + + The elevation of the action bar. Set to 0 if you want have a header or some + other view below the action bar that you want to appear as part of the action bar. +*/ + +/*! + \qmlproperty color Fluid.Controls::AppBar::backgroundColor + + The background color of the tool bar when the AppBar's page is active. + By default this is the primary color defined in \l Material.primaryColor + + \since Fluid.Controls 1.1 +*/ + +/*! + \qmlproperty color Fluid.Controls::AppBar::decorationColor + + The background color of the window decoration when the AppBar's page is active, + usually a darker version of \l backgroundColor. + By default this is the primary color defined in \l Material.primaryColor with a + shade of \l Material.Shade700. + + \since Fluid.Controls 1.1 +*/ + +/*! + \qmlproperty bool Fluid.Controls::AppBar::overflowMenuVisible + + Value indicates if overflow menu is open or not. + + \readonly + \since Fluid.Controls 1.1 +*/ + +/*! + \qmlproperty real Fluid.Controls::AppBar::leftKeyline + + Keyline to align contents to the left to be visually appealing. +*/ + +/*! + \qmlproperty int Fluid.Controls::AppBar::maxActionCount + + The maximum number of actions that can be displayed before they spill over + into a drop-down menu. When using an action bar with a page, this inherits + from the global \l AppToolBar::maxActionCount. If you are using an action bar + for custom purposes outside of a toolbar, this defaults to \c 3. + + Set to \c 0 if you don't want to overflow actions. +*/ + +/*! + \qmlproperty string Fluid.Controls::AppBar::title + + The title displayed in the action bar. When used in a page, the title will + be set to the title of the page, so set the \l Page::title property instead + of changing this directly. +*/ + +/*! + \qmlproperty list Fluid.Controls::AppBar::customContent + + Custom content to show instead of the title. + + \since Fluid.Controls 1.1 +*/ + +/*! + \qmlproperty list Fluid.Controls::AppBar::extendedContent + + A custom view to show under the row containing the title and actions. + Causes the action bar to be extend in height to contain this view. + + \since Fluid.Controls 1.1 +*/ + +/*! + \qmlproperty real Fluid.Controls::AppBar::extendedContentHeight + \readonly + + The height of the custom view shown under the row containing the + title and actions. + + \since Fluid.Controls 1.1 +*/ + +/*! + \qmlproperty AppToolBar Fluid.Controls::AppBar::toolbar + + Tool bar. +*/ + +/*! + \qmlmethod void Fluid.Controls::AppBar::toggleOverflowMenu() + + Toggle the overflow menu if the number of actions is greater than \l AppBar::maxActionCount. + + \since Fluid.Controls 1.1 +*/ diff --git a/doc/src/controls/AppToolBar.qdoc b/doc/src/controls/AppToolBar.qdoc new file mode 100644 index 00000000..57d45ae2 --- /dev/null +++ b/doc/src/controls/AppToolBar.qdoc @@ -0,0 +1,55 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * Copyright (C) 2018 Michael Spencer + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype AppToolBar + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Application tool bar. + */ + +/*! + \qmlproperty int Fluid.Controls::AppToolBar::maxActionCount + + Maximum actions to be available on this tool bar. +*/ + +/*! + \qmlproperty real Fluid.Controls::AppToolBar::appBarHeight + + Height of the \l AppBar considering its extended content. +*/ + +/*! + \qmlmethod void Fluid.Controls::AppToolBar::pop(Page page) + + Pop the \l AppBar that belongs to \a page from the stack. +*/ + +/*! + \qmlmethod void Fluid.Controls::AppToolBar::push(Page page) + + Push the \l AppBar that belongs to \a page to the stack. +*/ + +/*! + \qmlmethod void Fluid.Controls::AppToolBar::replace(Page page) + + Replace current \l AppBar with the one that belongs to \a page. +*/ diff --git a/doc/src/controls/ApplicationWindow.qdoc b/doc/src/controls/ApplicationWindow.qdoc new file mode 100644 index 00000000..4a00e246 --- /dev/null +++ b/doc/src/controls/ApplicationWindow.qdoc @@ -0,0 +1,86 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * Copyright (C) 2018 Michael Spencer + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype ApplicationWindow + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief A window that provides features commonly used for Material Design apps. + + This is normally what you should use as your root component. It provides a \l ToolBar and + \l PageStack to provide access to standard features used by Material Design applications. + + Here is a short working example of an application: + + \qml + import QtQuick 2.10 + import Fluid.Controls 1.1 as FluidControls + + FluidControls.ApplicationWindow { + title: "Application Name" + width: 1024 + height: 800 + visible: true + + initialPage: page + + FluidControls.Page { + id: page + title: "Page Title" + + Label { + anchors.centerIn: parent + text: "Hello World!" + } + } + } + \endqml +*/ + +/*! + \qmlproperty color Fluid.Controls::ApplicationWindow::decorationColor + + The color of the status bar or window decorations, if the current + platform supports it. +*/ + +/*! + \qmlproperty Theme Fluid.Controls::ApplicationWindow::decorationTheme + + Theme of the status bar or window decoration, if the current + platform supports it. +*/ + +/*! + \qmlproperty AppToolBar Fluid.Controls::ApplicationWindow::appBar + + The tool bar for this application. +*/ + +/*! + \qmlproperty Page Fluid.Controls::ApplicationWindow::initialPage + + The initial page shown when the application starts. +*/ + +/*! + \qmlproperty PageStack Fluid.Controls::ApplicationWindow::pageStack + + The \l PageStack used for controlling pages and transitions between pages. +*/ diff --git a/doc/src/controls/BodyLabel.qdoc b/doc/src/controls/BodyLabel.qdoc new file mode 100644 index 00000000..716f1290 --- /dev/null +++ b/doc/src/controls/BodyLabel.qdoc @@ -0,0 +1,42 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype BodyLabel + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Text label with standard font and styling suitable to body text. + + Text label for the Material Design body text style. + + \snippet fluidcontrols-bodylabel.qml file + + For more information you can read the + \l{https://material.io/guidelines/style/typography.html}{Material Design guidelines}. +*/ + +/*! + \qmlproperty int Fluid.Controls::BodyLabel::level + + This property holds the label level that controls + font style and size. + + It can be either 1 or 2. + + Default value is 1. +*/ diff --git a/doc/src/controls/BottomSheet.qdoc b/doc/src/controls/BottomSheet.qdoc new file mode 100644 index 00000000..a6d0e449 --- /dev/null +++ b/doc/src/controls/BottomSheet.qdoc @@ -0,0 +1,41 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype BottomSheet + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief A sheet of paper that slides up from the bottom. + + A sheet of paper that slides up from the bottom edge of the screen and presents + a set of clear and simple actions. + + \snippet fluidcontrols-bottomsheet.qml file + + For more information you can read the + \l{https://material.io/guidelines/components/bottom-sheets.html}{Material Design guidelines}. +*/ + +/*! + \qmlproperty int Fluid.Controls::BottomSheet::maxHeight + + Maximum height of the bottom sheet. + + By default it's set to the height of the \c ApplicationWindow + minus \c AppBar height. +*/ diff --git a/doc/src/controls/BottomSheetGrid.qdoc b/doc/src/controls/BottomSheetGrid.qdoc new file mode 100644 index 00000000..fc211b2a --- /dev/null +++ b/doc/src/controls/BottomSheetGrid.qdoc @@ -0,0 +1,59 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype BottomSheetGrid + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + \inherits BottomSheet + + \brief A sheet of paper with actions and an optional title that slides up from the bottom. + + A sheet of paper that displays actions in a grid and an optional title that slides up + from the bottom edge of the screen and presents a set of clear and simple actions. + + \snippet fluidcontrols-bottomsheetgrid.qml file + + For more information you can read the + \l{https://material.io/guidelines/components/bottom-sheets.html}{Material Design guidelines}. +*/ + +/*! + \qmlproperty string Fluid.Controls::BottomSheetGrid::title + + Title. +*/ + +/*! + \qmlproperty list Fluid.Controls::BottomSheetGrid::actions + + Actions to display in the bottom sheet. +*/ + +/*! + \qmlproperty int Fluid.Controls::BottomSheetGrid::columns + + Number of columns. + By default it's set to fit the screen width. +*/ + +/*! + \qmlproperty int Fluid.Controls::BottomSheetGrid::rows + + Number of rows. + By default it's set to fit the screen size based on the \l columns. +*/ diff --git a/doc/src/controls/BottomSheetList.qodc b/doc/src/controls/BottomSheetList.qodc new file mode 100644 index 00000000..d7852d87 --- /dev/null +++ b/doc/src/controls/BottomSheetList.qodc @@ -0,0 +1,45 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype BottomSheetList + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + \inherits BottomSheet + + \brief A sheet of paper with actions and an optional title that slides up from the bottom. + + A sheet of paper that displays actions in a list and an optional title that slides up + from the bottom edge of the screen and presents a set of clear and simple actions. + + \snippet fluidcontrols-bottomsheetlist.qml file + + For more information you can read the + \l{https://material.io/guidelines/components/bottom-sheets.html}{Material Design guidelines}. +*/ + +/*! + \qmlproperty string Fluid.Controls::BottomSheetList::title + + Title. +*/ + +/*! + \qmlproperty list Fluid.Controls::BottomSheetList::actions + + Actions to display in the bottom sheet. +*/ diff --git a/doc/src/controls/CaptionLabel.qdoc b/doc/src/controls/CaptionLabel.qdoc new file mode 100644 index 00000000..1c653c07 --- /dev/null +++ b/doc/src/controls/CaptionLabel.qdoc @@ -0,0 +1,31 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype CaptionLabel + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Text label with standard font and styling suitable to captions. + + Text label for the Material Design caption text style. + + \snippet fluidcontrols-captionlabel.qml file + + For more information you can read the + \l{https://material.io/guidelines/style/typography.html}{Material Design guidelines}. +*/ diff --git a/doc/src/controls/Card.qdoc b/doc/src/controls/Card.qdoc new file mode 100644 index 00000000..353ed0d9 --- /dev/null +++ b/doc/src/controls/Card.qdoc @@ -0,0 +1,29 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype Card + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Cards display content composed of different elements. + + \snippet fluidcontrols-card.qml file + + For more information you can read the + \l{https://material.io/guidelines/components/cards.html}{Material Design guidelines}. +*/ diff --git a/doc/src/controls/Chip.qdoc b/doc/src/controls/Chip.qdoc new file mode 100644 index 00000000..125351b7 --- /dev/null +++ b/doc/src/controls/Chip.qdoc @@ -0,0 +1,111 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype Chip + \inherits QtQuick.Controls::AbstractButton + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + \since Fluid.Controls 1.1 + + \brief Chips represent complex entities in small blocks, such as a contact. + + For more information you can read the + \l{https://material.io/guidelines/components/chips.html}{Material Design guidelines}. +*/ + +/*! + \qmlproperty bool Fluid.Controls::Chip::expandable + + This property holds whether this chip can expand to show + more information or options. + + \sa Fluid.Controls::Chip::model + \sa Fluid.Controls::Chip::delegate + \sa Fluid.Controls::Chip::selectedItem +*/ + +/*! + \qmlproperty model Fluid.Controls::Chip::model + + Expandable chips show a popup with a list view when clicked. + + This property holds the model providing data for said list view. + + The following roles are expected to be present: + + \list + \li label - Description of the option + \li value - Actual value of the option + \li imageSource - URL with the image source for the option + \endlist + + \sa Fluid.Controls::Chip::expandable + \sa Fluid.Controls::Chip::delegate + \sa Fluid.Controls::Chip::selectedItem +*/ + +/*! + \qmlproperty Component Fluid.Controls::Chip::delegate + + Expandable chips show a popup with a list view when clicked. + + The delegate provides a template defining each item instantiated + by the list view. + + By default the delegate is a Fluid.Controls::ListItem. + + \sa Fluid.Controls::Chip::expandable + \sa Fluid.Controls::Chip::model + \sa Fluid.Controls::Chip::selectedItem +*/ + +/*! + \qmlproperty Component Fluid.Controls::Chip::selectedItem + \readonly + + Expandable chips show a popup with a list view when clicked. + + This property holds the currently selected item. + + By default the delegate is a Fluid.Controls::ListItem and the + selected item contains the following properties: + + \list + \li string label - Description of the option + \li string value - Actual value of the option + \li url imageSource - URL with the image source for the option + \endlist + + \sa Fluid.Controls::Chip::expandable + \sa Fluid.Controls::Chip::model + \sa Fluid.Controls::Chip::delegate +*/ + + +/*! + \qmlproperty bool Fluid.Controls::Chip::deletable + + This property holds whether the chip can be deleted. + The default value is \c false. +*/ + +/*! + \qmlsignal void Fluid.Controls::Chip::deleted() + + Emitted when the user wants to delete the chip. +*/ diff --git a/doc/src/controls/CircleImage.qdoc b/doc/src/controls/CircleImage.qdoc new file mode 100644 index 00000000..9df2b578 --- /dev/null +++ b/doc/src/controls/CircleImage.qdoc @@ -0,0 +1,81 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype CircleImage + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Circular image. + + An \l Image with a \l CircleMask. +*/ + +/*! + \qmlproperty url Fluid.Controls::CircleImage::source + + URL of the image to load. + + \sa Image::source +*/ + +/*! + \qmlproperty enumeration Fluid.Controls::CircleImage::status + \list + \li Image.Null - no image has been set + \li Image.Ready - the image has been loaded + \li Image.Loading - the image is currently being loaded + \li Image.Error - an error occurred while loading the image + \endlist + + Status of the image loading. + + \sa Image::status +*/ + +/*! + \qmlproperty size Fluid.Controls::CircleImage::sourceSize + + Actual width and height of the loaded image. + + \sa Image::sourceSize +*/ + +/*! + \qmlproperty bool Fluid.Controls::CircleImage::asynchronous + + Specify whether the image should be loaded asynchronously. + + \sa Image::asynchronous +*/ + +/*! + \qmlproperty bool Fluid.Controls::CircleImage::cache + + Specify whether the image should be cached. + + \sa Image::cache +*/ + +/*! + \qmlproperty enumeration Fluid.Controls::CircleImage::fillMode + + Set this property to define what happens when the source image + has a different size than the item. + + \sa Image::fillMode +*/ diff --git a/doc/src/controls/DatePickerDialog.qdoc b/doc/src/controls/DatePickerDialog.qdoc new file mode 100644 index 00000000..5d04d057 --- /dev/null +++ b/doc/src/controls/DatePickerDialog.qdoc @@ -0,0 +1,115 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype DatePickerDialog + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Dialog to select a single date + + Dialog to select a single date from a calendar. + + \code + import QtQuick 2.10 + import Fluid.Controls 1.0 as FluidControls + + Item { + width: 600 + height: 600 + + Button { + anchors.centerIn: parent + text: qsTr("Open") + onClicked: datePickerDialog.open() + } + + FluidControls.DatePickerDialog { + id: datePickerDialog + onAccepted: { + console.log(selectedDate); + } + standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel + } + } + \endcode + + For more information you can read the + \l{https://material.io/guidelines/components/pickers.html}{Material Design guidelines}. +*/ + +/*! + \qmlproperty enumeration Fluid.Controls::DatePickerDialog::orientation + + This property holds the date picker orientation. + The default value is automatically selected based on the device orientation. + + Possible values: + \value DatePicker.Landscape The date picker is landscape. + \value DatePicker.Portrait The date picker is portrait. +*/ + +/*! + \qmlproperty bool Fluid.Controls::DatePickerDialog::dayOfWeekRowVisible + + This property determines the visibility of the day of week row. +*/ + +/*! + \qmlproperty bool Fluid.Controls::DatePickerDialog::weekNumberVisible + + This property determines the visibility of the week number column. +*/ + +/*! + \qmlproperty date Fluid.Controls::DatePickerDialog::from + + This property holds the start date. +*/ + +/*! + \qmlproperty date Fluid.Controls::DatePickerDialog::to + + This property holds the end date. +*/ + +/*! + \qmlproperty date Fluid.Controls::DatePickerDialog::selectedDate + + This property holds the date that has been selected by the user. + The default value is the current date. +*/ + +/*! + \qmlproperty list Fluid.Controls::DatePickerDialog::standardButtonsContainer + + This property allows you to place additional buttons alongside the standard buttons + of the dialog, like in this example: + + \code + FluidControls.DatePickerDialog { + id: datePickerDialog + standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel + standardButtonsContainer: Button { + anchors.verticalCenter: parent.verticalCenter + text: qsTr("Today") + flat: true + onClicked: datePickerDialog.selectedDate = new Date() + } + } + \endcode +*/ diff --git a/doc/src/controls/DateTimePickerDialog.qdoc b/doc/src/controls/DateTimePickerDialog.qdoc new file mode 100644 index 00000000..29b59233 --- /dev/null +++ b/doc/src/controls/DateTimePickerDialog.qdoc @@ -0,0 +1,115 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype DateTimePickerDialog + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Dialog with a picker to select dates and time + + A dialog that lets you select dates and time. + + \code + import QtQuick 2.10 + import Fluid.Controls 1.0 as FluidControls + + Item { + width: 600 + height: 600 + + FluidControls.DateTimePickerDialog { + onAccepted: { + console.log(selectedDate); + } + standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel + } + } + \endcode + + For more information you can read the + \l{https://material.io/guidelines/components/pickers.html}{Material Design guidelines}. +*/ + +/*! + \qmlproperty enumeration Fluid.Controls::DateTimePickerDialog::orientation + + This property holds the picker orientation. + The default value is automatically selected based on the device orientation. + + Possible values: + \value DatePicker.Landscape The picker is landscape. + \value DatePicker.Portrait The picker is portrait. +*/ + +/*! + \qmlproperty bool Fluid.Controls::DateTimePickerDialog::dayOfWeekRowVisible + + This property determines the visibility of the day of week row. +*/ + +/*! + \qmlproperty bool Fluid.Controls::DateTimePickerDialog::weekNumberVisible + + This property determines the visibility of the week number column. +*/ + + +/*! + \qmlproperty bool Fluid.Controls::DateTimePicker::prefer24Hour + + This property determines the visibility of the AM/PM switch. +*/ + +/*! + \qmlproperty date Fluid.Controls::DateTimePickerDialog::from + + This property holds the start date. +*/ + +/*! + \qmlproperty date Fluid.Controls::DateTimePickerDialog::to + + This property holds the end date. +*/ + +/*! + \qmlproperty date Fluid.Controls::DateTimePickerDialog::selectedDateTime + + This property holds the date and time that has been selected by the user. + The default value is the current date and time. +*/ + +/*! + \qmlproperty list Fluid.Controls::DateTimePickerDialog::standardButtonsContainer + + This property allows you to place additional buttons alongside the standard buttons + of the dialog, like in this example: + + \code + FluidControls.DateTimePickerDialog { + id: dateTimePickerDialog + standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel + standardButtonsContainer: Button { + anchors.verticalCenter: parent.verticalCenter + text: qsTr("Now") + flat: true + onClicked: dateTimePickerDialog.selectedDate = new Date() + } + } + \endcode +*/ diff --git a/doc/src/controls/DialogLabel.qdoc b/doc/src/controls/DialogLabel.qdoc new file mode 100644 index 00000000..ffc1b681 --- /dev/null +++ b/doc/src/controls/DialogLabel.qdoc @@ -0,0 +1,31 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype DialogLabel + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Text label with standard font and styling suitable to message box text. + + Text label for the Material Design dialog text style. + + \snippet fluidcontrols-dialoglabel.qml file + + For more information you can read the + \l{https://material.io/guidelines/style/typography.html}{Material Design guidelines}. +*/ diff --git a/doc/src/controls/DisplayLabel.qdoc b/doc/src/controls/DisplayLabel.qdoc new file mode 100644 index 00000000..560bc403 --- /dev/null +++ b/doc/src/controls/DisplayLabel.qdoc @@ -0,0 +1,42 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype DisplayLabel + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Text label with standard font and styling suitable to display text. + + Text label for the Material Design display text style. + + \snippet fluidcontrols-displaylabel.qml file + + For more information you can read the + \l{https://material.io/guidelines/style/typography.html}{Material Design guidelines}. +*/ + +/*! + \qmlproperty int Fluid.Controls::DisplayLabel::level + + This property holds the label level that controls + font style and size. + + Only values between 1 and 4 are allowed. + + Default value is 1. +*/ diff --git a/doc/src/controls/FloatingActionButton.qdoc b/doc/src/controls/FloatingActionButton.qdoc new file mode 100644 index 00000000..245afbaf --- /dev/null +++ b/doc/src/controls/FloatingActionButton.qdoc @@ -0,0 +1,49 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype FloatingActionButton + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief A floating action button. + + A floating action button represents the primary action of the current page + and is used for a promoted action. + + It is a push button with rounded corners and an icon in the center. + + \snippet fluidcontrols-fab.qml file + + For more information you can read the + \l{https://material.io/guidelines/components/buttons-floating-action-button.html}{Material Design guidelines}. +*/ + +/*! + \qmlproperty bool Fluid.Controls::FloatingActionButton::mini + + Floating action button comes in two sizes: + + \list + \li \c Default (56x56 pixels): default size for most use cases + \li \c Mini (40x40 pixels): only used to create visual continuity with other screen elements + \endlist + + This property holds whether the floating action button size is \c Mini or not. + + By default it is \c true if screen width is less than 460 pixels. +*/ diff --git a/doc/src/controls/HeadlineLabel.qdoc b/doc/src/controls/HeadlineLabel.qdoc new file mode 100644 index 00000000..02db7ace --- /dev/null +++ b/doc/src/controls/HeadlineLabel.qdoc @@ -0,0 +1,31 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype HeadlineLabel + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Text label with standard font and styling suitable to headlines. + + Text label for the Material Design headline text style. + + \snippet fluidcontrols-headinglabel.qml file + + For more information you can read the + \l{https://material.io/guidelines/style/typography.html}{Material Design guidelines}. +*/ diff --git a/doc/src/controls/Icon.qdoc b/doc/src/controls/Icon.qdoc new file mode 100644 index 00000000..de4c8c87 --- /dev/null +++ b/doc/src/controls/Icon.qdoc @@ -0,0 +1,146 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype Icon + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Displays an icon from the Material Design icon collection, the platform's icon theme, + or another (local or remote) location. + + To use an icon from the \l{https://materialdesignicons.com/}{Material Design icon collection}, + set the \c name property to the name of the icon in its group in the form of \c group/icon_name. For example: + \code + Icon { + name: "action/settings" + } + \endcode + + This icon will by default use the light icon color from Material Design. To use the dark icon + color: + \code + Icon { + Material.theme: Material.Dark + + name: "action/settings" + } + \endcode + + In addition to using icons from Material Design, you can also use icons from the platform's + \l{http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html}{Freedesktop icon theme}. For example: + + \code + Icon { + name: "gimp" + } + \endcode + + By default, icons from the Freedesktop icon theme are not colorized unless they include the word "symbolic" in the icon name. For example, "gimp" would be full-colored by "edit-cut-symbolic" would be colored using the set \c color property (based off of \c Material.theme). If you need to colorize an icon manually, you can do so like this: + + \code + Icon { + name: "gimp" + colorize: true + } + \endcode + + You can also use custom icons like this: + \code + Icon { + source: Qt.resolvedUrl("icons/fun_icon.png") + } + \endcode +*/ + +/*! + \qmlproperty color Fluid.Controls::Icon::color + + The color of the icon. Defaults to \c Material.iconColor. +*/ + +/*! + \qmlproperty real Fluid.Controls::Icon::size + + The size of the icon. Defaults to 24px. +*/ + +/*! + \qmlproperty string Fluid.Controls::Icon::name + + The name of the icon to display. + + \sa Fluid.Controls::Icon::source +*/ + +/*! + \qmlproperty url Fluid.Controls::Icon::source + + \brief A URL pointing to an image to display as the icon. + + By default, this is a special URL representing the icon named by \l name from the Material + Design icon collection when using the form of "collection/icon_name", or in the case of a + single "icon_name", the platform's Freedesktop icon theme will be used. + + By default, icons from the Material Design icons collection will be treated as symbolic icons and colored using the specified \l color, while icons from the Freedesktop icon theme will + not be colorized. To override this, or set the behavior for your own custom icons, use + \l colorize. + + \sa Fluid.Controls::Icon::name + */ + +/*! + \qmlproperty enumeration Fluid.Controls::Icon::status + \list + \li Image.Null - no image has been set + \li Image.Ready - the image has been loaded + \li Image.Loading - the image is currently being loaded + \li Image.Error - an error occurred while loading the image + \endlist +*/ + +/*! + \qmlproperty bool Fluid.Controls::Icon::cache + + Specifies whether the image should be cached. + The default value is true. + + Setting cache to false is useful when dealing with large images, + to make sure that they aren't cached at the expense of small + 'ui element' images. +*/ + +/*! + \qmlproperty bool Fluid.Controls::Icon::valid + \readonly + + \c true if the icon is valid and fully loaded. +*/ + +/*! + \qmlproperty bool Fluid.Controls::Icon::colorize + + Set to \c false if you want the icon to use the original image's colors and not be + colored using the specified \c color. +*/ + +/*! + \qmlproperty real Fluid.Controls::Icon::sourceSize + \readonly + + Source image size. +*/ diff --git a/doc/src/controls/InputDialog.qdoc b/doc/src/controls/InputDialog.qdoc new file mode 100644 index 00000000..6273d026 --- /dev/null +++ b/doc/src/controls/InputDialog.qdoc @@ -0,0 +1,42 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype InputDialog + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Input dialogs ask the user to input data with certain constraints. + + The dialog is automatically accepted when the Return or Enter key is pressed + and the input in an acceptable state. + + For more information you can read the + \l{https://material.io/guidelines/components/dialogs.html}{Material Design guidelines}. +*/ + +/*! + \qmlproperty TextField Fluid.Controls::InputDialog::textField + + Text field. +*/ + +/*! + \qmlproperty string Fluid.Controls::InputDialog::text + + Dialog text. +*/ diff --git a/doc/src/controls/ListItem.qdoc b/doc/src/controls/ListItem.qdoc new file mode 100644 index 00000000..6540a16d --- /dev/null +++ b/doc/src/controls/ListItem.qdoc @@ -0,0 +1,78 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype ListItem + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + \inherits ItemDelegate + + \brief A standard list item, with one or more lines of text and optional left and right items. +*/ + +/*! + \qmlproperty int Fluid.Controls::ListItem::dividerInset + + How many pixels the divider is from the left border. + This property is set to the \l leftItem width by default. + + \sa Fluid.Controls::ListItem::showDivider + \sa Fluid.Controls::ListItem::leftItem +*/ + +/*! + \qmlproperty bool Fluid.Controls::ListItem::showDivider + + This property holds whether the divider is shown or not. + Default value is \c false. +*/ + +/*! + \qmlproperty int Fluid.Controls::ListItem::maximumLineCount + + Maximum number of text lines allowed to show. +*/ + +/*! + \qmlproperty string Fluid.Controls::ListItem::subText + + Text to display below \l text. +*/ + +/*! + \qmlproperty string Fluid.Controls::ListItem::valueText + + Value text. +*/ + +/*! + \qmlproperty Item Fluid.Controls::ListItem::leftItem + + Item to show on the left. +*/ + +/*! + \qmlproperty Item Fluid.Controls::ListItem::rightItem + + Item to show on the right. +*/ + +/*! + \qmlproperty Item Fluid.Controls::ListItem::secondaryItem + + Secondary item. +*/ diff --git a/doc/src/controls/Loadable.qdoc b/doc/src/controls/Loadable.qdoc new file mode 100644 index 00000000..791e7af2 --- /dev/null +++ b/doc/src/controls/Loadable.qdoc @@ -0,0 +1,66 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype Loadable + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Loadable component. +*/ + +/*! + \qmlproperty Component Fluid.Controls::Loadable::component + + Component to load. +*/ + +/*! + \qmlproperty Animation Fluid.Controls::Loadable::showAnimation + + Animation to play when the component is shown. +*/ + +/*! + \qmlproperty Animation Fluid.Controls::Loadable::hideAnimation + + Animation to play when the component is hidden. +*/ + +/*! + \qmlproperty bool Fluid.Controls::Loadable::asynchronous + + Whether the component is loaded asynchronously or not. +*/ + +/*! + \qmlproperty Item Fluid.Controls::Loadable::item + + Item created after \l Loadable::component is loaded. +*/ + +/*! + \qmlmethod void Fluid.Controls::Loadable::show() + + Show the component. +*/ + +/*! + \qmlmethod void Fluid.Controls::Loadable::hide() + + Hide the component. +*/ diff --git a/doc/src/controls/NavigationDrawer.qdoc b/doc/src/controls/NavigationDrawer.qdoc new file mode 100644 index 00000000..c50c810c --- /dev/null +++ b/doc/src/controls/NavigationDrawer.qdoc @@ -0,0 +1,82 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype NavigationDrawer + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + \inherits Drawer + + \brief The navigation drawer slides in from the left and is a common pattern in apps. + + This is a temporary navigation drawer: it can toggle open or closed. + Closed by default, this type of navigation drawer opens temporarily above all + other content until a section is selected or the overlay is tapped. + + This navigation drawer comes with no contents, therefore it's completely customizable. + + By default the navigation drawer is permanent and pinned on desktop and + temporary on mobile. + + \code + import Fluid.Controls 2.0 as FluidControls + + FluidControls.ApplicationWindow { + width: 400 + height: 400 + visible: true + + Button { + text: "Open" + onClicked: drawer.open() + } + + FluidControls.NavigationDrawer { + topContent: Image { + source: "background.png" + width: parent.width + height: 200 + } + + FluidControls.ListItem { + icon.source: FluidControls.Utils.iconUrl("content/inbox") + text: "Inbox" + } + + FluidControls.ListItem { + icon.source: FluidControls.Utils.iconUrl("content/archive") + text: "Archive" + } + + FluidControls.ListItem { + icon.source: FluidControls.Utils.iconUrl("action/settings") + text: "Settings" + showDivider: true + } + } + } + \endcode + + For more information you can read the + \l{https://material.io/guidelines/patterns/navigation-drawer.html}{Material Design guidelines}. +*/ + +/*! + \qmlproperty list Fluid.Controls::NavigationDrawer::topContent + + The items added to this list will be displayed on top of the contents. +*/ diff --git a/doc/src/controls/NavigationListView.qdoc b/doc/src/controls/NavigationListView.qdoc new file mode 100644 index 00000000..c087ee06 --- /dev/null +++ b/doc/src/controls/NavigationListView.qdoc @@ -0,0 +1,106 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype NavigationListView + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + \inherits Fluid.Controls::NavigationDrawer + + \brief The navigation drawer slides in from the left and is a common pattern in apps. + + This is a temporary navigation drawer: it can toggle open or closed. + Closed by default, this type of navigation drawer opens temporarily above all + other content until a section is selected or the overlay is tapped. + + NavigationDrawer is recommended on phones and tablets. + + This navigation drawer comes with a built-in ListView. + + \code + import QtQuick 2.10 + import QtQuick.Controls 2.3 + import QtQuick.Window 2.2 + import Fluid.Controls 1.0 as FluidControls + + Window { + id: window + width: 400 + height: 400 + visible: true + + Button { + text: "Open" + onClicked: drawer.open() + } + + FluidControls.NavigationListView { + topContent: Image { + width: parent.width + height: 200 + source: "background.png" + } + + actions: [ + FluidControls.Action { + text: "Action 1" + }, + FluidControls.Action { + text: "Action 2" + } + ] + } + } + \endcode + + For more information you can read the + \l{https://material.io/guidelines/patterns/navigation-drawer.html}{Material Design guidelines}. +*/ + +/*! + \qmlproperty int Fluid.Controls::NavigationListView::currentIndex + + The \c currentIndex property holds the index of the current item. +*/ + +/*! + \qmlproperty Item Fluid.Controls::NavigationListView::currentItem + + The \c currentItem property holds the current item. +*/ + +/*! + \qmlproperty bool Fluid.Controls::NavigationListView::autoHighlight + + This property holds whether auto-highlight is enabled. + + If this property is \c true, the current item will be automatically highlighted. + + The default value is \c false. +*/ + +/*! + \qmlproperty list Fluid.Controls::NavigationListView::actions + + List of actions to be displayed by the drawer. +*/ + +/*! + \qmlproperty Component Fluid.Controls::NavigationListView::delegate + + The delegate for item that constitute a menu item. +*/ diff --git a/doc/src/controls/NoiseBackground.qdoc b/doc/src/controls/NoiseBackground.qdoc new file mode 100644 index 00000000..62ce45d1 --- /dev/null +++ b/doc/src/controls/NoiseBackground.qdoc @@ -0,0 +1,40 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype NoiseBackground + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Background with noise. +*/ + +/*! + \qmlproperty Gradient Fluid.Controls::NoiseBackground::gradient + + The gradient to use to fill the rectangle. + + \sa Rectangle::gradient +*/ + +/*! + \qmlproperty color Fluid.Controls::NoiseBackground::color + + The color to use to fill the rectangle. + + \sa Rectangle::color +*/ diff --git a/doc/src/controls/OverlayView.qdoc b/doc/src/controls/OverlayView.qdoc new file mode 100644 index 00000000..37f0fba9 --- /dev/null +++ b/doc/src/controls/OverlayView.qdoc @@ -0,0 +1,33 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype OverlayView + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + \inherits Popup + + \brief Ready made popup centered on its parent. + + This controls provides a ready made popup visual element that can be + used with \l Window or \l ApplicationWindow. + + Overlay is centered to its parent. In order to ensure it is displayed + above other items in the scene, it is recommended to use ApplicationWindow. + ApplicationWindow also provides background dimming effects since Overlay + acts as a modal popup. +*/ diff --git a/doc/src/controls/Page.qdoc b/doc/src/controls/Page.qdoc new file mode 100644 index 00000000..fef931c7 --- /dev/null +++ b/doc/src/controls/Page.qdoc @@ -0,0 +1,136 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * Copyright (C) 2018 Michael Spencer + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype Page + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Represents a page on the navigation page stack. + + Example: + + \qml + import QtQuick 2.10 + import Fluid.Controls 1.1 as FluidControls + + FluidControls.Page { + title: "Application Name" + + actions: [ + FluidControls.Action { + name: "Print" + + // Icon name from the Google Material Design icon pack + icon.source: FluidControls.Utils.iconUrl("action/print") + } + ] + } + \endqml +*/ + +/*! + \qmlproperty Fluid.Controls::AppBar Fluid.Controls::Page::appBar + + The action bar for this page. Use it as a group property to customize + this page's action bar. See the \l Page example for details on how to use + this property. +*/ + +/*! + \qmlproperty list Fluid.Controls::Page::actions + + The page's actions shown in the action bar. +*/ + +/*! + \qmlproperty Fluid.Controls::Action Fluid.Controls::Page::leftAction + + The action shown to the left of the title in the action bar. By default, + this is a back button which shows when there is a page behind the current + page in the page stack. However, you can replace it with your own action, + for example, an icon to open a navigation drawer when on your root page. +*/ + +/*! + \qmlproperty bool Fluid.Controls::Page::canGoBack + + Set by the page stack to true if there is a page behind this page on the + page stack. + + The default value is \c false. +*/ + +/*! + \qmlproperty list Fluid.Controls::Page::customContent + + Custom content to show instead of the title. + + \since Fluid.Controls 1.1 +*/ + +/*! + \qmlproperty Fluid.Controls::PageSidebar Fluid.Controls::Page::rightSidebar + + A sidebar to show on the right of the page. This will have its own + app bar and title, which will split the toolbar into two app bars. + + \since Fluid.Controls 1.1 +*/ + +/*! + \qmlsignal void Fluid.Controls::Page::goBack(var event) + + This signal is emitted when the back action is triggered or back key is released. + + By default, the page will be popped from the page stack. To change the default + behavior, for example to show a confirmation dialog, listen for this signal using + \c onGoBack and set \c event.accepted to \c true. To dismiss the page from your + dialog without triggering this signal and re-showing the dialog, call + \c page.forcePop(). + + \sa Fluid.Controls::Page::forcePop() +*/ + +/*! + \qmlmethod void Fluid.Controls::Page::pop(event event, bool force) + + Pop this page from the page stack. This does nothing if this page is not + the current page on the page stack. + + Use \c force to avoid calling the \l goBack signal. This is useful if you + use the \l goBack signal to show a confirmation dialog, and want to close + the page from your dialog without showing the dialog again. You can also + use \l Fluid.Controls::Page::forcePop() as a shortcut to this behavior. + + \sa Fluid.Controls::Page::forcePop() +*/ + +/*! + \qmlmethod void Fluid.Controls::Page::forcePop() + + Force a pop from the page stack. +*/ + +/*! + \qmlmethod void Fluid.Controls::Page::push(Component component, object properties) + + Push the specified component onto the page stack. + + \sa StackView::push() +*/ diff --git a/doc/src/controls/PageSidebar.qdoc b/doc/src/controls/PageSidebar.qdoc new file mode 100644 index 00000000..9ed01009 --- /dev/null +++ b/doc/src/controls/PageSidebar.qdoc @@ -0,0 +1,26 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * Copyright (C) 2018 Michael Spencer + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype PageSidebar + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Represents a split sidebar in a page, with its own title, actions, and color + in the app bar. +*/ diff --git a/doc/src/controls/PageStack.qdoc b/doc/src/controls/PageStack.qdoc new file mode 100644 index 00000000..2fcef5b1 --- /dev/null +++ b/doc/src/controls/PageStack.qdoc @@ -0,0 +1,43 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype PageStack + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + \inherits StackView + + \brief Manages the page stack used for navigation. +*/ + +/*! + \qmlsignal Fluid.Controls::PageStack::pushed(Item page) + + This signal is emitted when an item is pushed to the stack. +*/ + +/*! + \qmlsignal Fluid.Controls::PageStack::popped(Item page) + + This signal is emitted when an item is popped from the stack. +*/ + +/*! + \qmlsignal Fluid.Controls::PageStack::replaced(Item page) + + This signal is emitted when an item is replaced in the stack. +*/ diff --git a/doc/src/controls/Placeholder.qdoc b/doc/src/controls/Placeholder.qdoc new file mode 100644 index 00000000..c69b3a95 --- /dev/null +++ b/doc/src/controls/Placeholder.qdoc @@ -0,0 +1,45 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype Placeholder + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Shows a placeholder icon and text. + + For more information you can read the + \l{https://material.io/guidelines/patterns/empty-states.html#empty-states-avoiding-completely-empty-states}{Material Design guidelines}. +*/ + +/*! + \qmlproperty object Fluid.Controls::Placeholder::icon + + Icon. +*/ + +/*! + \qmlproperty string Fluid.Controls::Placeholder::text + + Text. +*/ + +/*! + \qmlproperty string Fluid.Controls::Placeholder::subText + + Sub text. +*/ diff --git a/doc/src/controls/Ripple.qdoc b/doc/src/controls/Ripple.qdoc new file mode 100644 index 00000000..722d6e24 --- /dev/null +++ b/doc/src/controls/Ripple.qdoc @@ -0,0 +1,79 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype Ripple + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Represents a Material Design ripple ink animation used in various touchable components. + + This component is useful for including in Material Design-specific components, which should be implemented using the +material file selector. Eventually this should be upstreamed to QtQuick + Controls 2. + + For more information you can read the + \l{https://material.io/guidelines/motion/material-motion.html#material-motion-how-does-material-move}{Material Design guidelines}. +*/ + +/*! + \qmlproperty color Fluid.Controls::Riple::color + + The color of the ripple. Defaults to black with 12% opacity. +*/ + +/*! + \qmlproperty bool Fluid.Controls::Riple::circular + + Set to \c true if the ripple is used on a circular component, such as a button in an + action bar or a floating action button. +*/ + +/*! + \qmlproperty bool Fluid.Controls::Riple::centered + + Set to \c true if the ripple should be centered regardless of where the mouse/touch + input came from. +*/ + +/*! + \qmlproperty bool Fluid.Controls::Riple::focused + + Set to \c true if the component is focused and should display a focus ripple. +*/ + +/*! + \qmlproperty color Fluid.Controls::Riple::focusColor + + The color of the focus ripple. Also used to determine the color of the focus background + behind the ripple. + + \sa Ripple::focused +*/ + +/*! + \qmlproperty int Fluid.Controls::Riple::focusWidth + + The width of the focus ripple. + + \sa Ripple::focused +*/ + +/*! + \qmlproperty Item Fluid.Controls::Riple::control + + Control that that needs the ripple effect. +*/ diff --git a/doc/src/controls/SearchBar.qdoc b/doc/src/controls/SearchBar.qdoc new file mode 100644 index 00000000..4b403430 --- /dev/null +++ b/doc/src/controls/SearchBar.qdoc @@ -0,0 +1,124 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * Copyright (C) 2018 Magnus Groß + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype SearchBar + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Provides a searchbar, that supports autocompletion and displays search results using cards. +*/ + +/*! + \qmlproperty string Fluid.Controls::SearchBar::searchText + + The current search text in the search bar typed in so far. +*/ + +/*! + \qmlproperty model Fluid.Controls::SearchBar::searchSuggestions + + The suggestions to display. + + \sa SearchBar::suggestionTextRole + \sa SearchBar::suggestionDelegate +*/ + +/*! + \qmlproperty Component Fluid.Controls::SearchBar::suggestionDelegate + + The delegate item for the suggestion list view. + + \sa SearchBar::searchSuggestions +*/ + +/*! + \qmlproperty string Fluid.Controls::SearchBar::suggestionTextRole + + The model type that contains the text to display in the suggestion delegate + + \sa SearchBar::searchSuggestions +*/ + +/*! + \qmlproperty string Fluid.Controls::SearchBar::searchPlaceHolder + + The string to display when the search field is empty +*/ + +/*! + \qmlproperty int Fluid.Controls::SearchBar::cardWidth + + The width of the search card. By default the search bar centers in the parent with a margin of 64 each side +*/ + +/*! + \qmlproperty int Fluid.Controls::SearchBar::suggestionsHeight + + The viewable area of the suggestions list until it begins scrolling. +*/ + +/*! + \qmlproperty color Fluid.Controls::SearchBar::waveColor + + The background color of the expanded search bar. +*/ + +/*! + \qmlproperty bool Fluid.Controls::SearchBar::persistent + + Whether the SearchBar is persistent or expandable +*/ + +/*! + \qmlproperty bool Fluid.Controls::SearchBar::expanded + + Whether the SearchBar is currently open +*/ + +/*! + \qmlproperty font Fluid.Controls::SearchBar::searchTextFont + + The font of text in search TextInput box + + \since Fluid.Controls 1.1 +*/ + +/*! + \qmlproperty model Fluid.Controls::SearchBar::searchResults + + The model containing the search results +*/ + +/*! + \qmlsignal Fluid.Controls::SearchBar::search(string query) + + Is emitted, when the user searches for a query. The \a query parameter contains the search query as string. Use this signal to provide search results. +*/ + +/*! + \qmlmethod void Fluid.Controls::SearchBar::open() + + Opens the search bar +*/ + +/*! + \qmlmethod void Fluid.Controls::SearchBar::close() + + Closes the search bar +*/ diff --git a/doc/src/controls/Showable.qdoc b/doc/src/controls/Showable.qdoc new file mode 100644 index 00000000..790b6d32 --- /dev/null +++ b/doc/src/controls/Showable.qdoc @@ -0,0 +1,48 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype Showable + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Showtable component. +*/ + +/*! + \qmlproperty Animation Fluid.Controls::Showable::showAnimation + + Animation to play to show the component. +*/ + +/*! + \qmlproperty Animation Fluid.Controls::Showable::hideAnimation + + Animation to play to hide the component. +*/ + +/*! + \qmlmethod void Fluid.Controls::Showable::show() + + Show the component. +*/ + +/*! + \qmlmethod void Fluid.Controls::Showable::hide() + + Hide the component. +*/ diff --git a/doc/src/controls/Sidebar.qdoc b/doc/src/controls/Sidebar.qdoc new file mode 100644 index 00000000..5c5f7b32 --- /dev/null +++ b/doc/src/controls/Sidebar.qdoc @@ -0,0 +1,78 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype Sidebar + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief A sidebar component for use in adaptive layouts + + To use, simply add an instance to your code, and anchor other components to it. + + To show or hide, set the expanded property. + + By default, the sidebar has a flickable built in, and whatever contents are added + will be placed in the flickable. When you want this disabled, or want to fill the + entire sidebar, set the autoFill property to false. + + Examples: + \code + Item { + property bool wideAspect: width > Units.gu(80) + + Sidebar { + expanded: wideAspect + + // Anchoring is automatic + } + } + \endcode + + For more information you can read the + \l{https://material.io/guidelines/patterns/navigation-drawer.html}{Material Design guidelines}. +*/ + +/*! + \qmlproperty enumeration Fluid.Controls::Sidebar::edge + + This property holds the edge of the window at which the sidebar + will be attached to. The acceptable values are: + + \value Qt.TopEdge The top edge of the window. + \value Qt.LeftEdge The left edge of the window (default). + \value Qt.RightEdge The right edge of the window. + \value Qt.BottomEdge The bottom edge of the window. +*/ + +/*! + \qmlproperty bool Fluid.Controls::Sidebar::expanded + + This property holds whether to show or hide the sidebar. +*/ + +/*! + \qmlproperty bool Fluid.Controls::Sidebar::autoFlick + + This property holds whether the sidebar is flickable or not. +*/ + +/*! + \qmlproperty string Fluid.Controls::Sidebar::header + + This property holds the text displayed as header. +*/ diff --git a/doc/src/controls/SmoothFadeImage.qdoc b/doc/src/controls/SmoothFadeImage.qdoc new file mode 100644 index 00000000..2df20338 --- /dev/null +++ b/doc/src/controls/SmoothFadeImage.qdoc @@ -0,0 +1,199 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * Copyright (C) 2018 The Qt Company Ltd. + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype SmoothFadeImage + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Displays an image and smoothly fade when the source is changed. + + This component can be used in place of an Image when a smooth fade animation + between two sources is needed. + + When the source is changed and the fade animation ends, the image loaded before + is unloaded; this means that only one image at a time is loaded. + + Images are loaded asynchronously and are not cache, so unlike the Image + component the \c asynchronous and \c cache properties are not available. + + Example of usage: + \code + import QtQuick 2.10 + import Fluid.Controls 1.0 + + Item { + width: 128 + height: 128 + + SmoothFadeImage { + anchors.fill: parent + source: "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Qt_logo_2015.svg/1380px-Qt_logo_2015.svg.png" + fillMode: Image.PreserveAspectFit + smooth: true + fadeDuration: 400 + + MouseArea { + anchors.fill: parent + onClicked: parent.source = "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0b/Qt_logo_2016.svg/1280px-Qt_logo_2016.svg.png" + } + } + } + \endcode +*/ + +/*! + \qmlproperty url Fluid.Controls::SmoothFadeImage::source + + The image being displayed. + SmoothFadeImage can handle any image format supported by Qt, loaded + from any URL scheme supported by Qt. + + \sa Image::source +*/ + +/*! + \qmlproperty enumeration Fluid.Controls::SmoothFadeImage::fillMode + + Set this property to define what happens when the source image has a + different size than the item. + + \list + \li Image.Stretch - the image is scaled to fit (default) + \li Image.PreserveAspectFit - the image is scaled uniformly to fit without cropping + \li Image.PreserveAspectCrop - the image is scaled uniformly to fill, cropping if necessary + \li Image.Tile - the image is duplicated horizontally and vertically + \li Image.TileVertically - the image is stretched horizontally and tiled vertically + \li Image.TileHorizontally - the image is stretched vertically and tiled horizontally + \li Image.Pad - the image is not transformed + \endlist + + Defaults to \c Image.Stretch. + + Note that \c clip is false by default which means that the item might + paint outside its bounding rectangle even if the fillMode is set to PreserveAspectCrop. +*/ + +/*! + \qmlproperty int Fluid.Controls::SmoothFadeImage::fadeDuration + + Set this to change the fade animation time (in milliseconds). + Default value is 250 ms. +*/ + +/*! + \qmlproperty bool Fluid.Controls::SmoothFadeImage::running + \readonly + + This property holds whether the fade animation is running or not. +*/ + +/*! + \qmlproperty bool Fluid.Controls::SmoothFadeImage::animationEnabled + + Set this property to false to disable the fade animation. + If the animation is disable, SmoothFadeImage behaves like a normal Image. + + The fade animation is enabled by default. +*/ + +/*! + \qmlproperty size Fluid.Controls::SmoothFadeImage::sourceSize + + This property holds the actual width and height of the loaded image. + + Unlike the \c width and \c height properties, which scale the painting of the + image, this property sets the actual number of pixels stored for the + loaded image so that large images do not use more memory than necessary. + + For example, this ensures the image in memory is no larger than + 1024x1024 pixels, regardless of the SmoothFadeImage's width and height values: + + \code + Rectangle { + width: ... + height: ... + + Image { + anchors.fill: parent + source: "reallyBigImage.jpg" + sourceSize.width: 1024 + sourceSize.height: 1024 + } + } + \endcode + + If the image's actual size is larger than the sourceSize, the image is + scaled down. If only one dimension of the size is set to greater than 0, + the other dimension is set in proportion to preserve the source image's + aspect ratio. (The \c fillMode is independent of this.) + + If both the sourceSize.width and sourceSize.height are set the image + will be scaled down to fit within the specified size, maintaining the + image's aspect ratio. The actual size of the image after scaling is + available via \c Item::implicitWidth and \c Item::implicitHeight. + + If the source is an intrinsically scalable image (eg. SVG), this property + determines the size of the loaded image regardless of intrinsic size. + Avoid changing this property dynamically; rendering an SVG is slow compared + to an image. + + If the source is a non-scalable image (eg. JPEG), the loaded image will be + no greater than this property specifies. For some formats (currently only + JPEG), the whole image will never actually be loaded into memory. + + sourceSize can be cleared to the natural size of the image by setting + sourceSize to undefined. + + Note: Changing this property dynamically causes the image source to be + reloaded, potentially even from the network, if it is not in the disk cache. +*/ + +/*! + \qmlproperty enumeration Fluid.Controls::SmoothFadeImage::status + \readonly + + This property holds the status of image loading. It can be one of: + + \list + \li Image.Null - no image has been set + \li Image.Ready - the image has been loaded + \li Image.Loading - the image is currently being loaded + \li Image.Error - an error occurred while loading the image + \endlist +*/ + +/*! + \qmlproperty bool Fluid.Controls::SmoothFadeImage::smooth + + This property holds whether the image is smoothly filtered when scaled or + transformed. Smooth filtering gives better visual quality, but it may be + slower on some hardware. + + If the image is displayed at its natural size, this property has no + visual or performance effect. + + By default, this property is set to \c true. +*/ + +/*! + \qmlsignal Fluid.Controls::SmoothFadeImage::imageSwapped() + + This signal is emitted when the swap between the old source and the new + one has happened. +*/ diff --git a/doc/src/controls/SmoothFadeLoader.qdoc b/doc/src/controls/SmoothFadeLoader.qdoc new file mode 100644 index 00000000..473818aa --- /dev/null +++ b/doc/src/controls/SmoothFadeLoader.qdoc @@ -0,0 +1,75 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype SmoothFadeLoader + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + \inherits Item + + \brief Displays an item and smoothly fade when the source is changed. + + This component loads an item with a Loader and smoothly fade to another item when + the source URL is changed. + + Items are loaded synchronously, also the item being hidden is not unloaded to + avoid an unpleasant "flash" after the transition. + + Example of usage: + \code + import QtQuick 2.10 + import Fluid.Controls 1.0 + + Item { + width: 640 + height: 480 + + SmoothFadeLoader { + anchors.fill: parent + source: "MyComponent.qml" + fadeDuration: 400 + + MouseArea { + anchors.fill: parent + onClicked: parent.source = "AnotherComponent.qml" + } + } + } + \endcode +*/ + +/*! + \qmlproperty url Fluid.Controls::SmoothFadeLoader::source + + The item being displayed. + + \sa Loader::source +*/ + +/*! + \qmlproperty int Fluid.Controls::SmoothFadeLoader::fadeDuration + + Set this to change the fade animation time (in milliseconds). + Default value is 250 ms. +*/ + +/*! + \qmlproperty bool Fluid.Controls::SmoothFadeLoader::running + \readonly + + This property holds whether the fade animation is running or not. +*/ diff --git a/doc/src/controls/SnackBar.qdoc b/doc/src/controls/SnackBar.qdoc new file mode 100644 index 00000000..5fd0a5e3 --- /dev/null +++ b/doc/src/controls/SnackBar.qdoc @@ -0,0 +1,89 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype SnackBar + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief SnackBar provides a brief feedback about an operation. + + \code + Page { + title: qsTr("Send a message") + + Button { + anchors.centerIn: parent + text: qsTr("Send Message") + onClicked: snackBar.open(qsTr("Message sent")) + } + + SnackBar { + id: snackBar + } + } + \endcode + + SnackBar provides a brief feedback about an operation through a + message at the bottom of the screen. + + It contains a single line of text directly related to the operation performed. + There can be a text action, but no icons. + + For more information you can read the + \l{https://material.io/guidelines/components/snackbars-toasts.html}{Material Design guidelines}. +*/ + +/*! + \qmlproperty bool Fluid.Controls::SnackBar::opened + \readonly + + Whether the snack bar is currently open or not. +*/ + +/*! + \qmlproperty int Fluid.Controls::SnackBar::duration + + Amount of time (in ms) to keep the notification visible. + The default is 2s. +*/ + +/*! + \qmlproperty bool Fluid.Controls::SnackBar::fullWidth + + Whether the bar should take full screen width. + The default depends on the device: full width only on phones and tablets. +*/ + +/*! + \qmlsignal Fluid.Controls::SnackBar::clicked() + + This signal is emitted when the button is clicked. + The handler is \c onClicked. +*/ + +/*! + \qmlmethod void Fluid.Controls::SnackBar::open(string text, string buttonText = "") + + Open the bar with the specified \a text and \a buttonText. +*/ + +/*! + \qmlmethod void Fluid.Controls::SnackBar::close() + + Close the bar. +*/ diff --git a/doc/src/controls/Subheader.qdoc b/doc/src/controls/Subheader.qdoc new file mode 100644 index 00000000..466f8d24 --- /dev/null +++ b/doc/src/controls/Subheader.qdoc @@ -0,0 +1,33 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype Subheader + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Subheaders are special list tiles that delineate distinct sections of a list or grid list. + + For more information you can read the + \l{https://material.io/guidelines/components/subheaders.html}{Material Design guidelines}. +*/ + +/*! + \qmlproperty color Fluid.Controls::Subheader::textColor + + Text color. +*/ diff --git a/doc/src/controls/SubheadingLabel.qdoc b/doc/src/controls/SubheadingLabel.qdoc new file mode 100644 index 00000000..94e13dfe --- /dev/null +++ b/doc/src/controls/SubheadingLabel.qdoc @@ -0,0 +1,42 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype SubheadingLabel + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Text label with standard font and styling suitable to subheading. + + Text label for the Material Design subheading text style. + + \snippet fluidcontrols-subheadinglabel.qml file + + For more information you can read the + \l{https://material.io/guidelines/style/typography.html}{Material Design guidelines}. +*/ + +/*! + \qmlproperty int Fluid.Controls::SubheadingLabel::level + + This property holds the label level that controls + font style and size. + + Only values between 1 and 4 are allowed. + + Default value is 1. +*/ diff --git a/doc/src/controls/Tab.qdoc b/doc/src/controls/Tab.qdoc new file mode 100644 index 00000000..d2b8079a --- /dev/null +++ b/doc/src/controls/Tab.qdoc @@ -0,0 +1,44 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype Tab + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Tab for tabbed pages. + + Tab of a \l TabbedPage. +*/ + +/*! + \qmlproperty object Fluid.Controls::Tab::icon + + This property holds the tab icon information. +*/ + +/*! + \qmlproperty string Fluid.Controls::Tab::title + + The title of this tab. +*/ + +/*! + \qmlproperty bool Fluid.Controls::Tab::canRemove + + Controls whether a close button will be shown for this tab. +*/ diff --git a/doc/src/controls/TabbedPage.qdoc b/doc/src/controls/TabbedPage.qdoc new file mode 100644 index 00000000..ec6ad501 --- /dev/null +++ b/doc/src/controls/TabbedPage.qdoc @@ -0,0 +1,90 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype TabbedPage + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Page with tabs. + + \qml + import QtQuick 2.10 + import Fluid.Controls 1.0 as FluidControls + + FluidControls.ApplicationWindow { + title: "Application Name" + width: 1024 + height: 800 + visible: true + + initialPage: FluidControls.TabbedPage { + FluidControls.Tab { + title: "Tab 1" + + Label { + anchors.centerIn: parent + text: "Hello World!" + } + } + + FluidControls.Tab { + title: "Tab 2" + + Label { + anchors.centerIn: parent + text: "Hello World!" + } + } + } + } + \endqml +*/ + +/*! + \qmlproperty int Fluid.Controls::TabbedPage::count + \readonly + + Number of tabs. +*/ + +/*! + \qmlproperty int Fluid.Controls::TabbedPage::currentIndex + \readonly + + Index of the currently selected tab. +*/ + +/*! + \qmlproperty Item Fluid.Controls::TabbedPage::selectedTab + \readonly + + The currently selected tab. +*/ + +/*! + \qmlproperty ToolBar Fluid.Controls::TabbedPage::tabBar + \readonly + + Tool bar that contains tabs. +*/ + +/*! + \qmlproperty TabBar Fluid.Controls::TabbedPage::tabs + + Tab bar. +*/ diff --git a/doc/src/controls/ThinDivider.qdoc b/doc/src/controls/ThinDivider.qdoc new file mode 100644 index 00000000..8a2b15b2 --- /dev/null +++ b/doc/src/controls/ThinDivider.qdoc @@ -0,0 +1,24 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype ThinDivider + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief A 1px high divider for use in lists and other columns of content. +*/ diff --git a/doc/src/controls/TimePickerDialog.qdoc b/doc/src/controls/TimePickerDialog.qdoc new file mode 100644 index 00000000..65d37927 --- /dev/null +++ b/doc/src/controls/TimePickerDialog.qdoc @@ -0,0 +1,90 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype TimePickerDialog + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Dialog with a picker to select time + + A dialog that lets you selected time. + + \code + import QtQuick 2.10 + import Fluid.Controls 1.0 as FluidControls + + Item { + width: 600 + height: 600 + + FluidControls.TimePickerDialog { + onAccepted: { + console.log(selectedDate); + } + standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel + } + } + \endcode + + For more information you can read the + \l{https://material.io/guidelines/components/pickers.html}{Material Design guidelines}. +*/ + +/*! + \qmlproperty enumeration Fluid.Controls::TimePickerDialog::orientation + + This property holds the picker orientation. + The default value is automatically selected based on the device orientation. + + Possible values: + \value TimePicker.Landscape The picker is landscape. + \value TimePicker.Portrait The picker is portrait. +*/ + +/*! + \qmlproperty bool Fluid.Controls::TimePickerDialog::prefer24Hour + + This property determines the visibility of the AM/PM switch. +*/ + +/*! + \qmlproperty date Fluid.Controls::TimePickerDialog::selectedTime + + This property holds the time that has been selected by the user. + The default value is the current time. +*/ + +/*! + \qmlproperty list Fluid.Controls::TimePickerDialog::standardButtonsContainer + + This property allows you to place additional buttons alongside the standard buttons + of the dialog, like in this example: + + \code + FluidControls.TimePickerDialog { + id: timePickerDialog + standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel + standardButtonsContainer: Button { + anchors.verticalCenter: parent.verticalCenter + text: qsTr("Now") + flat: true + onClicked: timePickerDialog.selectedTime = new Date() + } + } + \endcode +*/ diff --git a/doc/src/controls/TitleLabel.qdoc b/doc/src/controls/TitleLabel.qdoc new file mode 100644 index 00000000..cf8c5146 --- /dev/null +++ b/doc/src/controls/TitleLabel.qdoc @@ -0,0 +1,32 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype TitleLabel + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + \inherits Label + + \brief Text label with standard font and styling suitable to titles. + + Text label for the Material Design title text style. + + \snippet fluidcontrols-titlelabel.qml file + + For more information you can read the + \l{https://material.io/guidelines/style/typography.html}{Material Design guidelines}. +*/ diff --git a/doc/src/controls/ToolButton.qdoc b/doc/src/controls/ToolButton.qdoc new file mode 100644 index 00000000..9499dc18 --- /dev/null +++ b/doc/src/controls/ToolButton.qdoc @@ -0,0 +1,31 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype ToolButton + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief \l ToolButton with a extra features. +*/ + +/*! + \qmlproperty bool Fluid.Controls::ToolButton::hoverAnimation + + Specify whether the icon should be rotated 90 degrees when the mouse hovers. + Default is \c false. +*/ diff --git a/doc/src/controls/Units.qdoc b/doc/src/controls/Units.qdoc new file mode 100644 index 00000000..03336331 --- /dev/null +++ b/doc/src/controls/Units.qdoc @@ -0,0 +1,99 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype Units + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Units. +*/ + +/*! + \qmlproperty int Fluid.Controls::Units::gridUnit + + Fundamental unit of space for sizes depending on the current font. + It correspond to the capital letter M width in pixel. +*/ + +/*! + \qmlproperty real Fluid.Controls::Units::smallSpacing + + The amount of spacing that should be used around smaller UI + elements. It can be used as margin around button box and + spacing between buttons. +*/ + +/*! + \qmlproperty real Fluid.Controls::Units::mediumSpacing + + The amount of spacing that should be used inside medium UI + elements such as padding between title and body text in a dialog box. +*/ + +/*! + \qmlproperty real Fluid.Controls::Units::largeSpacing + + The amount of spacing that should be used inside bigger UI + elements such as padding in a dialog box. +*/ + +/*! + \qmlproperty int Fluid.Controls::Units::shortDuration + + Duration for short animations to make UI events noticeable. +*/ + +/*! + \qmlproperty int Fluid.Controls::Units::mediumDuration + + Duration for medium length animations. +*/ + +/*! + \qmlproperty int Fluid.Controls::Units::longDuration + + Duration for long animations such as windows opening or closing. +*/ + +/*! + \qmlproperty object Fluid.Controls::Units::iconSizes + + Standard icon sizes: + + \list + \li \c iconSizes.tiny + \li \c iconSizes.small + \li \c iconSizes.smallMedium + \li \c iconSizes.medium + \li \c iconSizes.large + \li \c iconSizes.huge + \li \c iconSizes.enormous + \endlist +*/ + +/*! + \qmlmethod int Fluid.Controls::Units::Units::gu(real size) + + Returns a round size in pixels multiplied by grid unit. +*/ + +/*! + \qmlmethod int Fluid.Controls::Units::Units::roundToIconSize(real size) + + Returns the size in pixel closes to the icon size. +*/ diff --git a/doc/src/controls/Wave.qdoc b/doc/src/controls/Wave.qdoc new file mode 100644 index 00000000..f5aaf4a5 --- /dev/null +++ b/doc/src/controls/Wave.qdoc @@ -0,0 +1,88 @@ +/**************************************************************************** + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:FDL$ + * + * Permission is granted to copy, distribute and/or modify this document + * under the terms of the GNU Free Documentation License, Version 1.3 + * or any later version published by the Free Software Foundation; + * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. + * A copy of the license is included in the section entitled "GNU + * Free Documentation License". + * + * $END_LICENSE$ + ***************************************************************************/ + +/*! + \qmltype Wave + \inqmlmodule Fluid.Controls + \ingroup fluidcontrols + + \brief Provides a wave animation for transitioning between views of content. + + For more information you can read the + \l{https://material.io/guidelines/motion/material-motion.html#material-motion-how-does-material-move}{Material Design guidelines}. +*/ + +/*! + \qmlproperty bool Fluid.Controls::Wave::open + + This property holds whether the wave is open. +*/ + +/*! + \qmlproperty real Fluid.Controls::Wave::size + + This property holds the current size of the wave. +*/ + +/*! + \qmlproperty real Fluid.Controls::Wave::initialX + + This property holds the horizontal center of the wave. +*/ + +/*! + \qmlproperty real Fluid.Controls::Wave::initialY + + This property holds the vertical center of the wave. +*/ + +/*! + \qmlproperty real Fluid.Controls::Wave::abstractWidth + + This property holds the abstract width of the wave. +*/ + +/*! + \qmlproperty real Fluid.Controls::Wave::abstractHeight + + This property holds the abstract height of the wave. +*/ + +/*! + \qmlproperty real Fluid.Controls::Wave::diameter + + This property holds the diameter of the completely open wave. +*/ + +/*! + \qmlsignal void Fluid.Controls::Wave::finished(bool open) + + This signal is emitted, when the wave has finished opening or closing. + \a open defines, whether the wave was being opened or closed. +*/ + +/*! + \qmlmethod void Fluid.Controls::Wave::openWave(real x, real y) + + Opens the wave centering the wave at (\a x, \a y). +*/ + +/*! + \qmlmethod void Fluid.Controls::Wave::closeWave(real x, real y) + + Closes the wave centering the wave at (\a x, \a y). +*/ diff --git a/doc/src/fluidcontrols-qmltypes.qdoc b/doc/src/fluidcontrols-qmltypes.qdoc index c29a6c78..976732c3 100644 --- a/doc/src/fluidcontrols-qmltypes.qdoc +++ b/doc/src/fluidcontrols-qmltypes.qdoc @@ -13,7 +13,7 @@ */ /*! - \qmlmodule Fluid.Controls 1.0 + \qmlmodule Fluid.Controls 1.1 \title Fluid Controls QML Types \ingroup qmlmodules @@ -25,7 +25,7 @@ using the following import statement in your .qml file: \badcode - import Fluid.Controls 1.0 as FluidControls + import Fluid.Controls 1.1 as FluidControls \endcode \section1 diff --git a/doc/src/fluidcore-qmltypes.qdoc b/doc/src/fluidcore-qmltypes.qdoc index e9ca369a..fd4f09c6 100644 --- a/doc/src/fluidcore-qmltypes.qdoc +++ b/doc/src/fluidcore-qmltypes.qdoc @@ -13,7 +13,7 @@ */ /*! - \qmlmodule Fluid.Core 1.0 + \qmlmodule Fluid.Core 1.1 \title Fluid Core QML Types \ingroup qmlmodules @@ -25,7 +25,7 @@ using the following import statement in your .qml file: \badcode - import Fluid.Core 1.0 as FluidCore + import Fluid.Core 1.1 as FluidCore \endcode \section1 diff --git a/doc/src/fluideffects-qmltypes.qdoc b/doc/src/fluideffects-qmltypes.qdoc index 9fe23de8..31d28254 100644 --- a/doc/src/fluideffects-qmltypes.qdoc +++ b/doc/src/fluideffects-qmltypes.qdoc @@ -13,7 +13,7 @@ */ /*! - \qmlmodule Fluid.Effects 1.0 + \qmlmodule Fluid.Effects 1.1 \title Fluid Effects QML Types \ingroup qmlmodules @@ -25,7 +25,7 @@ using the following import statement in your .qml file: \badcode - import Fluid.Effects 1.0 as FluidEffects + import Fluid.Effects 1.1 as FluidEffects \endcode \section1 diff --git a/doc/src/fluidlayouts-qmltypes.qdoc b/doc/src/fluidlayouts-qmltypes.qdoc index 40e43ab7..995530d9 100644 --- a/doc/src/fluidlayouts-qmltypes.qdoc +++ b/doc/src/fluidlayouts-qmltypes.qdoc @@ -13,7 +13,7 @@ */ /*! - \qmlmodule Fluid.Layouts 1.0 + \qmlmodule Fluid.Layouts 1.1 \title Fluid Layouts QML Types \ingroup qmlmodules @@ -25,7 +25,7 @@ using the following import statement in your .qml file: \badcode - import Fluid.Layouts 1.0 as FluidLayouts + import Fluid.Layouts 1.1 as FluidLayouts \endcode \section1 diff --git a/doc/src/fluidtemplates-qmltypes.qdoc b/doc/src/fluidtemplates-qmltypes.qdoc index c0f7e83a..5ef1ef97 100644 --- a/doc/src/fluidtemplates-qmltypes.qdoc +++ b/doc/src/fluidtemplates-qmltypes.qdoc @@ -13,7 +13,7 @@ */ /*! - \qmlmodule Fluid.Templates 1.0 + \qmlmodule Fluid.Templates 1.1 \title Fluid Templates QML Types \ingroup qmlmodules @@ -31,7 +31,7 @@ using the following import statement in your \c .qml file: \badcode - import Fluid.Templates 1.0 as FluidTemplates + import Fluid.Templates 1.1 as FluidTemplates \endcode \section1 diff --git a/examples/perproject/minimalqbs/minimalqbs.qbs b/examples/perproject/minimalqbs/minimalqbs.qbs index a2bce432..8b9afbff 100644 --- a/examples/perproject/minimalqbs/minimalqbs.qbs +++ b/examples/perproject/minimalqbs/minimalqbs.qbs @@ -20,8 +20,8 @@ Project { filePath: "fluid/fluid.qbs" Properties { - documentationEnabled: false - demoEnabled: false + withDocumentation: false + withDemo: false autotestEnabled: false } } diff --git a/examples/perproject/minimalqmake/src/main.cpp b/examples/perproject/minimalqmake/src/main.cpp index 21f7a2c6..a134502a 100644 --- a/examples/perproject/minimalqmake/src/main.cpp +++ b/examples/perproject/minimalqmake/src/main.cpp @@ -2,6 +2,14 @@ #include #include +#ifdef QT_STATIC +# include +Q_IMPORT_PLUGIN(FluidCorePlugin) +Q_IMPORT_PLUGIN(FluidControlsPlugin) +Q_IMPORT_PLUGIN(FluidControlsPrivatePlugin) +Q_IMPORT_PLUGIN(FluidTemplatesPlugin) +#endif + int main(int argc, char *argv[]) { QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); diff --git a/examples/perproject/minimalqmake/src/main.qml b/examples/perproject/minimalqmake/src/main.qml index 456fa88a..fcf64696 100644 --- a/examples/perproject/minimalqmake/src/main.qml +++ b/examples/perproject/minimalqmake/src/main.qml @@ -1,5 +1,6 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 +import QtQuick.Controls.Material 2.2 import QtQuick.Layouts 1.3 import Fluid.Controls 1.0 as FluidControls diff --git a/examples/perproject/minimalqmake/src/src.pro b/examples/perproject/minimalqmake/src/src.pro index 277b094f..35f8f292 100644 --- a/examples/perproject/minimalqmake/src/src.pro +++ b/examples/perproject/minimalqmake/src/src.pro @@ -40,10 +40,49 @@ macx { QMAKE_BUNDLE_DATA += APP_QML_FILES } +ios { + # Bundle Fluid QML plugins with the application + APP_QML_FILES_Core.files = $$files($$OUT_PWD/../fluid/qml/Fluid/Core/*qml*) + APP_QML_FILES_Core.path = qml/Fluid/Core + APP_QML_FILES_Controls.files = \ + $$files($$OUT_PWD/../fluid/qml/Fluid/Controls/*qml*) \ + $$OUT_PWD/../fluid/qml/Fluid/Controls/icons + APP_QML_FILES_Controls.path = qml/Fluid/Controls + APP_QML_FILES_ControlsPrivate.files = $$files($$OUT_PWD/../fluid/qml/Fluid/Controls/Private/*qml*) + APP_QML_FILES_ControlsPrivate.path = qml/Fluid/Controls/Private + APP_QML_FILES_Effects.files = $$files($$OUT_PWD/../fluid/qml/Fluid/Effects/*qml*) + APP_QML_FILES_Effects.path = qml/Fluid/Effects + APP_QML_FILES_Layouts.files = $$files($$OUT_PWD/../fluid/qml/Fluid/Layouts/*qml*) + APP_QML_FILES_Layouts.path = qml/Fluid/Layouts + APP_QML_FILES_Templates.files = $$files($$OUT_PWD/../fluid/qml/Fluid/Templates/*qml*) + APP_QML_FILES_Templates.path = qml/Fluid/Templates + QMAKE_BUNDLE_DATA += \ + APP_QML_FILES_Core \ + APP_QML_FILES_Controls \ + APP_QML_FILES_ControlsPrivate \ + APP_QML_FILES_Effects \ + APP_QML_FILES_Layouts \ + APP_QML_FILES_Templates +} + win32 { WINDEPLOYQT_OPTIONS = -qmldir $$OUT_PWD/../fluid/qml/Fluid } +qtConfig(static) { + QMAKE_LIBDIR += \ + $$OUT_PWD/../fluid/qml/Fluid/Core \ + $$OUT_PWD/../fluid/qml/Fluid/Controls \ + $$OUT_PWD/../fluid/qml/Fluid/Controls/Private \ + $$OUT_PWD/../fluid/qml/Fluid/Templates + QTPLUGIN += \ + qsvg \ + fluidcoreplugin \ + fluidcontrolsplugin \ + fluidcontrolsprivateplugin \ + fluidtemplatesplugin +} + # Default rules for deployment. qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin diff --git a/fluid.qbs b/fluid.qbs index edf9b9d6..4f45096f 100644 --- a/fluid.qbs +++ b/fluid.qbs @@ -4,7 +4,7 @@ import qbs.Probes Project { name: "Fluid" - readonly property string version: "1.0.0" + readonly property string version: "1.1.0" readonly property var versionParts: version.split('.').map(function(part) { return parseInt(part); }) readonly property string minimumQtVersion: "5.10.0" diff --git a/qbs/shared b/qbs/shared index 913583b7..ebee5a87 160000 --- a/qbs/shared +++ b/qbs/shared @@ -1 +1 @@ -Subproject commit 913583b77a715dd060df4f9fa8a78adf956c9564 +Subproject commit ebee5a8798ab0a063b56cf7c73be2a28ec353a2e diff --git a/scripts/update_qmltypes.sh b/scripts/update_qmltypes.sh index 108453b3..0183f113 100755 --- a/scripts/update_qmltypes.sh +++ b/scripts/update_qmltypes.sh @@ -10,7 +10,7 @@ case $1 in ;; esac -cmd="${QMLPLUGINDUMP} -noinstantiate -notrelocatable -platform minimal" +cmd="${QMLPLUGINDUMP} -v -noinstantiate -notrelocatable -platform minimal" curpath=`dirname $0` rootpath=`dirname $(readlink -e $curpath)` @@ -24,7 +24,7 @@ function update() { } update Fluid.Core 1.0 core -update Fluid.Controls 1.0 controls +update Fluid.Controls 1.1 controls update Fluid.Controls.Private 1.0 controls-private update Fluid.Effects 1.0 effects update Fluid.Layouts 1.0 layouts diff --git a/src/demo/demo.qbs b/src/demo/demo.qbs index 25b44f2a..be2b8144 100644 --- a/src/demo/demo.qbs +++ b/src/demo/demo.qbs @@ -9,13 +9,22 @@ Project { readonly property stringList qmlImportPaths: [FileInfo.joinPaths(qbs.installRoot, qbs.installPrefix, lirideployment.qmlDir)] name: "fluid-demo" - targetName: "fluid-demo" + targetName: { + if (qbs.targetOS.contains("windows")) + return "FluidDemo"; + return name; + } condition: project.withDemo consoleApplication: false + bundle.identifierPrefix: "io.liri" + bundle.identifier: "io.liri.Fluid.Demo" + bundle.infoPlist: ({"CFBundleName": "Fluid Demo"}) + Depends { name: "lirideployment" } Depends { name: "Qt"; submodules: ["gui", "qml", "quick", "quickcontrols2"]; versionAtLeast: project.minimumQtVersion } Depends { name: "Android.ndk"; condition: qbs.targetOS.contains("android") } + Depends { name: "ib"; condition: qbs.targetOS.contains("macos") } Properties { condition: qbs.targetOS.contains("android") @@ -37,11 +46,56 @@ Project { Qt.core.resourcePrefix: "/" Qt.core.resourceSourceBase: sourceDirectory - files: ["*.cpp", "*.h"] + files: [ + "iconcategorymodel.cpp", + "iconcategorymodel.h", + "iconnamemodel.cpp", + "iconnamemodel.h", + "main.cpp", + ] Group { name: "Resource Data" - files: ["images/**", "qml/**"] + files: [ + "images/balloon.jpg", + "images/materialbg.png", + "qml/Pages/Controls/NavigationListViewPage.qml", + "qml/icons.txt", + "qml/main.qml", + "qml/StyledPage.qml", + "qml/StyledPageTwoColumns.qml", + "qml/StyledRectangle.qml", + "qml/Pages/Basic/BusyIndicatorPage.qml", + "qml/Pages/Basic/ButtonPage.qml", + "qml/Pages/Basic/CheckBoxPage.qml", + "qml/Pages/Basic/ProgressBarPage.qml", + "qml/Pages/Basic/RadioButtonPage.qml", + "qml/Pages/Basic/SliderPage.qml", + "qml/Pages/Basic/SwitchPage.qml", + "qml/Pages/Controls/ActionButtonPage.qml", + "qml/Pages/Controls/BottomSheetPage.qml", + "qml/Pages/Controls/CardPage.qml", + "qml/Pages/Controls/ChipPage.qml", + "qml/Pages/Controls/DatePickerPage.qml", + "qml/Pages/Controls/DateTimePickerPage.qml", + "qml/Pages/Controls/DialogsPage.qml", + "qml/Pages/Controls/ListItemPage.qml", + "qml/Pages/Controls/NavDrawerPage.qml", + "qml/Pages/Controls/OverlayPage.qml", + "qml/Pages/Controls/PlaceholderPage.qml", + "qml/Pages/Controls/SearchPage.qml", + "qml/Pages/Controls/SnackBarPage.qml", + "qml/Pages/Controls/SubPage.qml", + "qml/Pages/Controls/TimePickerPage.qml", + "qml/Pages/Controls/WavePage.qml", + "qml/Pages/Layouts/AutomaticGridPage.qml", + "qml/Pages/Layouts/ColumnFlowPage.qml", + "qml/Pages/Style/IconsPage.qml", + "qml/Pages/Style/PalettePage.qml", + "qml/Pages/Style/PaletteSwatch.qml", + "qml/Pages/Style/SystemIconsPage.qml", + "qml/Pages/Style/TypographyPage.qml", + ] fileTags: ["qt.core.resource_data"] } @@ -78,6 +132,16 @@ Project { qbs.install: true qbs.installDir: lirideployment.appDataDir } + + Group { + condition: qbs.targetOS.contains("unix") && !qbs.targetOS.contains("darwin") + name: "Icons" + prefix: "icons/" + files: ["**/*.png", "**/*.svg"] + qbs.install: true + qbs.installSourceBase: prefix + qbs.installDir: lirideployment.dataDir + "/icons/hicolor" + } } /* diff --git a/src/demo/icons/128x128/apps/io.liri.Fluid.Demo.png b/src/demo/icons/128x128/apps/io.liri.Fluid.Demo.png new file mode 100644 index 00000000..9d658178 Binary files /dev/null and b/src/demo/icons/128x128/apps/io.liri.Fluid.Demo.png differ diff --git a/src/demo/icons/32x32/apps/io.liri.Fluid.Demo.png b/src/demo/icons/32x32/apps/io.liri.Fluid.Demo.png new file mode 100644 index 00000000..21a392a3 Binary files /dev/null and b/src/demo/icons/32x32/apps/io.liri.Fluid.Demo.png differ diff --git a/src/demo/icons/48x48/apps/io.liri.Fluid.Demo.png b/src/demo/icons/48x48/apps/io.liri.Fluid.Demo.png new file mode 100644 index 00000000..e4803fac Binary files /dev/null and b/src/demo/icons/48x48/apps/io.liri.Fluid.Demo.png differ diff --git a/src/demo/icons/64x64/apps/io.liri.Fluid.Demo.png b/src/demo/icons/64x64/apps/io.liri.Fluid.Demo.png new file mode 100644 index 00000000..acb14cbe Binary files /dev/null and b/src/demo/icons/64x64/apps/io.liri.Fluid.Demo.png differ diff --git a/src/demo/icons/scalable/apps/io.liri.Fluid.Demo.svg b/src/demo/icons/scalable/apps/io.liri.Fluid.Demo.svg new file mode 100644 index 00000000..6dbbf68b --- /dev/null +++ b/src/demo/icons/scalable/apps/io.liri.Fluid.Demo.svg @@ -0,0 +1,1386 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/src/demo/io.liri.Fluid.Demo.appdata.xml b/src/demo/io.liri.Fluid.Demo.appdata.xml index 99fcba60..0755c875 100644 --- a/src/demo/io.liri.Fluid.Demo.appdata.xml +++ b/src/demo/io.liri.Fluid.Demo.appdata.xml @@ -1,10 +1,11 @@ io.liri.Fluid.Demo.desktop - CC0-1.0 - GPL-3.0+ Fluid Demo + Liri Demonstrate Fluid QML modules + CC0-1.0 + GPL-3.0+

Fluid is an implementation of the Material Design language for @@ -14,7 +15,29 @@ This app shows what Fluid has to offer.

- + io.liri.Fluid.Demo.desktop + + fluid-demo + + + + https://liri.io/images/apps/fluid/fluid-demo1.png + + + https://liri.io/images/apps/fluid/fluid-demo2.png + + + + ModernToolkit + + + + + + + + https://liri.io - info@liri.io + https://github.com/lirios/fluid/issues/new + info_at_liri.io
diff --git a/src/demo/io.liri.Fluid.Demo.desktop b/src/demo/io.liri.Fluid.Demo.desktop index 2fc4a4df..4dcf93aa 100644 --- a/src/demo/io.liri.Fluid.Demo.desktop +++ b/src/demo/io.liri.Fluid.Demo.desktop @@ -5,3 +5,4 @@ Exec=fluid-demo Terminal=false Type=Application Categories=X-Liri;Qt;Development; +Icon=io.liri.Fluid.Demo diff --git a/src/demo/qml/+material/StyledRectangle.qml b/src/demo/qml/+material/StyledRectangle.qml deleted file mode 100644 index f5bab2bd..00000000 --- a/src/demo/qml/+material/StyledRectangle.qml +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This file is part of Fluid. - * - * Copyright (C) 2018 Pier Luigi Fiorini - * - * $BEGIN_LICENSE:MPL2$ - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * $END_LICENSE$ - */ - -import QtQuick 2.10 -import QtQuick.Controls.Material 2.3 - -Rectangle { - color: Material.background - - Material.theme: index == 0 ? Material.Light : Material.Dark -} diff --git a/src/demo/qml/+universal/StyledRectangle.qml b/src/demo/qml/+universal/StyledRectangle.qml deleted file mode 100644 index 53528663..00000000 --- a/src/demo/qml/+universal/StyledRectangle.qml +++ /dev/null @@ -1,22 +0,0 @@ -/* - * This file is part of Fluid. - * - * Copyright (C) 2018 Pier Luigi Fiorini - * - * $BEGIN_LICENSE:MPL2$ - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * $END_LICENSE$ - */ - -import QtQuick 2.10 -import QtQuick.Controls.Universal 2.3 - -Rectangle { - color: Universal.background - - Universal.theme: index == 0 ? Universal.Light : Universal.Dark -} diff --git a/src/demo/qml/BasicComponents.qml b/src/demo/qml/BasicComponents.qml deleted file mode 100644 index 8cc1e815..00000000 --- a/src/demo/qml/BasicComponents.qml +++ /dev/null @@ -1,80 +0,0 @@ -/* - * This file is part of Fluid. - * - * Copyright (C) 2018 Pier Luigi Fiorini - * - * $BEGIN_LICENSE:MPL2$ - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * $END_LICENSE$ - */ - -import QtQuick 2.10 -import QtQuick.Controls 2.3 -import QtQuick.Controls.Material 2.3 -import QtQuick.Controls.Universal 2.3 -import Fluid.Controls 1.0 -import "Pages/Basic" - -Tab { - title: qsTr("Basic") - - Pane { - id: listPane - anchors { - left: parent.left - top: parent.top - bottom: parent.bottom - } - width: 200 - padding: 0 - z: 2 - - Material.background: "white" - Material.elevation: 1 - - Universal.background: Universal.accent - - ListView { - id: listView - anchors.fill: parent - currentIndex: 0 - model: ListModel { - ListElement { title: qsTr("Button"); source: "qrc:/qml/Pages/Basic/ButtonPage.qml" } - ListElement { title: qsTr("CheckBox"); source: "qrc:/qml/Pages/Basic/CheckBoxPage.qml" } - ListElement { title: qsTr("RadioButton"); source: "qrc:/qml/Pages/Basic/RadioButtonPage.qml" } - ListElement { title: qsTr("Switch"); source: "qrc:/qml/Pages/Basic/SwitchPage.qml" } - ListElement { title: qsTr("ProgressBar"); source: "qrc:/qml/Pages/Basic/ProgressBarPage.qml" } - ListElement { title: qsTr("BusyIndicator"); source: "qrc:/qml/Pages/Basic/BusyIndicatorPage.qml" } - ListElement { title: qsTr("Slider"); source: "qrc:/qml/Pages/Basic/SliderPage.qml" } - } - header: Subheader { - text: qsTr("Demos") - } - delegate: ListItem { - text: model.title - highlighted: ListView.isCurrentItem - onClicked: { - listView.currentIndex = index - stackView.push(model.source) - } - } - - ScrollBar.vertical: ScrollBar {} - } - } - - StackView { - id: stackView - anchors { - left: listPane.right - top: parent.top - right: parent.right - bottom: parent.bottom - } - initialItem: ButtonPage {} - } -} diff --git a/src/demo/qml/Controls.qml b/src/demo/qml/Controls.qml deleted file mode 100644 index d56c0552..00000000 --- a/src/demo/qml/Controls.qml +++ /dev/null @@ -1,87 +0,0 @@ -/* - * This file is part of Fluid. - * - * Copyright (C) 2018 Pier Luigi Fiorini - * - * $BEGIN_LICENSE:MPL2$ - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * $END_LICENSE$ - */ - -import QtQuick 2.10 -import QtQuick.Controls 2.3 -import QtQuick.Controls.Material 2.3 -import QtQuick.Controls.Universal 2.3 -import Fluid.Controls 1.0 -import "Pages/Controls" - -Tab { - title: qsTr("Controls") - - Pane { - id: listPane - anchors { - left: parent.left - top: parent.top - bottom: parent.bottom - } - width: 200 - padding: 0 - z: 2 - - Material.background: "white" - Material.elevation: 1 - - Universal.background: Universal.accent - - ListView { - id: listView - anchors.fill: parent - currentIndex: 0 - model: ListModel { - ListElement { title: qsTr("BottomSheet"); source: "qrc:/qml/Pages/Controls/BottomSheetPage.qml" } - ListElement { title: qsTr("Card"); source: "qrc:/qml/Pages/Controls/CardPage.qml" } - ListElement { title: qsTr("Dialogs"); source: "qrc:/qml/Pages/Controls/DialogsPage.qml" } - ListElement { title: qsTr("DatePicker"); source: "qrc:/qml/Pages/Controls/DatePicker.qml" } - ListElement { title: qsTr("DateTimePicker"); source: "qrc:/qml/Pages/Controls/DateTimePicker.qml" } - ListElement { title: qsTr("FAB"); source: "qrc:/qml/Pages/Controls/ActionButtonPage.qml" } - ListElement { title: qsTr("ListItem"); source: "qrc:/qml/Pages/Controls/ListItemPage.qml" } - ListElement { title: qsTr("NavigationDrawer"); source: "qrc:/qml/Pages/Controls/NavDrawerPage.qml" } - ListElement { title: qsTr("Overlay"); source: "qrc:/qml/Pages/Controls/OverlayPage.qml" } - ListElement { title: qsTr("Placeholder"); source: "qrc:/qml/Pages/Controls/Placeholder.qml" } - ListElement { title: qsTr("Search"); source: "qrc:/qml/Pages/Controls/Search.qml" } - ListElement { title: qsTr("SnackBar"); source: "qrc:/qml/Pages/Controls/SnackBarPage.qml" } - ListElement { title: qsTr("TimePicker"); source: "qrc:/qml/Pages/Controls/TimePicker.qml" } - ListElement { title: qsTr("Wave"); source: "qrc:/qml/Pages/Controls/WavePage.qml" } - } - header: Subheader { - text: qsTr("Demos") - } - delegate: ListItem { - text: model.title - highlighted: ListView.isCurrentItem - onClicked: { - listView.currentIndex = index - stackView.push(model.source) - } - } - - ScrollBar.vertical: ScrollBar {} - } - } - - StackView { - id: stackView - anchors { - left: listPane.right - top: parent.top - right: parent.right - bottom: parent.bottom - } - initialItem: BottomSheetPage {} - } -} diff --git a/src/demo/qml/LayoutComponents.qml b/src/demo/qml/LayoutComponents.qml deleted file mode 100644 index 73dbca80..00000000 --- a/src/demo/qml/LayoutComponents.qml +++ /dev/null @@ -1,75 +0,0 @@ -/* - * This file is part of Fluid. - * - * Copyright (C) 2018 Pier Luigi Fiorini - * - * $BEGIN_LICENSE:MPL2$ - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * $END_LICENSE$ - */ - -import QtQuick 2.10 -import QtQuick.Controls 2.3 -import QtQuick.Controls.Material 2.3 -import QtQuick.Controls.Universal 2.3 -import Fluid.Controls 1.0 -import "Pages/Layouts" - -Tab { - title: qsTr("Layout") - - Pane { - id: listPane - anchors { - left: parent.left - top: parent.top - bottom: parent.bottom - } - width: 200 - padding: 0 - z: 2 - - Material.background: "white" - Material.elevation: 1 - - Universal.background: Universal.accent - - ListView { - id: listView - anchors.fill: parent - currentIndex: 0 - model: ListModel { - ListElement { title: qsTr("AutomaticGrid"); source: "qrc:/qml/Pages/Layouts/AutomaticGridPage.qml" } - ListElement { title: qsTr("ColumnFlow"); source: "qrc:/qml/Pages/Layouts/ColumnFlowPage.qml" } - } - header: Subheader { - text: qsTr("Demos") - } - delegate: ListItem { - text: model.title - highlighted: ListView.isCurrentItem - onClicked: { - listView.currentIndex = index - stackView.push(model.source) - } - } - - ScrollBar.vertical: ScrollBar {} - } - } - - StackView { - id: stackView - anchors { - left: listPane.right - top: parent.top - right: parent.right - bottom: parent.bottom - } - initialItem: AutomaticGridPage {} - } -} diff --git a/src/demo/qml/Pages/Basic/BusyIndicatorPage.qml b/src/demo/qml/Pages/Basic/BusyIndicatorPage.qml index 83e5f228..77e16247 100644 --- a/src/demo/qml/Pages/Basic/BusyIndicatorPage.qml +++ b/src/demo/qml/Pages/Basic/BusyIndicatorPage.qml @@ -14,31 +14,11 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import QtQuick.Layouts 1.3 -import "../.." +import "../.." as Components -Flickable { - clip: true - contentHeight: Math.max(layout.implicitHeight, height) - - ScrollBar.vertical: ScrollBar {} - - ColumnLayout { - id: layout - anchors.fill: parent - - Repeater { - model: 2 - - StyledRectangle { - Layout.fillWidth: true - Layout.fillHeight: true - - BusyIndicator { - anchors.centerIn: parent - running: true - } - } - } +Components.StyledPage { + BusyIndicator { + anchors.centerIn: parent + running: true } } diff --git a/src/demo/qml/Pages/Basic/ButtonPage.qml b/src/demo/qml/Pages/Basic/ButtonPage.qml index 831a9b5d..bd3b8e8d 100644 --- a/src/demo/qml/Pages/Basic/ButtonPage.qml +++ b/src/demo/qml/Pages/Basic/ButtonPage.qml @@ -15,116 +15,84 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import Fluid.Controls 1.0 -import "../.." +import Fluid.Controls 1.1 +import "../.." as Components -Flickable { - clip: true - contentHeight: Math.max(layout.implicitHeight, height) +Components.StyledPageTwoColumns { + leftColumn: ColumnLayout { + anchors.centerIn: parent - ScrollBar.vertical: ScrollBar {} - - ColumnLayout { - id: layout - anchors.fill: parent - - Repeater { - model: 2 - - StyledRectangle { - Layout.fillWidth: true - Layout.fillHeight: true - Layout.minimumWidth: grid.width + 80 - Layout.minimumHeight: grid.height + 80 - - GridLayout { - id: grid - anchors.centerIn: parent - columns: 2 - rows: 6 - - // Row 1 - - TitleLabel { - text: qsTr("Enabled") - - Layout.alignment: Qt.AlignHCenter - } - - TitleLabel { - text: qsTr("Disabled") - - Layout.alignment: Qt.AlignHCenter - } - - // Row 2 - - Button { - text: qsTr("Button") - } - - Button { - text: qsTr("Button") - enabled: false - } - - // Row 3 - - Button { - text: qsTr("Checked") - checkable: false - checked: true - } - - Button { - text: qsTr("Checked") - checkable: false - checked: true - enabled: false - } - - // Row 4 - - Button { - text: qsTr("Flat") - flat: true - } - - Button { - text: qsTr("Flat") - flat: true - enabled: false - } - - // Row 5 - - Button { - text: qsTr("Highlighted") - highlighted: true - } - - Button { - text: qsTr("Highlighted") - highlighted: true - enabled: false - } - - // Row 6 - - Button { - text: qsTr("Flat Highlighted") - flat: true - highlighted: true - } - - Button { - text: qsTr("Flat Highlighted") - flat: true - highlighted: true - enabled: false - } - } - } + TitleLabel { + text: qsTr("Enabled") + + Layout.alignment: Qt.AlignHCenter + } + + Button { + text: qsTr("Button") + } + + Button { + text: qsTr("Checked") + checkable: false + checked: true + } + + Button { + text: qsTr("Flat") + flat: true + } + + Button { + text: qsTr("Highlighted") + highlighted: true + } + + Button { + text: qsTr("Flat Highlighted") + flat: true + highlighted: true + } + } + + rightColumn: ColumnLayout { + anchors.centerIn: parent + + TitleLabel { + text: qsTr("Disabled") + + Layout.alignment: Qt.AlignHCenter + } + + Button { + text: qsTr("Button") + enabled: false + } + + Button { + text: qsTr("Checked") + checkable: false + checked: true + enabled: false + } + + Button { + text: qsTr("Flat") + flat: true + enabled: false + } + + Button { + text: qsTr("Highlighted") + highlighted: true + enabled: false + } + + Button { + text: qsTr("Flat Highlighted") + flat: true + highlighted: true + enabled: false } } } diff --git a/src/demo/qml/Pages/Basic/CheckBoxPage.qml b/src/demo/qml/Pages/Basic/CheckBoxPage.qml index 33232a15..058d8f88 100644 --- a/src/demo/qml/Pages/Basic/CheckBoxPage.qml +++ b/src/demo/qml/Pages/Basic/CheckBoxPage.qml @@ -16,86 +16,50 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import Fluid.Controls 1.0 -import "../.." +import Fluid.Controls 1.1 +import "../.." as Components -Flickable { - clip: true - contentHeight: Math.max(layout.implicitHeight, height) +Components.StyledPageTwoColumns { + leftColumn: ColumnLayout { + anchors.centerIn: parent - ScrollBar.vertical: ScrollBar {} + TitleLabel { + text: qsTr("Enabled") - ColumnLayout { - id: layout - anchors.fill: parent - - Repeater { - model: 2 - - StyledRectangle { - Layout.fillWidth: true - Layout.fillHeight: true - Layout.minimumWidth: grid.width + 80 - Layout.minimumHeight: grid.height + 80 - - GridLayout { - id: grid - anchors.centerIn: parent - columns: 3 - rows: 3 - - // Row 1 - - Item { - width: 1 - height: 1 - } - - TitleLabel { - text: qsTr("Enabled") - - Layout.alignment: Qt.AlignHCenter - } - - TitleLabel { - text: qsTr("Disabled") - - Layout.alignment: Qt.AlignHCenter - } - - // Row 2 + Layout.alignment: Qt.AlignHCenter + } - Label { - text: qsTr("On") - } + CheckBox { + checked: true + text: checked ? qsTr("On") : qsTr("Off") + } - CheckBox { - checked: true - text: qsTr("CheckBox") - } + CheckBox { + checked: false + checkable: false + text: qsTr("Off") + } + } - CheckBox { - checked: true - enabled: false - text: qsTr("CheckBox") - } + rightColumn: ColumnLayout { + anchors.centerIn: parent - // Row 3 + TitleLabel { + text: qsTr("Disabled") - Label { - text: qsTr("Off") - } + Layout.alignment: Qt.AlignHCenter + } - CheckBox { - text: qsTr("CheckBox") - } + CheckBox { + checked: true + enabled: false + text: qsTr("On") + } - CheckBox { - text: qsTr("CheckBox") - enabled: false - } - } - } + CheckBox { + checked: false + enabled: false + text: qsTr("Off") } } } diff --git a/src/demo/qml/Pages/Basic/ProgressBarPage.qml b/src/demo/qml/Pages/Basic/ProgressBarPage.qml index e8c32d68..f792e326 100644 --- a/src/demo/qml/Pages/Basic/ProgressBarPage.qml +++ b/src/demo/qml/Pages/Basic/ProgressBarPage.qml @@ -15,110 +15,98 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import Fluid.Controls 1.0 -import "../.." +import Fluid.Controls 1.1 +import "../.." as Components -Flickable { - clip: true - contentHeight: Math.max(layout.implicitHeight, height) +Components.StyledPageTwoColumns { + leftColumn: ColumnLayout { + anchors.centerIn: parent - ScrollBar.vertical: ScrollBar {} + TitleLabel { + text: qsTr("Determinate") - ColumnLayout { - id: layout - anchors.fill: parent + Layout.alignment: Qt.AlignHCenter + } - Repeater { - model: 2 + GridLayout { + rows: 2 + columns: 2 - StyledRectangle { - Layout.fillWidth: true - Layout.fillHeight: true - Layout.minimumWidth: grid.width + 80 - Layout.minimumHeight: grid.height + 80 + Label { + text: qsTr("Static") + } - GridLayout { - id: grid - anchors.centerIn: parent - columns: 3 + ProgressBar { + from: 0.0 + to: 1.0 + value: 0.5 + indeterminate: false + } - // Row 1 + Label { + text: qsTr("Animated") + } - Item { - width: 1 - height: 1 - } + ProgressBar { + from: 0.0 + to: 1.0 + indeterminate: false - TitleLabel { - text: qsTr("Determinate") + SequentialAnimation on value { + running: true + loops: NumberAnimation.Infinite - Layout.alignment: Qt.AlignHCenter + NumberAnimation { + from: 0.0 + to: 1.0 + duration: 3000 } + } + } + } + } - TitleLabel { - text: qsTr("Indeterminate") + rightColumn: ColumnLayout { + anchors.centerIn: parent - Layout.alignment: Qt.AlignHCenter - } + TitleLabel { + text: qsTr("Indeterminate") - // Row 2 + Layout.alignment: Qt.AlignHCenter + } - Label { - text: qsTr("Static") - } + GridLayout { + rows: 2 + columns: 2 - ProgressBar { - from: 0.0 - to: 1.0 - value: 0.5 - indeterminate: false - } + Label { + text: qsTr("Static") + } - ProgressBar { - from: 0.0 - to: 1.0 - value: 0.5 - indeterminate: true - } + ProgressBar { + from: 0.0 + to: 1.0 + value: 0.5 + indeterminate: true + } - // Row 3 + Label { + text: qsTr("Animated") + } - Label { - text: qsTr("Animated") - } + ProgressBar { + from: 0.0 + to: 1.0 + indeterminate: true - ProgressBar { - from: 0.0 - to: 1.0 - indeterminate: false - - SequentialAnimation on value { - running: true - loops: NumberAnimation.Infinite - - NumberAnimation { - from: 0.0 - to: 1.0 - duration: 3000 - } - } - } + SequentialAnimation on value { + running: true + loops: NumberAnimation.Infinite - ProgressBar { + NumberAnimation { from: 0.0 to: 1.0 - indeterminate: true - - SequentialAnimation on value { - running: true - loops: NumberAnimation.Infinite - - NumberAnimation { - from: 0.0 - to: 1.0 - duration: 3000 - } - } + duration: 3000 } } } diff --git a/src/demo/qml/Pages/Basic/RadioButtonPage.qml b/src/demo/qml/Pages/Basic/RadioButtonPage.qml index 68562a53..e328718d 100644 --- a/src/demo/qml/Pages/Basic/RadioButtonPage.qml +++ b/src/demo/qml/Pages/Basic/RadioButtonPage.qml @@ -15,86 +15,51 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import Fluid.Controls 1.0 -import "../.." +import Fluid.Controls 1.1 +import "../.." as Components -Flickable { - clip: true - contentHeight: Math.max(layout.implicitHeight, height) +Components.StyledPageTwoColumns { + leftColumn: ColumnLayout { + anchors.centerIn: parent - ScrollBar.vertical: ScrollBar {} + TitleLabel { + text: qsTr("Enabled") - ColumnLayout { - id: layout - anchors.fill: parent - - Repeater { - model: 2 - - StyledRectangle { - Layout.fillWidth: true - Layout.fillHeight: true - Layout.minimumWidth: grid.width + 80 - Layout.minimumHeight: grid.height + 80 - - GridLayout { - id: grid - anchors.centerIn: parent - columns: 3 - rows: 3 - - // Row 1 - - Item { - width: 1 - height: 1 - } - - TitleLabel { - text: qsTr("Enabled") - - Layout.alignment: Qt.AlignHCenter - } - - TitleLabel { - text: qsTr("Disabled") - - Layout.alignment: Qt.AlignHCenter - } - - // Row 2 + Layout.alignment: Qt.AlignHCenter + } - Label { - text: qsTr("On") - } + RadioButton { + checked: true + text: checked ? qsTr("On") : qsTr("Off") + } - RadioButton { - checked: true - text: qsTr("RadioButton") - } + RadioButton { + checked: false + checkable: false + text: qsTr("Off") + } + } - RadioButton { - checked: true - enabled: false - text: qsTr("RadioButton") - } + rightColumn: ColumnLayout { + anchors.centerIn: parent - // Row 3 + TitleLabel { + text: qsTr("Disabled") - Label { - text: qsTr("Off") - } + Layout.alignment: Qt.AlignHCenter + } - RadioButton { - text: qsTr("RadioButton") - } + RadioButton { + enabled: false + checked: true + text: checked ? qsTr("On") : qsTr("Off") + } - RadioButton { - text: qsTr("RadioButton") - enabled: false - } - } - } + RadioButton { + enabled: false + checked: false + checkable: false + text: qsTr("Off") } } } diff --git a/src/demo/qml/Pages/Basic/SliderPage.qml b/src/demo/qml/Pages/Basic/SliderPage.qml index ccf8064b..7877f224 100644 --- a/src/demo/qml/Pages/Basic/SliderPage.qml +++ b/src/demo/qml/Pages/Basic/SliderPage.qml @@ -15,137 +15,128 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import Fluid.Controls 1.0 -import "../.." - -Flickable { - clip: true - contentHeight: Math.max(layout.implicitHeight, height) - - ScrollBar.vertical: ScrollBar {} - - ColumnLayout { - id: layout - anchors.fill: parent - - Repeater { - model: 2 - - StyledRectangle { - Layout.fillWidth: true - Layout.fillHeight: true - Layout.minimumWidth: grid.width + 80 - Layout.minimumHeight: grid.height + 80 - - GridLayout { - id: grid - anchors.centerIn: parent - columns: 3 - rows: 3 - - // Row 1 - - Item { - width: 1 - height: 1 - } - - TitleLabel { - text: qsTr("Enabled") - - Layout.alignment: Qt.AlignHCenter - } - - TitleLabel { - text: qsTr("Disabled") - - Layout.alignment: Qt.AlignHCenter - } - - // Row 2 - - Label { - text: qsTr("Horizontal / Single") - } - - Slider { - from: 0.0 - to: 1.0 - value: 0.5 - } - - Slider { - from: 0.0 - to: 1.0 - value: 0.5 - enabled: false - } - - // Row 3 - - Label { - text: qsTr("Horizontal / Range") - } - - RangeSlider { - from: 0.0 - to: 1.0 - first.value: 0.4 - second.value: 0.6 - } - - RangeSlider { - from: 0.0 - to: 1.0 - first.value: 0.4 - second.value: 0.6 - enabled: false - } - - // Row 4 - - Label { - text: qsTr("Vertical / Single") - } - - Slider { - from: 0.0 - to: 1.0 - value: 0.5 - orientation: Qt.Vertical - } - - Slider { - from: 0.0 - to: 1.0 - value: 0.5 - enabled: false - orientation: Qt.Vertical - } - - // Row 5 - - Label { - text: qsTr("Vertical / Range") - } - - RangeSlider { - from: 0.0 - to: 1.0 - first.value: 0.4 - second.value: 0.6 - orientation: Qt.Vertical - } - - RangeSlider { - from: 0.0 - to: 1.0 - first.value: 0.4 - second.value: 0.6 - enabled: false - orientation: Qt.Vertical - } - } +import Fluid.Controls 1.1 +import "../.." as Components + +Components.StyledPageTwoColumns { + leftColumn: ColumnLayout { + anchors.centerIn: parent + + TitleLabel { + text: qsTr("Enabled") + + Layout.alignment: Qt.AlignHCenter + } + + GridLayout { + rows: 4 + columns: 2 + + Label { + text: qsTr("Horizontal / Single") + } + + Slider { + from: 0.0 + to: 1.0 + value: 0.5 + } + + Label { + text: qsTr("Horizontal / Range") + } + + RangeSlider { + from: 0.0 + to: 1.0 + first.value: 0.4 + second.value: 0.6 + } + + Label { + text: qsTr("Vertical / Single") + } + + Slider { + from: 0.0 + to: 1.0 + value: 0.5 + orientation: Qt.Vertical + } + + Label { + text: qsTr("Vertical / Range") + } + + RangeSlider { + from: 0.0 + to: 1.0 + first.value: 0.4 + second.value: 0.6 + orientation: Qt.Vertical + } + } + } + + rightColumn: ColumnLayout { + anchors.centerIn: parent + + TitleLabel { + text: qsTr("Disabled") + + Layout.alignment: Qt.AlignHCenter + } + + GridLayout { + rows: 4 + columns: 2 + + Label { + text: qsTr("Horizontal / Single") + } + + Slider { + enabled: false + from: 0.0 + to: 1.0 + value: 0.5 + } + + Label { + text: qsTr("Horizontal / Range") + } + + RangeSlider { + enabled: false + from: 0.0 + to: 1.0 + first.value: 0.4 + second.value: 0.6 + } + + Label { + text: qsTr("Vertical / Single") + } + + Slider { + enabled: false + from: 0.0 + to: 1.0 + value: 0.5 + orientation: Qt.Vertical + } + + Label { + text: qsTr("Vertical / Range") + } + + RangeSlider { + enabled: false + from: 0.0 + to: 1.0 + first.value: 0.4 + second.value: 0.6 + orientation: Qt.Vertical } } } diff --git a/src/demo/qml/Pages/Basic/SwitchPage.qml b/src/demo/qml/Pages/Basic/SwitchPage.qml index a3d28f30..80fa0bce 100644 --- a/src/demo/qml/Pages/Basic/SwitchPage.qml +++ b/src/demo/qml/Pages/Basic/SwitchPage.qml @@ -15,86 +15,51 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import Fluid.Controls 1.0 -import "../.." +import Fluid.Controls 1.1 +import "../.." as Components -Flickable { - clip: true - contentHeight: Math.max(layout.implicitHeight, height) +Components.StyledPageTwoColumns { + leftColumn: ColumnLayout { + anchors.centerIn: parent - ScrollBar.vertical: ScrollBar {} + TitleLabel { + text: qsTr("Enabled") - ColumnLayout { - id: layout - anchors.fill: parent - - Repeater { - model: 2 - - StyledRectangle { - Layout.fillWidth: true - Layout.fillHeight: true - Layout.minimumWidth: grid.width + 80 - Layout.minimumHeight: grid.height + 80 - - GridLayout { - id: grid - anchors.centerIn: parent - columns: 3 - rows: 3 - - // Row 1 - - Item { - width: 1 - height: 1 - } - - TitleLabel { - text: qsTr("Enabled") - - Layout.alignment: Qt.AlignHCenter - } - - TitleLabel { - text: qsTr("Disabled") - - Layout.alignment: Qt.AlignHCenter - } - - // Row 2 + Layout.alignment: Qt.AlignHCenter + } - Label { - text: qsTr("On") - } + Switch { + checked: true + text: checked ? qsTr("On") : qsTr("Off") + } - Switch { - checked: true - text: qsTr("Switch") - } + Switch { + checked: false + checkable: false + text: qsTr("Off") + } + } - Switch { - checked: true - enabled: false - text: qsTr("Switch") - } + rightColumn: ColumnLayout { + anchors.centerIn: parent - // Row 3 + TitleLabel { + text: qsTr("Disabled") - Label { - text: qsTr("Off") - } + Layout.alignment: Qt.AlignHCenter + } - Switch { - text: qsTr("Switch") - } + Switch { + enabled: false + checked: true + text: checked ? qsTr("On") : qsTr("Off") + } - Switch { - text: qsTr("Switch") - enabled: false - } - } - } + Switch { + enabled: false + checked: false + checkable: false + text: qsTr("Off") } } } diff --git a/src/demo/qml/Pages/Controls/ActionButtonPage.qml b/src/demo/qml/Pages/Controls/ActionButtonPage.qml index 6c487855..8e9ebdbd 100644 --- a/src/demo/qml/Pages/Controls/ActionButtonPage.qml +++ b/src/demo/qml/Pages/Controls/ActionButtonPage.qml @@ -14,92 +14,71 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import Fluid.Controls 1.0 as FluidControls -import "../.." +import Fluid.Controls 1.1 as FluidControls +import "../.." as Components -Flickable { - clip: true - contentHeight: Math.max(layout.implicitHeight, height) +Components.StyledPageTwoColumns { + leftColumn: Column { + anchors.centerIn: parent - ScrollBar.vertical: ScrollBar {} - - Column { - id: layout - anchors.fill: parent - - Repeater { - model: 2 - - StyledRectangle { - //y: height * index - width: parent.width - height: parent.height / 2 - - Row { - anchors.centerIn: parent - spacing: 64 + FluidControls.TitleLabel { + text: qsTr("Enabled") + } - Column { - FluidControls.TitleLabel { - text: qsTr("Enabled") - } + FluidControls.FloatingActionButton { + icon.source: FluidControls.Utils.iconUrl("device/airplanemode_active") + mini: false + } - FluidControls.FloatingActionButton { - icon.source: FluidControls.Utils.iconUrl("device/airplanemode_active") - mini: false - } + FluidControls.FloatingActionButton { + icon.source: FluidControls.Utils.iconUrl("navigation/check") + highlighted: true + mini: false + } - FluidControls.FloatingActionButton { - icon.source: FluidControls.Utils.iconUrl("navigation/check") - highlighted: true - mini: false - } + FluidControls.FloatingActionButton { + icon.source: FluidControls.Utils.iconUrl("device/airplanemode_active") + mini: true + } - FluidControls.FloatingActionButton { - icon.source: FluidControls.Utils.iconUrl("device/airplanemode_active") - mini: true - } + FluidControls.FloatingActionButton { + icon.source: FluidControls.Utils.iconUrl("navigation/check") + highlighted: true + mini: true + } + } - FluidControls.FloatingActionButton { - icon.source: FluidControls.Utils.iconUrl("navigation/check") - highlighted: true - mini: true - } - } + rightColumn: Column { + anchors.centerIn: parent - Column { - FluidControls.TitleLabel { - text: qsTr("Disabled") - } + FluidControls.TitleLabel { + text: qsTr("Disabled") + } - FluidControls.FloatingActionButton { - icon.source: FluidControls.Utils.iconUrl("device/airplanemode_active") - mini: false - enabled: false - } + FluidControls.FloatingActionButton { + icon.source: FluidControls.Utils.iconUrl("device/airplanemode_active") + mini: false + enabled: false + } - FluidControls.FloatingActionButton { - icon.source: FluidControls.Utils.iconUrl("navigation/check") - highlighted: true - mini: false - enabled: false - } + FluidControls.FloatingActionButton { + icon.source: FluidControls.Utils.iconUrl("navigation/check") + highlighted: true + mini: false + enabled: false + } - FluidControls.FloatingActionButton { - icon.source: FluidControls.Utils.iconUrl("device/airplanemode_active") - mini: true - enabled: false - } + FluidControls.FloatingActionButton { + icon.source: FluidControls.Utils.iconUrl("device/airplanemode_active") + mini: true + enabled: false + } - FluidControls.FloatingActionButton { - icon.source: FluidControls.Utils.iconUrl("navigation/check") - highlighted: true - mini: true - enabled: false - } - } - } - } + FluidControls.FloatingActionButton { + icon.source: FluidControls.Utils.iconUrl("navigation/check") + highlighted: true + mini: true + enabled: false } } } diff --git a/src/demo/qml/Pages/Controls/BottomSheetPage.qml b/src/demo/qml/Pages/Controls/BottomSheetPage.qml index c4d6b63f..67c0abed 100644 --- a/src/demo/qml/Pages/Controls/BottomSheetPage.qml +++ b/src/demo/qml/Pages/Controls/BottomSheetPage.qml @@ -15,7 +15,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 -import Fluid.Controls 1.0 as FluidControls +import Fluid.Controls 1.1 as FluidControls Item { Column { diff --git a/src/demo/qml/Pages/Controls/CardPage.qml b/src/demo/qml/Pages/Controls/CardPage.qml index 4a3ff069..b86857e9 100644 --- a/src/demo/qml/Pages/Controls/CardPage.qml +++ b/src/demo/qml/Pages/Controls/CardPage.qml @@ -14,9 +14,10 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import Fluid.Controls 1.0 +import Fluid.Controls 1.1 +import "../.." as Components -Item { +Components.StyledPage { Card { id: card anchors.centerIn: parent diff --git a/src/demo/qml/Pages/Controls/ChipPage.qml b/src/demo/qml/Pages/Controls/ChipPage.qml new file mode 100644 index 00000000..13c4c2bd --- /dev/null +++ b/src/demo/qml/Pages/Controls/ChipPage.qml @@ -0,0 +1,327 @@ +/* + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:MPL2$ + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * $END_LICENSE$ + */ + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Controls.Material 2.3 +import Fluid.Core 1.0 as FluidCore +import Fluid.Controls 1.1 as FluidControls +import "../.." as Components + +Components.StyledPage { + Column { + anchors.centerIn: parent + spacing: 16 + + Column { + spacing: 16 + + FluidControls.TitleLabel { + text: qsTr("Input Chips") + } + + FluidCore.SortFilterProxyModel { + id: contactModel + + sourceModel: ListModel { + ListElement { + label: "Contact Name 1" + value: "primaryemail@email.com" + imageSource: "qrc:/images/balloon.jpg" + } + ListElement { + label: "Contact Name 2" + value: "email2@email.com" + imageSource: "qrc:/images/balloon.jpg" + } + ListElement { + label: "Contact Name 3" + value: "email3@email.com" + imageSource: "qrc:/images/balloon.jpg" + } + } + sortExpression: { + return (modelLeft.weight < modelRight.weight) && (modelRight.email < modelRight.email); + } + } + + Row { + spacing: 8 + + FluidControls.Chip { + id: inputChip1 + iconItem: FluidControls.CircleImage { + source: inputChip1.selectedItem.imageSource + width: 24 + height: 24 + } + text: selectedItem.label + expandable: true + model: contactModel + onSelectedItemChanged: console.info(selectedItem.value) + } + + FluidControls.Chip { + id: inputChip2 + iconItem: FluidControls.CircleImage { + source: inputChip2.selectedItem.imageSource + width: 24 + height: 24 + } + text: selectedItem.label + expandable: true + deletable: true + model: contactModel + onDeleted: console.info(qsTr("Deleted")) + onSelectedItemChanged: console.info(selectedItem.value) + } + } + } + + Column { + spacing: 16 + + FluidControls.TitleLabel { + text: qsTr("Color Chips") + } + + ButtonGroup { + id: colorChipsGroup + } + + Row { + spacing: 8 + + FluidControls.Chip { + id: colorChip1 + iconItem: Rectangle { + width: 24 + height: 24 + radius: 12 + color: Material.color(Material.Blue) + + FluidControls.Icon { + anchors.centerIn: parent + source: colorChip1.checked ? FluidControls.Utils.iconUrl("navigation/check") : "" + size: 20 + } + } + text: qsTr("Blue 500") + checkable: true + ButtonGroup.group: colorChipsGroup + } + + FluidControls.Chip { + id: colorChip2 + iconItem: Rectangle { + width: 24 + height: 24 + radius: 12 + color: Material.color(Material.Green) + + FluidControls.Icon { + anchors.centerIn: parent + source: colorChip2.checked ? FluidControls.Utils.iconUrl("navigation/check") : "" + size: 20 + } + } + text: qsTr("Green 500") + checkable: true + ButtonGroup.group: colorChipsGroup + } + + FluidControls.Chip { + id: colorChip3 + iconItem: Rectangle { + width: 24 + height: 24 + radius: 12 + color: Material.color(Material.Red) + + FluidControls.Icon { + anchors.centerIn: parent + source: colorChip3.checked ? FluidControls.Utils.iconUrl("navigation/check") : "" + size: 20 + } + } + text: qsTr("Red 500") + checkable: true + ButtonGroup.group: colorChipsGroup + } + } + } + + Column { + spacing: 16 + + FluidControls.TitleLabel { + text: qsTr("Choice Chips") + } + + ButtonGroup { + id: choiceChipsGroup + } + + Row { + id: choiceChips + spacing: 8 + + FluidControls.Chip { + checkable: true + checked: true + text: qsTr("Extra Soft") + ButtonGroup.group: choiceChipsGroup + } + + FluidControls.Chip { + checkable: true + text: qsTr("Soft") + ButtonGroup.group: choiceChipsGroup + } + + FluidControls.Chip { + checkable: true + text: qsTr("Medium") + ButtonGroup.group: choiceChipsGroup + } + + FluidControls.Chip { + checkable: true + text: qsTr("Hard") + ButtonGroup.group: choiceChipsGroup + } + } + } + + Column { + spacing: 16 + + FluidControls.TitleLabel { + text: qsTr("Filter Chips") + } + + ButtonGroup { + id: filterChipsGroup + exclusive: false + } + + Row { + id: filterChips + spacing: 8 + + FluidControls.Chip { + checkable: true + checked: true + text: qsTr("Elevator") + icon.source: checked ? FluidControls.Utils.iconUrl("navigation/check") : "" + ButtonGroup.group: filterChipsGroup + } + + FluidControls.Chip { + checkable: true + text: qsTr("Washer / Dryer") + icon.source: checked ? FluidControls.Utils.iconUrl("navigation/check") : "" + ButtonGroup.group: filterChipsGroup + } + + FluidControls.Chip { + checkable: true + text: qsTr("Fireplace") + icon.source: checked ? FluidControls.Utils.iconUrl("navigation/check") : "" + ButtonGroup.group: filterChipsGroup + } + + FluidControls.Chip { + checkable: true + text: qsTr("Wheelchair access") + icon.source: checked ? FluidControls.Utils.iconUrl("navigation/check") : "" + ButtonGroup.group: filterChipsGroup + } + + FluidControls.Chip { + checkable: true + text: qsTr("Dogs ok") + icon.source: checked ? FluidControls.Utils.iconUrl("navigation/check") : "" + ButtonGroup.group: filterChipsGroup + } + + FluidControls.Chip { + checkable: true + text: qsTr("Cats ok") + icon.source: checked ? FluidControls.Utils.iconUrl("navigation/check") : "" + ButtonGroup.group: filterChipsGroup + } + } + } + + Column { + spacing: 16 + + FluidControls.TitleLabel { + text: qsTr("Chips") + } + + Row { + spacing: 8 + + FluidControls.Chip { + text: qsTr("Chip") + } + FluidControls.Chip { + text: qsTr("Deletable chip") + deletable: true + onDeleted: console.info(qsTr("Deleted")) + } + } + + Row { + spacing: 8 + + FluidControls.Chip { + text: qsTr("Chip with icon") + icon.source: FluidControls.Utils.iconUrl("action/face") + } + FluidControls.Chip { + text: qsTr("Deletable chip with icon") + icon.source: FluidControls.Utils.iconUrl("social/person") + deletable: true + onDeleted: console.info(qsTr("Deleted")) + } + } + + Row { + spacing: 8 + + FluidControls.Chip { + iconItem: FluidControls.CircleImage { + source: "qrc:/images/balloon.jpg" + width: 24 + height: 24 + } + text: qsTr("Chip with image") + } + FluidControls.Chip { + iconItem: FluidControls.CircleImage { + source: "qrc:/images/balloon.jpg" + width: 24 + height: 24 + } + text: qsTr("Deletable chip with image") + deletable: true + onDeleted: console.info(qsTr("Deleted")) + } + } + } + } +} diff --git a/src/demo/qml/Pages/Controls/DatePicker.qml b/src/demo/qml/Pages/Controls/DatePickerPage.qml similarity index 98% rename from src/demo/qml/Pages/Controls/DatePicker.qml rename to src/demo/qml/Pages/Controls/DatePickerPage.qml index 53aaa235..bf3b8749 100644 --- a/src/demo/qml/Pages/Controls/DatePicker.qml +++ b/src/demo/qml/Pages/Controls/DatePickerPage.qml @@ -15,7 +15,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 -import Fluid.Controls 1.0 as FluidControls +import Fluid.Controls 1.1 as FluidControls import "../.." as Components Components.StyledPage { diff --git a/src/demo/qml/Pages/Controls/DateTimePicker.qml b/src/demo/qml/Pages/Controls/DateTimePickerPage.qml similarity index 98% rename from src/demo/qml/Pages/Controls/DateTimePicker.qml rename to src/demo/qml/Pages/Controls/DateTimePickerPage.qml index 74ed809e..1dbd3dcd 100644 --- a/src/demo/qml/Pages/Controls/DateTimePicker.qml +++ b/src/demo/qml/Pages/Controls/DateTimePickerPage.qml @@ -15,7 +15,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 -import Fluid.Controls 1.0 as FluidControls +import Fluid.Controls 1.1 as FluidControls import "../.." as Components Components.StyledPage { diff --git a/src/demo/qml/Pages/Controls/DialogsPage.qml b/src/demo/qml/Pages/Controls/DialogsPage.qml index e46f581b..80daeeed 100644 --- a/src/demo/qml/Pages/Controls/DialogsPage.qml +++ b/src/demo/qml/Pages/Controls/DialogsPage.qml @@ -14,7 +14,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import Fluid.Controls 1.0 as FluidControls +import Fluid.Controls 1.1 as FluidControls Item { Column { diff --git a/src/demo/qml/Pages/Controls/ListItemPage.qml b/src/demo/qml/Pages/Controls/ListItemPage.qml index d8c4ded9..736ee747 100644 --- a/src/demo/qml/Pages/Controls/ListItemPage.qml +++ b/src/demo/qml/Pages/Controls/ListItemPage.qml @@ -13,28 +13,77 @@ */ import QtQuick 2.10 +import QtQuick.Layouts 1.0 import QtQuick.Controls 2.3 -import Fluid.Controls 1.0 +import Fluid.Controls 1.0 as FluidControls import "../.." Page { - ListView { + ColumnLayout { anchors.fill: parent - model: ListModel { - ListElement { title: "List Item 1"; source: "qrc:/qml/Pages/Controls/SubPage.qml" } - ListElement { title: "List Item 2"; source: "qrc:/qml/Pages/Controls/SubPage.qml" } - ListElement { title: "List Item 3"; source: "qrc:/qml/Pages/Controls/SubPage.qml" } - ListElement { title: "List Item 4"; source: "qrc:/qml/Pages/Controls/SubPage.qml" } - ListElement { title: "List Item 5"; source: "qrc:/qml/Pages/Controls/SubPage.qml" } + + FluidControls.ListItem { + text: "ListItem with only text" + } + + FluidControls.ListItem { + text: "ListItem with sub text" + subText: "Sub text" + } + + FluidControls.ListItem { + text: "ListItem with sub text and 2/2 lines" + subText: "Sub text line 1\nSub text line 2" + } + + FluidControls.ListItem { + text: "ListItem with sub text and 3/3 lines" + subText: "Sub text line 1\nSub text line 2\nSub text line 3" + maximumLineCount: 3 + } + + FluidControls.ListItem { + text: "ListItem with sub text and 4/4 lines" + subText: "Sub text line 1\nSub text line 2\nSub text line 3\nSub text line 4" + maximumLineCount: 4 } - header: Subheader { - text: "Header" + + FluidControls.ListItem { + text: "ListItem with sub text and 5/3 lines" + subText: "Sub text line 1\nSub text line 2\nSub text line 3\nSub text line 4\nSub text line 5" + maximumLineCount: 3 } - delegate: ListItem { - text: model.title - onClicked: pageStack.push(model.source) + + FluidControls.ListItem { + text: "ListItem with value text" + valueText: "Value" } - ScrollIndicator.vertical: ScrollIndicator {} + FluidControls.ListItem { + icon.source: FluidControls.Utils.iconUrl("action/event") + text: "ListItem with icon" + } + + FluidControls.ListItem { + text: "ListItem with custom rightItem" + rightItem: Switch { + anchors.centerIn: parent + checked: true + } + } + + FluidControls.ListItem { + text: "ListItem with custom secondaryItem" + secondaryItem: Slider { + width: parent.width + from: 0 + to: 100 + value: 50 + } + } + + Item { + Layout.fillHeight: true + } } } diff --git a/src/demo/qml/Pages/Controls/NavDrawerPage.qml b/src/demo/qml/Pages/Controls/NavDrawerPage.qml index 682ced8c..777c89df 100644 --- a/src/demo/qml/Pages/Controls/NavDrawerPage.qml +++ b/src/demo/qml/Pages/Controls/NavDrawerPage.qml @@ -14,7 +14,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import Fluid.Controls 1.0 +import Fluid.Controls 1.1 import "../.." Item { diff --git a/src/demo/qml/Pages/Controls/NavigationListViewPage.qml b/src/demo/qml/Pages/Controls/NavigationListViewPage.qml new file mode 100644 index 00000000..2f114039 --- /dev/null +++ b/src/demo/qml/Pages/Controls/NavigationListViewPage.qml @@ -0,0 +1,55 @@ +/* + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:MPL2$ + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * $END_LICENSE$ + */ + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import Fluid.Controls 1.1 as FluidControls +import "../.." + +Item { + FluidControls.NavigationListView { + id: navListView + + autoHighlight: autoHighlightCheckBox.checked + + topContent: Image { + width: parent.width + height: 200 + source: "qrc:/images/materialbg.png" + } + + actions: [ + FluidControls.Action { + text: "Action 1" + }, + FluidControls.Action { + text: "Action 2" + } + ] + } + + Column { + anchors.centerIn: parent + + CheckBox { + id: autoHighlightCheckBox + text: qsTr("Auto highlight") + } + + Button { + text: navListView.opened ? qsTr("Close") : qsTr("Open") + onClicked: navListView.opened ? navListView.close() : navListView.open() + } + } +} diff --git a/src/demo/qml/Pages/Controls/OverlayPage.qml b/src/demo/qml/Pages/Controls/OverlayPage.qml index aec25b16..e05a3771 100644 --- a/src/demo/qml/Pages/Controls/OverlayPage.qml +++ b/src/demo/qml/Pages/Controls/OverlayPage.qml @@ -14,7 +14,7 @@ import QtQuick 2.10 import QtQuick.Controls.Material 2.3 -import Fluid.Controls 1.0 as FluidControls +import Fluid.Controls 1.1 as FluidControls Item { Image { diff --git a/src/demo/qml/Pages/Controls/Placeholder.qml b/src/demo/qml/Pages/Controls/Placeholder.qml deleted file mode 100644 index 32bdea09..00000000 --- a/src/demo/qml/Pages/Controls/Placeholder.qml +++ /dev/null @@ -1,47 +0,0 @@ -/* - * This file is part of Fluid. - * - * Copyright (C) 2018 Pier Luigi Fiorini - * - * $BEGIN_LICENSE:MPL2$ - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * $END_LICENSE$ - */ - -import QtQuick 2.10 -import QtQuick.Controls 2.3 -import QtQuick.Layouts 1.3 -import Fluid.Controls 1.0 as FluidControls -import "../.." - -Flickable { - clip: true - contentHeight: Math.max(layout.implicitHeight, height) - - ScrollBar.vertical: ScrollBar {} - - ColumnLayout { - id: layout - anchors.fill: parent - - Repeater { - model: 2 - - StyledRectangle { - Layout.fillWidth: true - Layout.fillHeight: true - - FluidControls.Placeholder { - anchors.centerIn: parent - icon.source: FluidControls.Utils.iconUrl("social/notifications_none") - text: qsTr("No notifications") - subText: qsTr("At the moment there are no notifications available") - } - } - } - } -} diff --git a/src/demo/qml/Pages/Controls/PlaceholderPage.qml b/src/demo/qml/Pages/Controls/PlaceholderPage.qml new file mode 100644 index 00000000..d95c0fce --- /dev/null +++ b/src/demo/qml/Pages/Controls/PlaceholderPage.qml @@ -0,0 +1,28 @@ +/* + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:MPL2$ + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * $END_LICENSE$ + */ + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 +import Fluid.Controls 1.1 as FluidControls +import "../.." as Components + +Components.StyledPage { + FluidControls.Placeholder { + anchors.centerIn: parent + icon.source: FluidControls.Utils.iconUrl("social/notifications_none") + text: qsTr("No notifications") + subText: qsTr("At the moment there are no notifications available") + } +} diff --git a/src/demo/qml/Pages/Controls/Search.qml b/src/demo/qml/Pages/Controls/SearchPage.qml similarity index 98% rename from src/demo/qml/Pages/Controls/Search.qml rename to src/demo/qml/Pages/Controls/SearchPage.qml index 009a4c22..d5d06e7c 100644 --- a/src/demo/qml/Pages/Controls/Search.qml +++ b/src/demo/qml/Pages/Controls/SearchPage.qml @@ -15,7 +15,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 -import Fluid.Controls 1.0 as FluidControls +import Fluid.Controls 1.1 as FluidControls Item { FluidControls.SearchBar { diff --git a/src/demo/qml/Pages/Controls/SnackBarPage.qml b/src/demo/qml/Pages/Controls/SnackBarPage.qml index dec9a2f2..0bd9af43 100644 --- a/src/demo/qml/Pages/Controls/SnackBarPage.qml +++ b/src/demo/qml/Pages/Controls/SnackBarPage.qml @@ -14,7 +14,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import Fluid.Controls 1.0 as FluidControls +import Fluid.Controls 1.1 as FluidControls Item { Column { diff --git a/src/demo/qml/Pages/Controls/SubPage.qml b/src/demo/qml/Pages/Controls/SubPage.qml index 2aa9eab9..9e7ad19f 100644 --- a/src/demo/qml/Pages/Controls/SubPage.qml +++ b/src/demo/qml/Pages/Controls/SubPage.qml @@ -13,7 +13,7 @@ */ import QtQuick.Controls 2.3 -import Fluid.Controls 1.0 as FluidControls +import Fluid.Controls 1.1 as FluidControls FluidControls.Page { title: "Sub page demo" diff --git a/src/demo/qml/Pages/Controls/TimePicker.qml b/src/demo/qml/Pages/Controls/TimePickerPage.qml similarity index 98% rename from src/demo/qml/Pages/Controls/TimePicker.qml rename to src/demo/qml/Pages/Controls/TimePickerPage.qml index 1071e47c..689bcf37 100644 --- a/src/demo/qml/Pages/Controls/TimePicker.qml +++ b/src/demo/qml/Pages/Controls/TimePickerPage.qml @@ -15,7 +15,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 -import Fluid.Controls 1.0 as FluidControls +import Fluid.Controls 1.1 as FluidControls import "../.." as Components Components.StyledPage { diff --git a/src/demo/qml/Pages/Controls/WavePage.qml b/src/demo/qml/Pages/Controls/WavePage.qml index 51f8ff26..8c95e66f 100644 --- a/src/demo/qml/Pages/Controls/WavePage.qml +++ b/src/demo/qml/Pages/Controls/WavePage.qml @@ -15,7 +15,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 -import Fluid.Controls 1.0 as FluidControls +import Fluid.Controls 1.1 as FluidControls import "../.." Item { diff --git a/src/demo/qml/Pages/Style/IconsPage.qml b/src/demo/qml/Pages/Style/IconsPage.qml index c4409ca8..90f70578 100644 --- a/src/demo/qml/Pages/Style/IconsPage.qml +++ b/src/demo/qml/Pages/Style/IconsPage.qml @@ -16,15 +16,43 @@ import QtQuick 2.10 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 -import Fluid.Controls 1.0 as FluidControls +import Fluid.Controls 1.1 as FluidControls import Fluid.Layouts 1.0 as FluidLayouts import Fluid.Demo 1.0 as FluidDemo -import "../.." as Components -Components.StyledPage { +Page { + Material.theme: lightRadio.checked ? Material.Light : Material.Dark + + Row { + id: themeRow + anchors { + top: parent.top + left: parent.left + } + + spacing: 16 + + RadioButton { + id: lightRadio + text: qsTr("Light") + checked: true + } + + RadioButton { + id: darkRadio + text: qsTr("Dark") + } + } + + FluidControls.SearchBar { + id: searchBar + anchors.left: themeRow.right + } + ScrollView { id: scrollView - anchors.fill: parent + anchors { left: parent.left; right: parent.right; top: searchBar.bottom; bottom: parent.bottom } + clip: true ColumnLayout { @@ -50,6 +78,7 @@ Components.StyledPage { } delegate: FluidControls.Icon { source: FluidControls.Utils.iconUrl(entry.currentCategory + "/" + model.name) + visible: model.name.indexOf(searchBar.searchText) !== -1 size: 48 ToolTip.visible: iconMouseArea.containsMouse diff --git a/src/demo/qml/Pages/Style/PalettePage.qml b/src/demo/qml/Pages/Style/PalettePage.qml index ea030cc8..a63541a3 100644 --- a/src/demo/qml/Pages/Style/PalettePage.qml +++ b/src/demo/qml/Pages/Style/PalettePage.qml @@ -17,7 +17,7 @@ import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 import QtQuick.Layouts 1.3 import Fluid.Core 1.0 -import Fluid.Controls 1.0 +import Fluid.Controls 1.1 import "../.." Flickable { diff --git a/src/demo/qml/Pages/Style/PaletteSwatch.qml b/src/demo/qml/Pages/Style/PaletteSwatch.qml index e3129487..d53817e2 100644 --- a/src/demo/qml/Pages/Style/PaletteSwatch.qml +++ b/src/demo/qml/Pages/Style/PaletteSwatch.qml @@ -15,7 +15,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 -import Fluid.Controls 1.0 as FluidControls +import Fluid.Controls 1.1 as FluidControls import "../.." Column { diff --git a/src/demo/qml/Pages/Style/SystemIconsPage.qml b/src/demo/qml/Pages/Style/SystemIconsPage.qml index de5a139b..c56df91c 100644 --- a/src/demo/qml/Pages/Style/SystemIconsPage.qml +++ b/src/demo/qml/Pages/Style/SystemIconsPage.qml @@ -16,7 +16,7 @@ import QtQuick 2.10 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 -import Fluid.Controls 1.0 as FluidControls +import Fluid.Controls 1.1 as FluidControls Page { header: Row { @@ -39,50 +39,69 @@ Page { anchors.fill: parent clip: true - GridLayout { + Column { anchors.fill: parent - columns: (scrollView.width * 0.8) / 48 - columnSpacing: 16 - rowSpacing: 16 + anchors.margins: 16 - FluidControls.Icon { - name: "text-editor-symbolic" - size: 48 + Label { + id: warningLabel + width: parent.width + text: qsTr("This feature might not be available on your platform, as it depends on " + + "the installation of a freedesktop.org icon theme.") + wrapMode: Label.WordWrap + visible: Qt.platform.os !== "linux" } - FluidControls.Icon { - name: "weather-few-clouds-symbolic" - size: 48 + Item { + width: parent.width + height: 16 + visible: warningLabel.visible } - FluidControls.Icon { - name: "system-software-install-symbolic" - size: 48 - } + GridLayout { + columns: (scrollView.width * 0.8) / 48 + columnSpacing: 16 + rowSpacing: 16 - FluidControls.Icon { - name: "system-users-symbolic" - size: 48 - } + FluidControls.Icon { + name: "text-editor-symbolic" + size: 48 + } - FluidControls.Icon { - name: "accessories-calculator" - size: 48 - } + FluidControls.Icon { + name: "weather-few-clouds-symbolic" + size: 48 + } - FluidControls.Icon { - name: "accessories-character-map" - size: 48 - } + FluidControls.Icon { + name: "system-software-install-symbolic" + size: 48 + } - FluidControls.Icon { - name: "accessories-dictionary" - size: 48 - } + FluidControls.Icon { + name: "system-users-symbolic" + size: 48 + } + + FluidControls.Icon { + name: "accessories-calculator" + size: 48 + } + + FluidControls.Icon { + name: "accessories-character-map" + size: 48 + } + + FluidControls.Icon { + name: "accessories-dictionary" + size: 48 + } - FluidControls.Icon { - name: "accessories-text-editor" - size: 48 + FluidControls.Icon { + name: "accessories-text-editor" + size: 48 + } } } } diff --git a/src/demo/qml/Pages/Style/TypographyPage.qml b/src/demo/qml/Pages/Style/TypographyPage.qml index 8153bfd4..8691c700 100644 --- a/src/demo/qml/Pages/Style/TypographyPage.qml +++ b/src/demo/qml/Pages/Style/TypographyPage.qml @@ -15,7 +15,7 @@ import QtQuick 2.10 import QtQuick.Layouts 1.3 import QtQuick.Controls 2.3 -import Fluid.Controls 1.0 +import Fluid.Controls 1.1 import "../.." Flickable { diff --git a/src/demo/qml/Style.qml b/src/demo/qml/Style.qml deleted file mode 100644 index 31e5f140..00000000 --- a/src/demo/qml/Style.qml +++ /dev/null @@ -1,77 +0,0 @@ -/* - * This file is part of Fluid. - * - * Copyright (C) 2018 Pier Luigi Fiorini - * - * $BEGIN_LICENSE:MPL2$ - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * $END_LICENSE$ - */ - -import QtQuick 2.10 -import QtQuick.Controls 2.3 -import QtQuick.Controls.Material 2.3 -import QtQuick.Controls.Universal 2.3 -import Fluid.Controls 1.0 -import "Pages/Style" - -Tab { - title: qsTr("Style") - - Pane { - id: listPane - anchors { - left: parent.left - top: parent.top - bottom: parent.bottom - } - width: 200 - padding: 0 - z: 2 - - Material.background: "white" - Material.elevation: 1 - - Universal.background: Universal.accent - - ListView { - id: listView - anchors.fill: parent - currentIndex: 0 - model: ListModel { - ListElement { title: qsTr("Palette"); source: "qrc:/qml/Pages/Style/PalettePage.qml" } - ListElement { title: qsTr("Typography"); source: "qrc:/qml/Pages/Style/TypographyPage.qml" } - ListElement { title: qsTr("System Icons"); source: "qrc:/qml/Pages/Style/SystemIconsPage.qml" } - ListElement { title: qsTr("Material Icons"); source: "qrc:/qml/Pages/Style/IconsPage.qml" } - } - header: Subheader { - text: qsTr("Demos") - } - delegate: ListItem { - text: model.title - highlighted: ListView.isCurrentItem - onClicked: { - listView.currentIndex = index - stackView.push(model.source) - } - } - - ScrollBar.vertical: ScrollBar {} - } - } - - StackView { - id: stackView - anchors { - left: listPane.right - top: parent.top - right: parent.right - bottom: parent.bottom - } - initialItem: PalettePage {} - } -} diff --git a/src/demo/qml/StyledPage.qml b/src/demo/qml/StyledPage.qml index 939777a0..97f59d86 100644 --- a/src/demo/qml/StyledPage.qml +++ b/src/demo/qml/StyledPage.qml @@ -17,20 +17,21 @@ import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 Page { - header: Row { + Material.theme: themeCombo.currentIndex === 0 ? Material.Light : Material.Dark + + header: ToolBar { spacing: 16 + padding: 8 - RadioButton { - id: lightRadio - text: qsTr("Light") - checked: true - } + Material.background: Material.shade(Material.primary, Material.ShadeA700) + Material.theme: Material.Dark - RadioButton { - id: darkRadio - text: qsTr("Dark") + ComboBox { + id: themeCombo + model: [qsTr("Light"), qsTr("Dark")] + + Material.elevation: 0 + Material.theme: Material.Dark } } - - Material.theme: lightRadio.checked ? Material.Light : Material.Dark } diff --git a/src/demo/qml/StyledPageTwoColumns.qml b/src/demo/qml/StyledPageTwoColumns.qml new file mode 100644 index 00000000..cce118be --- /dev/null +++ b/src/demo/qml/StyledPageTwoColumns.qml @@ -0,0 +1,40 @@ +/* + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:MPL2$ + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * $END_LICENSE$ + */ + +import QtQuick 2.10 + +StyledPage { + id: page + + property alias leftColumn: leftColumn.data + property alias rightColumn: rightColumn.data + + Row { + anchors.fill: parent + + Item { + id: leftColumn + + width: parent.width * 0.5 + height: parent.height + } + + Item { + id: rightColumn + + width: parent.width * 0.5 + height: parent.height + } + } +} diff --git a/src/demo/qml/StyledRectangle.qml b/src/demo/qml/StyledRectangle.qml index 65aac54c..f5bab2bd 100644 --- a/src/demo/qml/StyledRectangle.qml +++ b/src/demo/qml/StyledRectangle.qml @@ -13,9 +13,10 @@ */ import QtQuick 2.10 +import QtQuick.Controls.Material 2.3 Rectangle { - // Default styled rectangle is red to spot errors - // related to how styles are loaded - color: "red" + color: Material.background + + Material.theme: index == 0 ? Material.Light : Material.Dark } diff --git a/src/demo/qml/main.qml b/src/demo/qml/main.qml index 66ebc9ba..31983308 100644 --- a/src/demo/qml/main.qml +++ b/src/demo/qml/main.qml @@ -16,10 +16,9 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 -import QtQuick.Controls.Universal 2.3 import QtQuick.Layouts 1.3 import Fluid.Core 1.0 as FluidCore -import Fluid.Controls 1.0 as FluidControls +import Fluid.Controls 1.1 as FluidControls FluidControls.ApplicationWindow { id: window @@ -36,55 +35,95 @@ FluidControls.ApplicationWindow { Material.primary: Material.LightBlue Material.accent: Material.Blue - Universal.accent: Universal.Cobalt - - FluidControls.NavigationListView { + FluidControls.NavigationDrawer { id: navDrawer - topContent: Image { - source: FluidCore.Device.isMobile ? "qrc:/images/materialbg.png" : "" + readonly property bool mobileAspect: window.width < 500 + + modal: mobileAspect + interactive: mobileAspect + position: mobileAspect ? 0.0 : 1.0 + visible: !mobileAspect - Layout.fillWidth: true - Layout.preferredHeight: FluidCore.Device.isMobile ? 200 : window.header.height + topContent: Image { + source: navDrawer.mobileAspect ? "qrc:/images/materialbg.png" : "" + width: parent.width + height: navDrawer.mobileAspect ? 200 : 0 } - actions: [ - FluidControls.Action { - text: qsTr("Action 1") - icon.source: FluidControls.Utils.iconUrl("action/info") - onTriggered: console.log("action1 triggered") - }, - FluidControls.Action { - text: qsTr("Action 2") - icon.source: FluidControls.Utils.iconUrl("action/info") - hasDividerAfter: true - onTriggered: console.log("action2 triggered") - }, - FluidControls.Action { - text: qsTr("Action 3") - icon.source: FluidControls.Utils.iconUrl("action/info") - onTriggered: console.log("action3 triggered") - }, - FluidControls.Action { - text: qsTr("Action 4") - icon.source: FluidControls.Utils.iconUrl("action/info") - onTriggered: console.log("action4 triggered") - }, - FluidControls.Action { - text: qsTr("Action 5") - icon.source: FluidControls.Utils.iconUrl("action/info") - visible: false - onTriggered: console.log("action5 triggered") + ScrollView { + anchors.fill: parent + + clip: true + + ListView { + id: navListView + model: ListModel { + ListElement { category: qsTr("Basic"); title: qsTr("Button"); source: "qrc:/qml/Pages/Basic/ButtonPage.qml" } + ListElement { category: qsTr("Basic"); title: qsTr("CheckBox"); source: "qrc:/qml/Pages/Basic/CheckBoxPage.qml" } + ListElement { category: qsTr("Basic"); title: qsTr("RadioButton"); source: "qrc:/qml/Pages/Basic/RadioButtonPage.qml" } + ListElement { category: qsTr("Basic"); title: qsTr("Switch"); source: "qrc:/qml/Pages/Basic/SwitchPage.qml" } + ListElement { category: qsTr("Basic"); title: qsTr("ProgressBar"); source: "qrc:/qml/Pages/Basic/ProgressBarPage.qml" } + ListElement { category: qsTr("Basic"); title: qsTr("BusyIndicator"); source: "qrc:/qml/Pages/Basic/BusyIndicatorPage.qml" } + ListElement { category: qsTr("Basic"); title: qsTr("Slider"); source: "qrc:/qml/Pages/Basic/SliderPage.qml" } + ListElement { category: qsTr("Layout"); title: qsTr("AutomaticGrid"); source: "qrc:/qml/Pages/Layouts/AutomaticGridPage.qml" } + ListElement { category: qsTr("Layout"); title: qsTr("ColumnFlow"); source: "qrc:/qml/Pages/Layouts/ColumnFlowPage.qml" } + ListElement { category: qsTr("Controls"); title: qsTr("BottomSheet"); source: "qrc:/qml/Pages/Controls/BottomSheetPage.qml" } + ListElement { category: qsTr("Controls"); title: qsTr("Card"); source: "qrc:/qml/Pages/Controls/CardPage.qml" } + ListElement { category: qsTr("Controls"); title: qsTr("Chip"); source: "qrc:/qml/Pages/Controls/ChipPage.qml" } + ListElement { category: qsTr("Controls"); title: qsTr("Dialogs"); source: "qrc:/qml/Pages/Controls/DialogsPage.qml" } + ListElement { category: qsTr("Controls"); title: qsTr("DatePicker"); source: "qrc:/qml/Pages/Controls/DatePickerPage.qml" } + ListElement { category: qsTr("Controls"); title: qsTr("DateTimePicker"); source: "qrc:/qml/Pages/Controls/DateTimePickerPage.qml" } + ListElement { category: qsTr("Controls"); title: qsTr("FAB"); source: "qrc:/qml/Pages/Controls/ActionButtonPage.qml" } + ListElement { category: qsTr("Controls"); title: qsTr("ListItem"); source: "qrc:/qml/Pages/Controls/ListItemPage.qml" } + ListElement { category: qsTr("Controls"); title: qsTr("NavigationDrawer"); source: "qrc:/qml/Pages/Controls/NavDrawerPage.qml" } + ListElement { category: qsTr("Controls"); title: qsTr("NavigationListView"); source: "qrc:/qml/Pages/Controls/NavigationListViewPage.qml" } + ListElement { category: qsTr("Controls"); title: qsTr("Overlay"); source: "qrc:/qml/Pages/Controls/OverlayPage.qml" } + ListElement { category: qsTr("Controls"); title: qsTr("Placeholder"); source: "qrc:/qml/Pages/Controls/PlaceholderPage.qml" } + ListElement { category: qsTr("Controls"); title: qsTr("Search"); source: "qrc:/qml/Pages/Controls/SearchPage.qml" } + ListElement { category: qsTr("Controls"); title: qsTr("SnackBar"); source: "qrc:/qml/Pages/Controls/SnackBarPage.qml" } + ListElement { category: qsTr("Controls"); title: qsTr("TimePicker"); source: "qrc:/qml/Pages/Controls/TimePickerPage.qml" } + ListElement { category: qsTr("Controls"); title: qsTr("Wave"); source: "qrc:/qml/Pages/Controls/WavePage.qml" } + ListElement { category: qsTr("Style"); title: qsTr("Palette"); source: "qrc:/qml/Pages/Style/PalettePage.qml" } + ListElement { category: qsTr("Style"); title: qsTr("Typography"); source: "qrc:/qml/Pages/Style/TypographyPage.qml" } + ListElement { category: qsTr("Style"); title: qsTr("System Icons"); source: "qrc:/qml/Pages/Style/SystemIconsPage.qml" } + ListElement { category: qsTr("Style"); title: qsTr("Material Icons"); source: "qrc:/qml/Pages/Style/IconsPage.qml" } + } + currentIndex: -1 + section.property: "category" + section.criteria: ViewSection.FullString + section.delegate: FluidControls.Subheader { + text: section + width: parent.width + + FluidControls.ThinDivider { + width: parent.width + } + } + delegate: FluidControls.ListItem { + text: model.title + highlighted: ListView.isCurrentItem + onClicked: { + navListView.currentIndex = index; + stackView.push(model.source); + if (navDrawer.modal) + navDrawer.close(); + } + } } - ] + } } - initialPage: FluidControls.TabbedPage { + initialPage: FluidControls.Page { title: window.title + x: navDrawer.modal ? 0 : navDrawer.position * navDrawer.width + width: window.width - x + leftAction: FluidControls.Action { icon.source: FluidControls.Utils.iconUrl("navigation/menu") - onTriggered: navDrawer.open() + visible: navDrawer.modal + onTriggered: navDrawer.visible ? navDrawer.close() : navDrawer.open() } actions: [ @@ -123,9 +162,14 @@ FluidControls.ApplicationWindow { } ] - BasicComponents {} - LayoutComponents {} - Controls {} - Style {} + StackView { + id: stackView + anchors.fill: parent + initialItem: FluidControls.Placeholder { + icon.source: FluidControls.Utils.iconUrl("content/filter_list") + text: qsTr("Select a demo") + subText: qsTr("At the moment there is no demo selected from the navigration drawer, choose one and play with it.") + } + } } } diff --git a/src/deployment/tarball.qbs b/src/deployment/tarball.qbs index 730981fd..f18bc485 100644 --- a/src/deployment/tarball.qbs +++ b/src/deployment/tarball.qbs @@ -3,7 +3,7 @@ import qbs 1.0 InstallPackage { name: "fluid-artifacts" targetName: name - builtByDefault: project.deploymentEnabled + condition: project.deploymentEnabled archiver.type: "tar" archiver.outputDirectory: project.buildDirectory diff --git a/src/deployment/windows.qbs b/src/deployment/windows.qbs index b2456e46..b1143881 100644 --- a/src/deployment/windows.qbs +++ b/src/deployment/windows.qbs @@ -14,8 +14,7 @@ Product { property stringList excludedPathPrefixes: [] name: "fluid-windows" - condition: qbs.targetOS.contains("windows") - builtByDefault: project.deploymentEnabled + condition: qbs.targetOS.contains("windows") && project.deploymentEnabled type: ["archiver.archive"] targetName: "fluid-windows-" + qbs.architecture + "-" + project.version destinationDirectory: project.buildDirectory diff --git a/src/imports/controls-private/plugins.qmltypes b/src/imports/controls-private/plugins.qmltypes index 3a25d311..826c95a9 100644 --- a/src/imports/controls-private/plugins.qmltypes +++ b/src/imports/controls-private/plugins.qmltypes @@ -4,11 +4,11 @@ import QtQuick.tooling 1.2 // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump -noinstantiate -notrelocatable Fluid.Controls.Private 1.0' +// 'qmlplugindump-qt5 -v -noinstantiate -notrelocatable Fluid.Controls.Private 1.0' Module { dependencies: [ - "Fluid.Controls 1.0", + "Fluid.Controls 1.1", "Fluid.Core 1.0", "Fluid.Effects 1.0", "Fluid.Layouts 1.0", @@ -147,17 +147,6 @@ Module { isComposite: true defaultProperty: "data" } - Component { - prototype: "QQuickRectangle" - name: "QtQuick.Controls.Fusion.impl/CheckIndicator 2.3" - exports: ["QtQuick.Controls.Fusion.impl/CheckIndicator 2.3"] - exportMetaObjectRevisions: [3] - isComposite: true - defaultProperty: "data" - Property { name: "control"; type: "QQuickItem"; isPointer: true } - Property { name: "pressedColor"; type: "QColor"; isReadonly: true } - Property { name: "checkMarkColor"; type: "QColor"; isReadonly: true } - } Component { prototype: "QQuickRectangle" name: "QtQuick.Controls.Material.impl/CheckIndicator 2.0" @@ -177,6 +166,17 @@ Module { Property { name: "control"; type: "QQuickItem"; isPointer: true } Property { name: "partiallyChecked"; type: "bool"; isReadonly: true } } + Component { + prototype: "QQuickRectangle" + name: "QtQuick.Controls.Fusion.impl/CheckIndicator 2.3" + exports: ["QtQuick.Controls.Fusion.impl/CheckIndicator 2.3"] + exportMetaObjectRevisions: [3] + isComposite: true + defaultProperty: "data" + Property { name: "control"; type: "QQuickItem"; isPointer: true } + Property { name: "pressedColor"; type: "QColor"; isReadonly: true } + Property { name: "checkMarkColor"; type: "QColor"; isReadonly: true } + } Component { prototype: "QQuickComboBox" name: "QtQuick.Controls/ComboBox 2.0" @@ -392,6 +392,17 @@ Module { isComposite: true defaultProperty: "data" } + Component { + prototype: "QQuickRectangle" + name: "QtQuick.Controls.Fusion.impl/RadioIndicator 2.3" + exports: ["QtQuick.Controls.Fusion.impl/RadioIndicator 2.3"] + exportMetaObjectRevisions: [3] + isComposite: true + defaultProperty: "data" + Property { name: "control"; type: "QQuickItem"; isPointer: true } + Property { name: "pressedColor"; type: "QColor"; isReadonly: true } + Property { name: "checkMarkColor"; type: "QColor"; isReadonly: true } + } Component { prototype: "QQuickRectangle" name: "QtQuick.Controls.Universal.impl/RadioIndicator 2.0" @@ -410,17 +421,6 @@ Module { defaultProperty: "data" Property { name: "control"; type: "QQuickItem"; isPointer: true } } - Component { - prototype: "QQuickRectangle" - name: "QtQuick.Controls.Fusion.impl/RadioIndicator 2.3" - exports: ["QtQuick.Controls.Fusion.impl/RadioIndicator 2.3"] - exportMetaObjectRevisions: [3] - isComposite: true - defaultProperty: "data" - Property { name: "control"; type: "QQuickItem"; isPointer: true } - Property { name: "pressedColor"; type: "QColor"; isReadonly: true } - Property { name: "checkMarkColor"; type: "QColor"; isReadonly: true } - } Component { prototype: "QQuickRangeSlider" name: "QtQuick.Controls/RangeSlider 2.0" @@ -494,19 +494,6 @@ Module { Property { name: "progress"; type: "double" } Property { name: "visualProgress"; type: "double" } } - Component { - prototype: "QQuickRectangle" - name: "QtQuick.Controls.Fusion.impl/SliderHandle 2.3" - exports: ["QtQuick.Controls.Fusion.impl/SliderHandle 2.3"] - exportMetaObjectRevisions: [3] - isComposite: true - defaultProperty: "data" - Property { name: "palette"; type: "QVariant" } - Property { name: "pressed"; type: "bool" } - Property { name: "hovered"; type: "bool" } - Property { name: "vertical"; type: "bool" } - Property { name: "visualFocus"; type: "bool" } - } Component { prototype: "QQuickItem" name: "QtQuick.Controls.Material.impl/SliderHandle 2.0" @@ -521,6 +508,19 @@ Module { Property { name: "initialSize"; type: "int"; isReadonly: true } Property { name: "control"; type: "QVariant"; isReadonly: true } } + Component { + prototype: "QQuickRectangle" + name: "QtQuick.Controls.Fusion.impl/SliderHandle 2.3" + exports: ["QtQuick.Controls.Fusion.impl/SliderHandle 2.3"] + exportMetaObjectRevisions: [3] + isComposite: true + defaultProperty: "data" + Property { name: "palette"; type: "QVariant" } + Property { name: "pressed"; type: "bool" } + Property { name: "hovered"; type: "bool" } + Property { name: "vertical"; type: "bool" } + Property { name: "visualFocus"; type: "bool" } + } Component { prototype: "QQuickSpinBox" name: "QtQuick.Controls/SpinBox 2.0" @@ -578,6 +578,16 @@ Module { defaultProperty: "data" Property { name: "control"; type: "QQuickItem"; isPointer: true } } + Component { + prototype: "QQuickItem" + name: "QtQuick.Controls.Material.impl/SwitchIndicator 2.0" + exports: ["QtQuick.Controls.Material.impl/SwitchIndicator 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + Property { name: "control"; type: "QQuickItem"; isPointer: true } + Property { name: "handle"; type: "QQuickRectangle"; isReadonly: true; isPointer: true } + } Component { prototype: "QQuickRectangle" name: "QtQuick.Controls.Fusion.impl/SwitchIndicator 2.3" @@ -589,16 +599,6 @@ Module { Property { name: "pressedColor"; type: "QColor"; isReadonly: true } Property { name: "checkMarkColor"; type: "QColor"; isReadonly: true } } - Component { - prototype: "QQuickItem" - name: "QtQuick.Controls.Material.impl/SwitchIndicator 2.0" - exports: ["QtQuick.Controls.Material.impl/SwitchIndicator 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "control"; type: "QQuickItem"; isPointer: true } - Property { name: "handle"; type: "QQuickRectangle"; isReadonly: true; isPointer: true } - } Component { prototype: "QQuickTabBar" name: "QtQuick.Controls/TabBar 2.0" diff --git a/src/imports/controls-private/qmldir b/src/imports/controls-private/qmldir index 44379be1..bd28037e 100644 --- a/src/imports/controls-private/qmldir +++ b/src/imports/controls-private/qmldir @@ -2,7 +2,7 @@ module Fluid.Controls.Private plugin fluidcontrolsprivateplugin classname FluidControlsPrivatePlugin depends QtQuick.Controls 2.0 -depends Fluid.Template 1.0 +depends Fluid.Templates 1.0 typeinfo plugins.qmltypes DateSelector 1.0 DateSelector.qml diff --git a/src/imports/controls-private/windowdecoration.cpp b/src/imports/controls-private/windowdecoration.cpp index 2960a8ef..97970813 100644 --- a/src/imports/controls-private/windowdecoration.cpp +++ b/src/imports/controls-private/windowdecoration.cpp @@ -52,6 +52,8 @@ void WindowDecoration::setTheme(WindowDecoration::Theme theme) m_theme = theme; Q_EMIT themeChanged(); + + updateDecorationColor(); } QColor WindowDecoration::color() const @@ -66,6 +68,8 @@ void WindowDecoration::setColor(const QColor &color) m_color = color; Q_EMIT colorChanged(); + + updateDecorationColor(); } void WindowDecoration::classBegin() @@ -121,6 +125,9 @@ void WindowDecoration::updateDecorationColor() // Set properties m_window->setProperty("__material_decoration_backgroundColor", m_color); m_window->setProperty("__material_decoration_foregroundColor", textColor); + + // Trigger a decoration update + m_window->resize(m_window->size()); } #endif } diff --git a/src/imports/controls/Action.qml b/src/imports/controls/Action.qml index ad63f5b4..364812ba 100644 --- a/src/imports/controls/Action.qml +++ b/src/imports/controls/Action.qml @@ -15,56 +15,12 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 as QQC2 -import Fluid.Core 1.0 -/*! - \qmltype Action - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Represents an action shown in an action bar, context menu, or list. - - One of the most common uses of actions is displaying actions in the action bar of a page - using the \l Page::actions property. See the example for \l Page for more details. - - Actions may contain \l text, an \l icon, a \l toolTip and a \l shortcut. - - \snippet fluidcontrols-action.qml action -*/ QQC2.Action { id: action - /*! - \qmlproperty string toolTip - - The tool tip displayed for the action. - */ property string toolTip - - /*! - \qmlproperty bool visible - - Set to \c false to hide the action in the UI. - - This property is \c true by default. - */ property bool visible: true - - /*! - \qmlproperty bool hasDividerAfter - - Set to \c true to display a divider after the control bound to this action. - - This property is \c false by default. - */ property bool hasDividerAfter: false - - /*! - \qmlproperty bool hoverAnimation - - Set to \c true to rotate the icon 90 degrees on mouseover. - - This property is \c false by default. - */ property bool hoverAnimation: false } diff --git a/src/imports/controls/AlertDialog.qml b/src/imports/controls/AlertDialog.qml index 7131c32a..e547e2a7 100644 --- a/src/imports/controls/AlertDialog.qml +++ b/src/imports/controls/AlertDialog.qml @@ -16,35 +16,12 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import Fluid.Controls 1.0 as FluidControls -/*! - \qmltype AlertDialog - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Alert dialogs are urgent interruptions to inform the user about a situation. - - An alert dialog is used to interrupt the user's workflow to inform them about - a situation that requires their acknowledgement. - - Most alert don't need a title and they summarize a decision in a sentence or two - by either asking a question or making a statement related to the action buttons. - - \snippet fluidcontrols-alertdialog.qml file - - For more information you can read the - \l{https://material.io/guidelines/components/dialogs.html}{Material Design guidelines}. -*/ Dialog { /*! \internal */ default property alias content: dialogContent.data - /*! - \qmlproperty string text - - Informative text to display. - */ property alias text: dialogLabel.text x: (parent.width - width) / 2 diff --git a/src/imports/controls/AppBar.qml b/src/imports/controls/AppBar.qml index 66b8ebc9..da05344a 100644 --- a/src/imports/controls/AppBar.qml +++ b/src/imports/controls/AppBar.qml @@ -21,95 +21,26 @@ import QtQuick.Layouts 1.3 import Fluid.Core 1.0 as FluidCore import Fluid.Controls 1.0 as FluidControls -/*! - \qmltype AppBar - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Application tool bar. - - For more information you can read the - \l{https://material.io/guidelines/layout/structure.html#structure-app-bar}{Material Design guidelines}. - */ QQC2.ToolBar { id: appBar Material.elevation: toolbar ? 0 : elevation Material.theme: toolbar ? toolbar.Material.theme : Material.Light - /*! - \qmlproperty Action leftAction - - The back action to display to the left of the title in the action bar. - When used with a page, this will pick up the page's back action, which - by default is a back arrow when there is a page behind the current page - on the page stack. However, you can customize this, for example, to show - a navigation drawer at the root of your app. - - When using an action bar in a page, set the \l Page::leftAction instead of - directly setting this property. - */ property FluidControls.Action leftAction - /*! - \qmlproperty list actions - - A list of actions to show in the action bar. These actions will be shown - anchored to the right, and will overflow if there are more than the - maximum number of actions as defined in \l maxActionCount. - - When used with a page, the actions will be set to the page's \l Page::actions - property, so set that instead of changing this directly. - */ property list actions - /*! - \qmlproperty int elevation - - The elevation of the action bar. Set to 0 if you want have a header or some - other view below the action bar that you want to appear as part of the action bar. - */ property int elevation: 2 - /*! - \internal - The size of the left icon and the action icons. - */ property int __iconSize: FluidCore.Device.gridUnit <= 48 ? 20 : 24 - /*! - \qmlproperty real leftKeyline - - Keyline to align contents to the left to be visually appealing. - */ property alias leftKeyline: titleLabel.x - /*! - \qmlproperty int maxActionCount - - The maximum number of actions that can be displayed before they spill over - into a drop-down menu. When using an action bar with a page, this inherits - from the global \l AppToolBar::maxActionCount. If you are using an action bar - for custom purposes outside of a toolbar, this defaults to \c 3. - - Set to \c 0 if you don't want to overflow actions. - */ property int maxActionCount: toolbar ? toolbar.maxActionCount : 3 - /*! - \qmlproperty string title - - The title displayed in the action bar. When used in a page, the title will - be set to the title of the page, so set the \l Page::title property instead - of changing this directly. - */ property alias title: titleLabel.text - /*! - \qmlproperty AppToolBar toolbar - - Tool bar. - */ property FluidControls.AppToolBar toolbar implicitHeight: FluidCore.Device.gridUnit diff --git a/src/imports/controls/AppBar11.qml b/src/imports/controls/AppBar11.qml new file mode 100644 index 00000000..00ebdf9a --- /dev/null +++ b/src/imports/controls/AppBar11.qml @@ -0,0 +1,255 @@ +/* + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * Copyright (C) 2018 Michael Spencer + * + * $BEGIN_LICENSE:MPL2$ + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * $END_LICENSE$ + */ + +import QtQml 2.2 +import QtQuick 2.10 +import QtQuick.Controls 2.3 as QQC2 +import QtQuick.Controls.Material 2.3 +import QtQuick.Layouts 1.3 +import Fluid.Core 1.0 as FluidCore +import Fluid.Controls 1.1 as FluidControls + +QQC2.ToolBar { + id: appBar + + Material.elevation: toolbar ? 0 : elevation + Material.background: toolbar ? toolbar.Material.background : backgroundColor + Material.theme: FluidControls.Color.isDarkColor(Material.background) ? Material.Dark : Material.Light + + property FluidControls.Action leftAction + + property list actions + + property int elevation: 2 + + property int __iconSize: FluidCore.Device.gridUnit <= 48 ? 20 : 24 + + property color backgroundColor: appBar.Material.primaryColor + + readonly property alias overflowMenuVisible: overflowMenu.visible + + property color decorationColor: Material.shade(backgroundColor, Material.Shade700) + + property alias leftKeyline: titleLabel.x + + property int maxActionCount: toolbar ? toolbar.maxActionCount : 3 + + property alias title: titleLabel.text + + property alias customContent: customContentItem.data + property alias extendedContent: extendedContentItem.data + + readonly property alias extendedContentHeight: extendedContentItem.height + + property FluidControls.AppToolBar toolbar + + implicitHeight: FluidCore.Device.gridUnit + + Behavior on backgroundColor { + ColorAnimation { duration: FluidControls.Units.mediumDuration } + } + + Behavior on decorationColor { + ColorAnimation { duration: FluidControls.Units.mediumDuration } + } + + FluidControls.ToolButton { + id: leftButton + + property bool showing: leftAction && leftAction.visible + property int margin: (width - 24)/2 + + QQC2.ToolTip.visible: QQC2.ToolTip.text != "" && (FluidCore.Device.isMobile ? pressed : hovered) + QQC2.ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval + QQC2.ToolTip.text: leftAction ? leftAction.toolTip : "" + + anchors { + verticalCenter: actionsRow.verticalCenter + left: parent.left + leftMargin: leftButton.showing ? 16 - leftButton.margin : -leftButton.width + } + + icon.width: appBar.__iconSize + icon.height: appBar.__iconSize + icon.name: leftAction ? leftAction.icon.name : "" + icon.source: leftAction ? leftAction.icon.source : "" + + Binding { + target: leftButton + property: "icon.color" + value: leftAction.icon.color + when: leftAction && leftAction.icon.color.a > 0 + } + + visible: leftAction && leftAction.visible + enabled: leftAction && leftAction.enabled + hoverAnimation: leftAction && leftAction.hoverAnimation + focusPolicy: Qt.TabFocus + onClicked: { + if (leftAction) + leftAction.triggered(leftButton) + } + } + + FluidControls.TitleLabel { + id: titleLabel + + anchors { + verticalCenter: actionsRow.verticalCenter + left: parent.left + right: actionsRow.left + leftMargin: 16 + (leftButton.showing ? FluidCore.Device.gridUnit - leftButton.margin : 0) + rightMargin: 16 + } + + textFormat: Text.PlainText + color: Material.primaryTextColor + elide: Text.ElideRight + visible: text !== "" && customContentItem.children.length === 0 + } + + Row { + id: actionsRow + + anchors { + right: parent.right + rightMargin: 16 - leftButton.margin + } + + spacing: 24 - 2 * leftButton.margin + + Repeater { + model: appBar.actions.length > appBar.maxActionCount && appBar.maxActionCount > 0 + ? appBar.maxActionCount : appBar.actions.length + delegate: FluidControls.ToolButton { + id: actionButton + + QQC2.ToolTip.visible: QQC2.ToolTip.text !== "" && !overflowMenu.visible && (FluidCore.Device.isMobile ? pressed : hovered) + QQC2.ToolTip.delay: Qt.styleHints.mousePressAndHoldInterval + QQC2.ToolTip.text: appBar.actions[index].toolTip + + anchors.verticalCenter: parent.verticalCenter + + icon.width: appBar.__iconSize + icon.height: appBar.__iconSize + icon.name: appBar.actions[index].icon.name + icon.source: appBar.actions[index].icon.source + + Binding { + target: actionButton + property: "icon.color" + value: appBar.actions[index].icon.color + when: appBar.actions[index].icon.color.a > 0 + } + + visible: appBar.actions[index].visible + enabled: appBar.actions[index].enabled + hoverAnimation: appBar.actions[index].hoverAnimation + focusPolicy: Qt.TabFocus + + onClicked: appBar.actions[index].triggered(actionButton) + } + } + + FluidControls.ToolButton { + id: overflowButton + + anchors.verticalCenter: parent.verticalCenter + + icon.width: appBar.__iconSize + icon.height: appBar.__iconSize + icon.source: FluidControls.Utils.iconUrl("navigation/more_vert") + + onClicked: overflowMenu.open() + + visible: appBar.actions.length > appBar.maxActionCount && appBar.maxActionCount > 0 + focusPolicy: Qt.TabFocus + + QQC2.Menu { + id: overflowMenu + + x: -width + overflowButton.width - overflowButton.rightPadding + y: overflowButton.topPadding + transformOrigin: QQC2.Menu.TopRight + + Instantiator { + model: appBar.actions.length > appBar.maxActionCount && appBar.maxActionCount > 0 + ? appBar.actions.length - appBar.maxActionCount : 0 + delegate: QQC2.MenuItem { + id: overflowMenuItem + + icon.width: appBar.__iconSize + icon.height: appBar.__iconSize + icon.name: appBar.actions[index + appBar.maxActionCount].icon.name + icon.source: appBar.actions[index + appBar.maxActionCount].icon.source + + Binding { + target: overflowMenuItem + property: "icon.color" + value: appBar.actions[index + appBar.maxActionCount].icon.color + when: appBar.actions[index + appBar.maxActionCount].icon.color.a > 0 + } + + text: appBar.actions[index + appBar.maxActionCount].text + + enabled: appBar.actions[index + appBar.maxActionCount].enabled + visible: appBar.actions[index + appBar.maxActionCount].visible + + onTriggered: appBar.actions[index + appBar.maxActionCount].triggered(overflowMenuItem) + } + onObjectAdded: overflowMenu.addItem(object) + onObjectRemoved: overflowMenu.removeItem(index) + } + } + } + } + + Item { + id: customContentItem + + anchors.left: parent.left + anchors.right: actionsRow.left + anchors.leftMargin: 16 + (leftButton.showing ? FluidCore.Device.gridUnit - leftButton.margin : 0) + anchors.rightMargin: 16 + anchors.verticalCenter: actionsRow.verticalCenter + + height: parent.height + + visible: children.length > 0 + } + + Item { + id: extendedContentItem + + anchors.left: titleLabel.left + anchors.top: actionsRow.bottom + anchors.right: actionsRow.right + anchors.rightMargin: 16 + + height: childrenRect.height + + visible: children.length > 0 + } + + function toggleOverflowMenu() { + if (!overflowButton.visible) + return; + + if (overflowMenu.visible) + overflowMenu.close(); + else + overflowMenu.open(); + } +} diff --git a/src/imports/controls/AppToolBar.qml b/src/imports/controls/AppToolBar.qml index 3df6461a..8b812be8 100644 --- a/src/imports/controls/AppToolBar.qml +++ b/src/imports/controls/AppToolBar.qml @@ -17,13 +17,6 @@ import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 import Fluid.Controls 1.0 as FluidControls -/*! - \qmltype AppToolBar - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Application tool bar. - */ ToolBar { id: toolbar @@ -31,44 +24,21 @@ ToolBar { Material.background: Material.primaryColor Material.theme: FluidControls.Color.isDarkColor(Material.background) ? Material.Dark : Material.Light - /*! - \internal - */ property Page page - /*! - \qmlproperty int maxActionCount - - Maximum actions to be available on this tool bar. - */ property int maxActionCount: 3 - /*! - \qmlmethod void AppToolBar::pop(Page page) - - Pop the \l AppBar that belongs to \a page from the stack. - */ function pop(page) { stack.pop(page.appBar, StackView.PopTransition); toolbar.page = page; } - /*! - \qmlmethod void AppToolBar::push(Page page) - - Push the \l AppBar that belongs to \a page to the stack. - */ function push(page) { stack.push(page.appBar, {}, StackView.PushTransition); page.appBar.toolbar = toolbar; toolbar.page = page; } - /*! - \qmlmethod void AppToolBar::replace(Page page) - - Replace current \l AppBar with the one that belongs to \a page. - */ function replace(page) { stack.replace(page.appBar, {}, StackView.ReplaceTransition); page.appBar.toolbar = toolbar; diff --git a/src/imports/controls/AppToolBar11.qml b/src/imports/controls/AppToolBar11.qml new file mode 100644 index 00000000..d64a4e20 --- /dev/null +++ b/src/imports/controls/AppToolBar11.qml @@ -0,0 +1,155 @@ +/* + * This file is part of Fluid. + * + * Copyright (C) 2018 Michael Spencer + * + * $BEGIN_LICENSE:MPL2$ + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * $END_LICENSE$ + */ + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Controls.Material 2.3 +import Fluid.Controls 1.1 as FluidControls + +ToolBar { + id: toolbar + + Material.elevation: page ? page.appBar.elevation : 2 + Material.background: page ? page.appBar.backgroundColor : toolbar.Material.primaryColor + Material.theme: FluidControls.Color.isDarkColor(page ? page.appBar.backgroundColor : toolbar.Material.background) ? Material.Dark : Material.Light + + property Page page + + property int maxActionCount: 3 + + property real appBarHeight: { + if (!page || !page.appBar || !page.appBar.visible) + return 0; + + var height = implicitHeight + page.appBar.extendedContentHeight; + + if (page.rightSidebar && page.rightSidebar.showing) { + var sidebarHeight = implicitHeight + page.rightSidebar.appBar.extendedContentHeight; + height = Math.max(height, sidebarHeight); + } + + return height; + } + + height: appBarHeight + + Behavior on height { + NumberAnimation { duration: FluidControls.Units.mediumDuration } + } + + function pop(page) { + stack.pop(page.appBar, StackView.PopTransition); + + if (page.rightSidebar && page.rightSidebar.appBar) + rightSidebarStack.pop(page.rightSidebar.appBar); + else + rightSidebarStack.pop(emptyRightSidebar); + + toolbar.page = page; + } + + function push(page) { + stack.push(page.appBar, {}, StackView.PushTransition); + + page.appBar.toolbar = toolbar; + toolbar.page = page; + + if (page.rightSidebar && page.rightSidebar.appBar) + rightSidebarStack.replace(page.rightSidebar.appBar); + else + rightSidebarStack.replace(emptyRightSidebar); + } + + function replace(page) { + stack.replace(page.appBar, {}, StackView.ReplaceTransition); + + page.appBar.toolbar = toolbar; + toolbar.page = page; + + if (page.rightSidebar && page.rightSidebar.appBar) + rightSidebarStack.replace(page.rightSidebar.appBar); + else + rightSidebarStack.replace(emptyRightSidebar); + } + + StackView { + id: stack + + anchors.left: parent.left + anchors.right: page && page.rightSidebar ? rightSidebarStack.left : parent.right + anchors.rightMargin: 0 + + height: appBarHeight + + Behavior on height { + NumberAnimation { duration: FluidControls.Units.mediumDuration } + } + + popEnter: Transition { + NumberAnimation { property: "y"; from: 0.5 * -stack.height; to: 0; duration: 250; easing.type: Easing.OutCubic } + NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 250; easing.type: Easing.OutCubic } + } + popExit: Transition { + NumberAnimation { property: "y"; from: 0; to: 0.5 * stack.height; duration: 250; easing.type: Easing.OutCubic } + NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 250; easing.type: Easing.OutCubic } + } + + pushEnter: Transition { + NumberAnimation { property: "y"; from: 0.5 * stack.height; to: 0; duration: 250; easing.type: Easing.OutCubic } + NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 250; easing.type: Easing.OutCubic } + } + pushExit: Transition { + NumberAnimation { property: "y"; from: 0; to: 0.5 * -stack.height; duration: 250; easing.type: Easing.OutCubic } + NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 250; easing.type: Easing.OutCubic } + } + } + + StackView { + id: rightSidebarStack + + anchors.right: parent.right + anchors.rightMargin: page && page.rightSidebar ? page.rightSidebar.anchors.rightMargin : 0 + + width: page && page.rightSidebar ? page.rightSidebar.width : 0 + height: appBarHeight + + Behavior on height { + NumberAnimation { duration: FluidControls.Units.mediumDuration } + } + + popEnter: Transition { + NumberAnimation { property: "y"; from: 0.5 * -rightSidebarStack.height; to: 0; duration: 250; easing.type: Easing.OutCubic } + NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 250; easing.type: Easing.OutCubic } + } + popExit: Transition { + NumberAnimation { property: "y"; from: 0; to: 0.5 * rightSidebarStack.height; duration: 250; easing.type: Easing.OutCubic } + NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 250; easing.type: Easing.OutCubic } + } + + pushEnter: Transition { + NumberAnimation { property: "y"; from: 0.5 * rightSidebarStack.height; to: 0; duration: 250; easing.type: Easing.OutCubic } + NumberAnimation { property: "opacity"; from: 0.0; to: 1.0; duration: 250; easing.type: Easing.OutCubic } + } + pushExit: Transition { + NumberAnimation { property: "y"; from: 0; to: 0.5 * -rightSidebarStack.height; duration: 250; easing.type: Easing.OutCubic } + NumberAnimation { property: "opacity"; from: 1.0; to: 0.0; duration: 250; easing.type: Easing.OutCubic } + } + } + + Component { + id: emptyRightSidebar + + Item {} + } +} diff --git a/src/imports/controls/ApplicationWindow.qml b/src/imports/controls/ApplicationWindow.qml index 4d7bd827..65c6e6e6 100644 --- a/src/imports/controls/ApplicationWindow.qml +++ b/src/imports/controls/ApplicationWindow.qml @@ -1,6 +1,7 @@ /* * This file is part of Fluid. * + * Copyright (C) 2018 Pier Luigi Fiorini * Copyright (C) 2018 Michael Spencer * * $BEGIN_LICENSE:MPL2$ @@ -18,80 +19,17 @@ import QtQuick.Controls.Material 2.3 import Fluid.Controls 1.0 as FluidControls import Fluid.Controls.Private 1.0 as FluidControlsPrivate -/*! - \qmltype ApplicationWindow - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief A window that provides features commonly used for Material Design apps. - - This is normally what you should use as your root component. It provides a \l ToolBar and - \l PageStack to provide access to standard features used by Material Design applications. - - Here is a short working example of an application: - - \qml - import QtQuick 2.10 - import Fluid.Controls 1.0 as FluidControls - - FluidControls.ApplicationWindow { - title: "Application Name" - width: 1024 - height: 800 - visible: true - - initialPage: page - - FluidControls.Page { - id: page - title: "Page Title" - - Label { - anchors.centerIn: parent - text: "Hello World!" - } - } - } - \endqml -*/ ApplicationWindow { id: window - /*! - \qmlproperty color decorationColor - - The color of the status bar or window decorations, if the current - platform supports it. - */ property alias decorationColor: windowDecoration.color - /*! - \qmlproperty Theme decorationTheme - - Theme of the status bar or window decoration, if the current - platform supports it. - */ property alias decorationTheme: windowDecoration.theme - /*! - \qmlproperty AppToolBar appBar - - The tool bar for this application. - */ property alias appBar: appBar - /*! - \qmlproperty Page initialPage - - The initial page shown when the application starts. - */ property alias initialPage: pageStack.initialItem - /*! - \qmlproperty PageStack pageStack - - The \l PageStack used for controlling pages and transitions between pages. - */ property alias pageStack: pageStack header: FluidControls.AppToolBar { diff --git a/src/imports/controls/ApplicationWindow11.qml b/src/imports/controls/ApplicationWindow11.qml new file mode 100644 index 00000000..8edb0b66 --- /dev/null +++ b/src/imports/controls/ApplicationWindow11.qml @@ -0,0 +1,54 @@ +/* + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * Copyright (C) 2018 Michael Spencer + * + * $BEGIN_LICENSE:MPL2$ + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * $END_LICENSE$ + */ + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Controls.Material 2.3 +import Fluid.Controls 1.1 as FluidControls +import Fluid.Controls.Private 1.0 as FluidControlsPrivate + +ApplicationWindow { + id: window + + property alias decorationColor: windowDecoration.color + + property alias decorationTheme: windowDecoration.theme + + property alias appBar: appBar + + property alias initialPage: pageStack.initialItem + + property alias pageStack: pageStack + + header: FluidControls.AppToolBar { + id: appBar + } + + FluidControls.PageStack { + id: pageStack + + anchors.fill: parent + + onPushed: appBar.push(page) + onPopped: appBar.pop(page) + onReplaced: appBar.replace(page) + } + + FluidControlsPrivate.WindowDecoration { + id: windowDecoration + window: window + color: Material.shade(appBar ? appBar.Material.background : window.Material.primaryColor, Material.Shade700) + } +} diff --git a/src/imports/controls/BodyLabel.qml b/src/imports/controls/BodyLabel.qml index 2c54e87c..7995f688 100644 --- a/src/imports/controls/BodyLabel.qml +++ b/src/imports/controls/BodyLabel.qml @@ -16,31 +16,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import Fluid.Core 1.0 as FluidCore -/*! - \qmltype BodyLabel - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Text label with standard font and styling suitable to body text. - - Text label for the Material Design body text style. - - \snippet fluidcontrols-bodylabel.qml file - - For more information you can read the - \l{https://material.io/guidelines/style/typography.html}{Material Design guidelines}. -*/ Label { - /*! - \qmlproperty int level - - This property holds the label level that controls - font style and size. - - It can be either 1 or 2. - - Default value is 1. - */ property int level: 1 font.pixelSize: FluidCore.Device.isMobile ? 14 : 13 diff --git a/src/imports/controls/BottomSheet.qml b/src/imports/controls/BottomSheet.qml index 45138959..3fb7f420 100644 --- a/src/imports/controls/BottomSheet.qml +++ b/src/imports/controls/BottomSheet.qml @@ -17,21 +17,6 @@ import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 import Fluid.Controls 1.0 as FluidControls -/*! - \qmltype BottomSheet - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief A sheet of paper that slides up from the bottom. - - A sheet of paper that slides up from the bottom edge of the screen and presents - a set of clear and simple actions. - - \snippet fluidcontrols-bottomsheet.qml file - - For more information you can read the - \l{https://material.io/guidelines/components/bottom-sheets.html}{Material Design guidelines}. -*/ Drawer { id: bottomSheet @@ -40,14 +25,6 @@ Drawer { */ default property alias content: containerPane.data - /*! - \qmlproperty int maxHeight - - Maximum height of the bottom sheet. - - By default it's set to the height of the \c ApplicationWindow - minus \c AppBar height. - */ property int maxHeight: ApplicationWindow.contentItem.height - ApplicationWindow.header.height modal: true diff --git a/src/imports/controls/BottomSheetGrid.qml b/src/imports/controls/BottomSheetGrid.qml index 33baa9df..59e21c14 100644 --- a/src/imports/controls/BottomSheetGrid.qml +++ b/src/imports/controls/BottomSheetGrid.qml @@ -20,52 +20,13 @@ import QtQuick.Templates 2.0 as T import Fluid.Controls 1.0 import Fluid.Layouts 1.0 as FluidLayouts -/*! - \qmltype BottomSheetGrid - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - \brief A sheet of paper with actions and an optional title that slides up from the bottom. - - A sheet of paper that displays actions in a grid and an optional title that slides up - from the bottom edge of the screen and presents a set of clear and simple actions. - - \snippet fluidcontrols-bottomsheetgrid.qml file - - For more information you can read the - \l{https://material.io/guidelines/components/bottom-sheets.html}{Material Design guidelines}. -*/ BottomSheet { id: bottomSheet - /*! - \qmlproperty string title - - Title. - */ property string title - - /*! - \qmlproperty list actions - - Actions to display in the bottom sheet. - */ property list actions - - /*! - \qmlproperty int columns - - Number of columns. - By default it's set to fit the screen width. - */ property alias columns: grid.columns - - /*! - \qmlproperty int rows - - Number of rows. - By default it's set to fit the screen size based on the \l columns. - */ property alias rows: grid.rows height: Math.min(implicitHeight, maxHeight) diff --git a/src/imports/controls/BottomSheetList.qml b/src/imports/controls/BottomSheetList.qml index 639b82d4..736f73e7 100644 --- a/src/imports/controls/BottomSheetList.qml +++ b/src/imports/controls/BottomSheetList.qml @@ -17,36 +17,10 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import Fluid.Controls 1.0 -/*! - \qmltype BottomSheetAction - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief A sheet of paper with actions and an optional title that slides up from the bottom. - - A sheet of paper that displays actions in a list and an optional title that slides up - from the bottom edge of the screen and presents a set of clear and simple actions. - - \snippet fluidcontrols-bottomsheetlist.qml file - - For more information you can read the - \l{https://material.io/guidelines/components/bottom-sheets.html}{Material Design guidelines}. -*/ BottomSheet { id: bottomSheet - /*! - \qmlproperty string title - - Title. - */ property string title - - /*! - \qmlproperty list actions - - Actions to display in the bottom sheet. - */ property list actions height: Math.min(implicitHeight, maxHeight) diff --git a/src/imports/controls/CaptionLabel.qml b/src/imports/controls/CaptionLabel.qml index 23a2dcf4..9ea188c6 100644 --- a/src/imports/controls/CaptionLabel.qml +++ b/src/imports/controls/CaptionLabel.qml @@ -15,20 +15,6 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -/*! - \qmltype CaptionLabel - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Text label with standard font and styling suitable to captions. - - Text label for the Material Design caption text style. - - \snippet fluidcontrols-captionlabel.qml file - - For more information you can read the - \l{https://material.io/guidelines/style/typography.html}{Material Design guidelines}. -*/ Label { font.pixelSize: 12 } diff --git a/src/imports/controls/Card.qml b/src/imports/controls/Card.qml index 1d8639b6..c83648f6 100644 --- a/src/imports/controls/Card.qml +++ b/src/imports/controls/Card.qml @@ -14,17 +14,5 @@ import Fluid.Templates 1.0 as FluidTemplates -/*! - \qmltype Card - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Cards display content composed of different elements. - - \snippet fluidcontrols-card.qml file - - For more information you can read the - \l{https://material.io/guidelines/components/cards.html}{Material Design guidelines}. -*/ FluidTemplates.Card { } diff --git a/src/imports/controls/Chip.qml b/src/imports/controls/Chip.qml new file mode 100644 index 00000000..f39a385f --- /dev/null +++ b/src/imports/controls/Chip.qml @@ -0,0 +1,181 @@ +/* + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * + * $BEGIN_LICENSE:MPL2$ + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * $END_LICENSE$ + */ + +import QtQuick 2.10 +import QtQuick.Layouts 1.0 +import QtQuick.Controls 2.3 +import QtQuick.Controls.Material 2.3 +import Fluid.Controls 1.1 as FluidControls +import Fluid.Effects 1.0 as FluidEffects + +AbstractButton { + id: control + + property bool expandable: false + property alias model: listView.model + property alias delegate: listView.delegate + readonly property alias selectedItem: listView.currentItem + property alias iconItem: iconItem.children + property bool deletable: false + + signal deleted() + + implicitWidth: Math.max(background ? background.implicitWidth : 0, contentItem.implicitWidth) + leftPadding + rightPadding + implicitHeight: Math.max(background ? background.implicitHeight : 0, contentItem.implicitHeight) + topPadding + bottomPadding + + font.pixelSize: expandable ? 14 : 13 + + leftPadding: 12 + rightPadding: 12 + spacing: 8 + + icon.width: 24 + icon.height: 24 + + hoverEnabled: true + + Material.elevation: control.pressed ? 2 : 0 + Material.background: Material.color(Material.Grey, control.checked || control.hovered ? Material.Shade700 : Material.Shade300) + + onClicked: { + if (control.expandable) + popup.open(); + } + + background: Rectangle { + implicitHeight: 32 + radius: 16 + color: control.Material.backgroundColor + + layer.enabled: control.Material.elevation > 0 + layer.effect: FluidEffects.Elevation { + elevation: control.Material.elevation + } + } + + contentItem: RowLayout { + spacing: control.spacing + + Material.theme: control.hovered ? Material.Dark : Material.Light + + FluidControls.Icon { + id: actualIcon + + Layout.alignment: Qt.AlignVCenter + + name: control.icon.name + source: control.icon.source + size: control.icon.width + color: bodyLabel.color + + visible: !iconItem.visible && (name || source.toString()) + } + + Item { + id: iconItem + + Layout.alignment: Qt.AlignVCenter + + objectName: "iconItem" + + implicitWidth: childrenRect.width + implicitHeight: childrenRect.height + + visible: visibleChildren.length > 0 + } + + Label { + id: bodyLabel + + Layout.alignment: Qt.AlignVCenter + + text: control.text + font: control.font + color: FluidControls.Color.transparent(control.checked || control.hovered ? Material.primaryHighlightedTextColor : Material.primaryTextColor, 0.87) + } + + FluidControls.Icon { + id: deleteIcon + + Layout.alignment: Qt.AlignVCenter + + implicitWidth: control.icon.width + implicitHeight: control.icon.height + + source: FluidControls.Utils.iconUrl("navigation/cancel") + color: control.hovered ? Material.primaryHighlightedTextColor : Material.iconColor + colorize: true + + opacity: control.hovered ? 1.0 : 0.54 + + visible: control.deletable + + MouseArea { + anchors.fill: parent + enabled: control.deletable + onClicked: control.deleted() + } + } + } + + Popup { + id: popup + + width: 400 + + padding: 0 + + Material.elevation: 8 + + ScrollView { + anchors.fill: parent + + clip: true + + ListView { + id: listView + currentIndex: 0 + delegate: FluidControls.ListItem { + readonly property string label: model.label + readonly property string value: model.value + readonly property url imageSource: model.imageSource + + text: listView.currentIndex === index ? model.label : "" + subText: model.value + highlighted: ListView.isCurrentItem + leftItem: FluidControls.CircleImage { + anchors.centerIn: parent + source: model.imageSource + width: 40 + height: width + } + rightItem: FluidControls.Icon { + anchors.centerIn: parent + source: FluidControls.Utils.iconUrl("navigation/cancel") + visible: listView.currentIndex === index + + MouseArea { + anchors.fill: parent + onClicked: popup.close() + } + } + onClicked: { + listView.currentIndex = index; + popup.close(); + } + } + } + } + } +} diff --git a/src/imports/controls/CircleImage.qml b/src/imports/controls/CircleImage.qml index 8562fb79..7a3ce2bf 100644 --- a/src/imports/controls/CircleImage.qml +++ b/src/imports/controls/CircleImage.qml @@ -15,77 +15,14 @@ import QtQuick 2.10 import Fluid.Effects 1.0 -/*! - \qmltype CircleImage - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Circular image. - - An \l Image with a \l CircleMask. -*/ Item { id: item - /*! - \qmlproperty url source - - URL of the image to load. - - \sa Image::source - */ property alias source: image.source - - /*! - \qmlproperty enumeration status - \list - \li Image.Null - no image has been set - \li Image.Ready - the image has been loaded - \li Image.Loading - the image is currently being loaded - \li Image.Error - an error occurred while loading the image - \endlist - - Status of the image loading. - - \sa Image::status - */ property alias status: image.status - - /*! - \qmlproperty size sourceSize - - Actual width and height of the loaded image. - - \sa Image::sourceSize - */ property alias sourceSize: image.sourceSize - - /*! - \qmlproperty bool asynchronous - - Specify whether the image should be loaded asynchronously. - - \sa Image::asynchronous - */ property alias asynchronous: image.asynchronous - - /*! - \qmlproperty bool cache - - Specify whether the image should be cached. - - \sa Image::cache - */ property alias cache: image.cache - - /*! - \qmlproperty enumeration fillMode - - Set this property to define what happens when the source image - has a different size than the item. - - \sa Image::fillMode - */ property alias fillMode: image.fillMode width: image.implicitWidth diff --git a/src/imports/controls/DatePickerDialog.qml b/src/imports/controls/DatePickerDialog.qml index 712e3f06..87b2efb6 100644 --- a/src/imports/controls/DatePickerDialog.qml +++ b/src/imports/controls/DatePickerDialog.qml @@ -17,112 +17,16 @@ import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 import Fluid.Controls 1.0 as FluidControls -/*! - \qmltype DatePickerDialog - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - \brief Dialog to select a single date - - Dialog to select a single date from a calendar. - - \code - import QtQuick 2.10 - import Fluid.Controls 1.0 as FluidControls - - Item { - width: 600 - height: 600 - - Button { - anchors.centerIn: parent - text: qsTr("Open") - onClicked: datePickerDialog.open() - } - - FluidControls.DatePickerDialog { - id: datePickerDialog - onAccepted: { - console.log(selectedDate); - } - standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel - } - } - \endcode - - For more information you can read the - \l{https://material.io/guidelines/components/pickers.html}{Material Design guidelines}. -*/ Dialog { id: dialog - /*! - \qmlproperty enumeration Fluid.Controls::DatePickerDialog::orientation - - This property holds the date picker orientation. - The default value is automatically selected based on the device orientation. - - Possible values: - \value DatePicker.Landscape The date picker is landscape. - \value DatePicker.Portrait The date picker is portrait. - */ property alias orientation: datePicker.orientation - - /*! - \qmlproperty bool Fluid.Controls::DatePickerDialog::dayOfWeekRowVisible - - This property determines the visibility of the day of week row. - */ property alias dayOfWeekRowVisible: datePicker.dayOfWeekRowVisible - - /*! - \qmlproperty bool Fluid.Controls::DatePickerDialog::weekNumberVisible - - This property determines the visibility of the week number column. - */ property alias weekNumberVisible: datePicker.weekNumberVisible - - /*! - \qmlproperty date Fluid.Controls::DatePickerDialog::from - - This property holds the start date. - */ property alias from: datePicker.from - - /*! - \qmlproperty date Fluid.Controls::DatePickerDialog::to - - This property holds the end date. - */ property alias to: datePicker.to - - /*! - \qmlproperty date Fluid.Controls::DatePickerDialog::selectedDate - - This property holds the date that has been selected by the user. - The default value is the current date. - */ property alias selectedDate: datePicker.selectedDate - - /*! - \qmlproperty list Fluid.Controls::DatePickerDialog::standardButtonsContainer - - This property allows you to place additional buttons alongside the standard buttons - of the dialog, like in this example: - - \code - FluidControls.DatePickerDialog { - id: datePickerDialog - standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel - standardButtonsContainer: Button { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Today") - flat: true - onClicked: datePickerDialog.selectedDate = new Date() - } - } - \endcode - */ property alias standardButtonsContainer: buttonBox.data x: (parent.width - width) / 2 diff --git a/src/imports/controls/DateTimePickerDialog.qml b/src/imports/controls/DateTimePickerDialog.qml index 138d6df4..5929ba65 100644 --- a/src/imports/controls/DateTimePickerDialog.qml +++ b/src/imports/controls/DateTimePickerDialog.qml @@ -17,112 +17,16 @@ import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 import Fluid.Controls 1.0 as FluidControls -/*! - \qmltype DateTimePickerDialog - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Dialog with a picker to select dates and time - - A dialog that lets you select dates and time. - - \code - import QtQuick 2.10 - import Fluid.Controls 1.0 as FluidControls - - Item { - width: 600 - height: 600 - - FluidControls.DateTimePickerDialog { - onAccepted: { - console.log(selectedDate); - } - standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel - } - } - \endcode - - For more information you can read the - \l{https://material.io/guidelines/components/pickers.html}{Material Design guidelines}. -*/ Dialog { id: dialog - /*! - \qmlproperty enumeration Fluid.Controls::DateTimePickerDialog::orientation - - This property holds the picker orientation. - The default value is automatically selected based on the device orientation. - - Possible values: - \value DatePicker.Landscape The picker is landscape. - \value DatePicker.Portrait The picker is portrait. - */ property alias orientation: dateTimePicker.orientation - - /*! - \qmlproperty bool Fluid.Controls::DateTimePickerDialog::dayOfWeekRowVisible - - This property determines the visibility of the day of week row. - */ property alias dayOfWeekRowVisible: dateTimePicker.dayOfWeekRowVisible - - /*! - \qmlproperty bool Fluid.Controls::DateTimePickerDialog::weekNumberVisible - - This property determines the visibility of the week number column. - */ property alias weekNumberVisible: dateTimePicker.weekNumberVisible - - /*! - \qmlproperty bool Fluid.Controls::DateTimePicker::prefer24Hour - - This property determines the visibility of the AM/PM switch. - */ property alias prefer24Hour: dateTimePicker.prefer24Hour - - /*! - \qmlproperty date Fluid.Controls::DateTimePickerDialog::from - - This property holds the start date. - */ property alias from: dateTimePicker.from - - /*! - \qmlproperty date Fluid.Controls::DateTimePickerDialog::to - - This property holds the end date. - */ property alias to: dateTimePicker.to - - /*! - \qmlproperty date Fluid.Controls::DateTimePickerDialog::selectedDateTime - - This property holds the date and time that has been selected by the user. - The default value is the current date and time. - */ property alias selectedDateTime: dateTimePicker.selectedDateTime - - /*! - \qmlproperty list Fluid.Controls::DateTimePickerDialog::standardButtonsContainer - - This property allows you to place additional buttons alongside the standard buttons - of the dialog, like in this example: - - \code - FluidControls.DateTimePickerDialog { - id: dateTimePickerDialog - standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel - standardButtonsContainer: Button { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Now") - flat: true - onClicked: dateTimePickerDialog.selectedDate = new Date() - } - } - \endcode - */ property alias standardButtonsContainer: buttonBox.data x: (parent.width - width) / 2 diff --git a/src/imports/controls/DialogLabel.qml b/src/imports/controls/DialogLabel.qml index 6e62c8c8..3ad8f005 100644 --- a/src/imports/controls/DialogLabel.qml +++ b/src/imports/controls/DialogLabel.qml @@ -17,20 +17,6 @@ import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 import Fluid.Core 1.0 as FluidCore -/*! - \qmltype DialogLabel - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Text label with standard font and styling suitable to message box text. - - Text label for the Material Design dialog text style. - - \snippet fluidcontrols-dialoglabel.qml file - - For more information you can read the - \l{https://material.io/guidelines/style/typography.html}{Material Design guidelines}. -*/ Label { font.pixelSize: FluidCore.Device.isMobile ? 18 : 17 color: Material.secondaryTextColor diff --git a/src/imports/controls/DisplayLabel.qml b/src/imports/controls/DisplayLabel.qml index dffe749a..2483d789 100644 --- a/src/imports/controls/DisplayLabel.qml +++ b/src/imports/controls/DisplayLabel.qml @@ -15,31 +15,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -/*! - \qmltype DisplayLabel - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Text label with standard font and styling suitable to display text. - - Text label for the Material Design display text style. - - \snippet fluidcontrols-displaylabel.qml file - - For more information you can read the - \l{https://material.io/guidelines/style/typography.html}{Material Design guidelines}. -*/ Label { - /*! - \qmlproperty int level - - This property holds the label level that controls - font style and size. - - Only values between 1 and 4 are allowed. - - Default value is 1. - */ property int level: 1 font.pixelSize: { diff --git a/src/imports/controls/FloatingActionButton.qml b/src/imports/controls/FloatingActionButton.qml index 737b4f91..b90ead4c 100644 --- a/src/imports/controls/FloatingActionButton.qml +++ b/src/imports/controls/FloatingActionButton.qml @@ -21,23 +21,7 @@ import Fluid.Core 1.0 as FluidCore import Fluid.Controls 1.0 as FluidControls import Fluid.Effects 1.0 as FluidEffects -/*! - \qmltype FloatingActionButton - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - \brief A floating action button. - - A floating action button represents the primary action of the current page - and is used for a promoted action. - - It is a push button with rounded corners and an icon in the center. - - \snippet fluidcontrols-fab.qml file - - For more information you can read the - \l{https://material.io/guidelines/components/buttons-floating-action-button.html}{Material Design guidelines}. -*/ RoundButton { id: control @@ -49,20 +33,6 @@ RoundButton { topPadding: 6 bottomPadding: 6 - /*! - \qmlproperty bool mini - - Floating action button comes in two sizes: - - \list - \li \c Default (56x56 pixels): default size for most use cases - \li \c Mini (40x40 pixels): only used to create visual continuity with other screen elements - \endlist - - This property holds whether the floating action button size is \c Mini or not. - - By default it is \c true if screen width is less than 460 pixels. - */ property bool mini: Screen.width < 460 Material.elevation: 1 @@ -71,8 +41,7 @@ RoundButton { implicitWidth: control.mini ? 40 : 56 implicitHeight: implicitWidth - x: control.leftPadding - y: control.topPadding + anchors.centerIn: parent color: !control.enabled ? control.Material.buttonDisabledColor : control.checked || control.highlighted ? control.Material.highlightedButtonColor : control.Material.buttonColor diff --git a/src/imports/controls/HeadlineLabel.qml b/src/imports/controls/HeadlineLabel.qml index 4f594126..586fa7f0 100644 --- a/src/imports/controls/HeadlineLabel.qml +++ b/src/imports/controls/HeadlineLabel.qml @@ -15,20 +15,6 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -/*! - \qmltype HeadlineLabel - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Text label with standard font and styling suitable to headlines. - - Text label for the Material Design headline text style. - - \snippet fluidcontrols-headinglabel.qml file - - For more information you can read the - \l{https://material.io/guidelines/style/typography.html}{Material Design guidelines}. -*/ Label { font.pixelSize: 24 lineHeight: 32.0 diff --git a/src/imports/controls/Icon.qml b/src/imports/controls/Icon.qml index 218c3451..a2bee2f4 100644 --- a/src/imports/controls/Icon.qml +++ b/src/imports/controls/Icon.qml @@ -20,149 +20,25 @@ import QtQuick.Controls.Material 2.3 import Fluid.Core 1.0 import Fluid.Controls 1.0 -/*! - \qmltype Icon - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Displays an icon from the Material Design icon collection, the platform's icon theme, - or another (local or remote) location. - - To use an icon from the \l{https://materialdesignicons.com/}{Material Design icon collection}, - set the \c name property to the name of the icon in its group in the form of \c group/icon_name. For example: - \code - Icon { - name: "action/settings" - } - \endcode - - This icon will by default use the light icon color from Material Design. To use the dark icon - color: - \code - Icon { - Material.theme: Material.Dark - - name: "action/settings" - } - \endcode - - In addition to using icons from Material Design, you can also use icons from the platform's - \l{http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html}{Freedesktop icon theme}. For example: - - \code - Icon { - name: "gimp" - } - \endcode - - By default, icons from the Freedesktop icon theme are not colorized unless they include the word "symbolic" in the icon name. For example, "gimp" would be full-colored by "edit-cut-symbolic" would be colored using the set \c color property (based off of \c Material.theme). If you need to colorize an icon manually, you can do so like this: - - \code - Icon { - name: "gimp" - colorize: true - } - \endcode - - You can also use custom icons like this: - \code - Icon { - source: Qt.resolvedUrl("icons/fun_icon.png") - } - \endcode - */ Item { id: icon - /*! - \qmlproperty color color - - The color of the icon. Defaults to \c Material.iconColor. - */ property color color: Material.iconColor - - /*! - \qmlproperty real size - - The size of the icon. Defaults to 24px. - */ property real size: 24 - - /*! - \qmlproperty string name - - The name of the icon to display. - - \sa source - */ property string name - - /*! - \qmlproperty url source - - \brief A URL pointing to an image to display as the icon. - - By default, this is a special URL representing the icon named by \l name from the Material - Design icon collection when using the form of "collection/icon_name", or in the case of a - single "icon_name", the platform's Freedesktop icon theme will be used. - - By default, icons from the Material Design icons collection will be treated as symbolic icons and colored using the specified \l color, while icons from the Freedesktop icon theme will - not be colorized. To override this, or set the behavior for your own custom icons, use - \l colorize. - - \sa name - */ - property url source: { + property url source: { return name ? name.indexOf("/") === 0 || name.indexOf("file://") === 0 || name.indexOf("qrc") === 0 ? name : "image://fluidicontheme/" + name : ""; } - - /*! - \qmlproperty enumeration status - \list - \li Image.Null - no image has been set - \li Image.Ready - the image has been loaded - \li Image.Loading - the image is currently being loaded - \li Image.Error - an error occurred while loading the image - \endlist - */ property alias status: image.status - - /*! - \qmlproperty bool cache - - Specifies whether the image should be cached. - The default value is true. - - Setting cache to false is useful when dealing with large images, - to make sure that they aren't cached at the expense of small - 'ui element' images. - */ property alias cache: image.cache - - /*! - \qmlproperty bool valid - - \c true if the icon is valid and fully loaded. - */ readonly property bool valid: status == Image.Ready - - /*! - Set to \c false if you want the icon to use the original image's colors and not be - colored using the specified \c color. - */ property bool colorize: (String(icon.source).indexOf(".color.") === -1 && String(icon.source).indexOf("image://fluidicontheme/") === -1) || String(icon.source).indexOf("symbolic") !== -1 || (String(icon.source).indexOf("image://fluidicontheme/") !== -1 && icon.name.indexOf("/") !== -1) - - /*! - \qmlproperty real sourceSize - - Source image size. - */ readonly property real sourceSize: String(icon.source).indexOf("image://fluidicontheme/") === 0 ? Units.roundToIconSize(size) : size width: size diff --git a/src/imports/controls/InputDialog.qml b/src/imports/controls/InputDialog.qml index 23276bb2..0de449ec 100644 --- a/src/imports/controls/InputDialog.qml +++ b/src/imports/controls/InputDialog.qml @@ -17,34 +17,10 @@ import QtQuick.Layouts 1.3 import QtQuick.Controls 2.3 import Fluid.Controls 1.0 as FluidControls -/*! - \qmltype InputDialog - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Input dialogs ask the user to input data with certain constraints. - - The dialog is automatically accepted when the Return or Enter key is pressed - and the input in an acceptable state. - - For more information you can read the - \l{https://material.io/guidelines/components/dialogs.html}{Material Design guidelines}. -*/ Dialog { id: dialog - /*! - \qmlproperty TextField textField - - Text field. - */ property alias textField: textField - - /*! - \qmlproperty string text - - Dialog text. - */ property alias text: dialogLabel.text focus: true diff --git a/src/imports/controls/ListItem.qml b/src/imports/controls/ListItem.qml index e065e0e5..aa1f7fac 100644 --- a/src/imports/controls/ListItem.qml +++ b/src/imports/controls/ListItem.qml @@ -21,75 +21,16 @@ import QtQuick.Controls.Material 2.3 import Fluid.Core 1.0 as FluidCore import Fluid.Controls 1.0 as FluidControls -/*! - \qmltype ListItem - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief A standard list item, with one or more lines of text and optional left and right items. - */ ItemDelegate { id: listItem - /*! - \qmlproperty int dividerInset - - How many pixels the divider is from the left border. - This property is set to the \l leftItem width by default. - - \sa ListItem::showDivider - \sa ListItem::leftItem - */ property int dividerInset: leftItem.showing ? listItem.height : 0 - - /*! - \qmlproperty bool showDivider - - This property holds whether the divider is shown or not. - Default value is \c false. - */ property alias showDivider: divider.visible - - /*! - \qmlproperty int maximumLineCount - - Maximum number of text lines allowed to show. - */ property int maximumLineCount: 2 - - /*! - \qmlproperty string subText - - Text to display below \l text. - */ property alias subText: subLabel.text - - /*! - \qmlproperty string valueText - - Value text. - */ property alias valueText: valueLabel.text - - /*! - \qmlproperty Item leftItem - - Item to show on the left. - */ property alias leftItem: leftItem.children - - /*! - \qmlproperty Item rightItem - - Item to show on the right. - */ property alias rightItem: rightItem.children - - /*! - \qmlproperty Item secondaryItem - - Secondary item. - */ property alias secondaryItem: secondaryItem.children /*! @@ -126,27 +67,6 @@ ItemDelegate { } contentItem: RowLayout { - implicitHeight: { - var height = 0; - - if (subText != "") { - if (maximumLineCount == 2) - height = 72; - else - height = 88; - } else { - if (secondaryItem.showing) - height = secondaryItem.childrenRect.height + (label.visible ? FluidControls.Units.largeSpacing * 2 : FluidControls.Units.smallSpacing * 2); - else - height = 48; - } - - var leftHeight = leftItem.childrenRect.height + FluidControls.Units.smallSpacing * 2; - var rightHeight = rightItem.childrenRect.height + FluidControls.Units.smallSpacing * 2; - - return Math.max(height, leftHeight, rightHeight); - } - spacing: FluidControls.Units.smallSpacing * 2 Item { @@ -156,8 +76,8 @@ ItemDelegate { objectName: "leftItem" - Layout.preferredWidth: showing ? 40 : 0 - Layout.preferredHeight: width + Layout.preferredWidth: showing ? childrenRect.width : 0 + Layout.preferredHeight: showing ? childrenRect.height : 0 Layout.alignment: Qt.AlignCenter IconLabel { @@ -228,14 +148,13 @@ ItemDelegate { objectName: "subTextLabel" Layout.fillWidth: true - Layout.preferredHeight: visible ? implicitHeight * maximumLineCount/lineCount : 0 color: Material.secondaryTextColor elide: Text.ElideRight wrapMode: Text.WordWrap visible: text != "" && !contentItem.showing - maximumLineCount: visible ? listItem.maximumLineCount - 1 : 0 + maximumLineCount: visible ? listItem.maximumLineCount : 0 } Item { @@ -246,7 +165,7 @@ ItemDelegate { objectName: "secondaryItem" Layout.fillWidth: true - Layout.preferredHeight: showing ? childrenRect.height + (label.visible ? FluidControls.Units.smallSpacing : FluidControls.Units.largeSpacing) : 0 + Layout.preferredHeight: showing ? childrenRect.height + (FluidControls.Units.smallSpacing * 2) : 0 } } @@ -258,7 +177,7 @@ ItemDelegate { objectName: "rightItem" Layout.preferredWidth: showing ? childrenRect.width : 0 - Layout.preferredHeight: parent.height + Layout.preferredHeight: showing ? childrenRect.height + (FluidControls.Units.smallSpacing * 2) : 0 } } } diff --git a/src/imports/controls/Loadable.qml b/src/imports/controls/Loadable.qml index 8f860eb5..eae29ae4 100644 --- a/src/imports/controls/Loadable.qml +++ b/src/imports/controls/Loadable.qml @@ -14,47 +14,11 @@ import QtQuick 2.10 -/*! - \qmltype Loadable - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Loadable component. -*/ Item { - /*! - \qmlproperty Component component - - Component to load. - */ property Component component - - /*! - \qmlproperty Animation showAnimation - - Animation to play when the component is shown. - */ property var showAnimation - - /*! - \qmlproperty Animation hideAnimation - - Animation to play when the component is hidden. - */ property var hideAnimation - - /*! - \qmlproperty bool asynchronous - - Whether the component is loaded asynchronously or not. - */ property alias asynchronous: loader.asynchronous - - /*! - \qmlproperty Item item - - Item created after \l Loadable::component is loaded. - */ property alias item: loader.item id: root @@ -88,20 +52,10 @@ Item { } } - /*! - \qmlmethod void Loadable::show() - - Show the component. - */ function show() { loader.sourceComponent = root.component; } - /*! - \qmlmethod void Loadable::hide() - - Hide the component. - */ function hide() { if (loader.item && loader.item.hide != undefined) loader.item.hide(); diff --git a/src/imports/controls/NavigationDrawer.qml b/src/imports/controls/NavigationDrawer.qml index 18885acf..0535d475 100644 --- a/src/imports/controls/NavigationDrawer.qml +++ b/src/imports/controls/NavigationDrawer.qml @@ -20,79 +20,21 @@ import QtQuick.Controls.Material 2.3 import Fluid.Core 1.0 as FluidCore import Fluid.Controls 1.0 as FluidControls -/*! - \qmltype NavigationDrawer - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief The navigation drawer slides in from the left and is a common pattern in apps. - - This is a temporary navigation drawer: it can toggle open or closed. - Closed by default, this type of navigation drawer opens temporarily above all - other content until a section is selected or the overlay is tapped. - - NavigationDrawer is recommended on phones and tablets. - - This navigation drawer comes with no contents, therefore it's completely customizable. - - \code - import Fluid.Controls 2.0 as FluidControls - - FluidControls.ApplicationWindow { - width: 400 - height: 400 - visible: true - - Button { - text: "Open" - onClicked: drawer.open() - } - - FluidControls.NavigationDrawer { - topContent: Image { - source: "background.png" - - Layout.fillWidth: true - Layout.preferredHeight: 200 - } - - FluidControls.ListItem { - icon.source: FluidControls.Utils.iconUrl("content/inbox") - text: "Inbox" - } - - FluidControls.ListItem { - icon.source: FluidControls.Utils.iconUrl("content/archive") - text: "Archive" - } - - FluidControls.ListItem { - icon.source: FluidControls.Utils.iconUrl("action/settings") - text: "Settings" - showDivider: true - } - } - } - \endcode - - For more information you can read the - \l{https://material.io/guidelines/patterns/navigation-drawer.html}{Material Design guidelines}. -*/ Drawer { id: drawer - /*! - \qmlproperty list topContent - - The items added to this list will be displayed on top of the contents. - */ - property alias topContent: topContent.data + property alias topContent: topItem.data /*! \internal */ - default property alias contents: mainLayout.data + default property alias contents: mainitem.data + y: { + if (!modal && ApplicationWindow && ApplicationWindow.header) + return ApplicationWindow.header.height; + return 0; + } width: { switch (FluidCore.Device.formFactor) { case FluidCore.Device.Phone: @@ -107,13 +49,18 @@ Drawer { height: { if (ApplicationWindow) return (ApplicationWindow.header ? ApplicationWindow.header.height : 0) + - (ApplicationWindow.contentItem ? ApplicationWindow.contentItem.height : 0); + (ApplicationWindow.contentItem ? ApplicationWindow.contentItem.height : 0) - y; else if (Window) - return Window.contentItem; + return Window.contentItem - y; else - return parent.height; + return parent.height - y; } + modal: FluidCore.Device.isMobile + interactive: FluidCore.Device.isMobile + position: FluidCore.Device.isMobile ? 0.0 : 1.0 + visible: !FluidCore.Device.isMobile + padding: 0 Material.elevation: interactive ? 4 : 0 @@ -124,21 +71,35 @@ Drawer { anchors.fill: parent padding: 0 - ColumnLayout { - id: mainLayout + Item { + id: topItem + + anchors.left: parent.left + anchors.top: parent.top + anchors.right: parent.right + anchors.margins: drawer.padding + + height: childrenRect.height + visible: height > 0 + + Behavior on height { + NumberAnimation { duration: FluidControls.Units.shortDuration } + } + } - anchors.fill: parent - spacing: 0 + Item { + id: mainitem - ColumnLayout { - id: topContent + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + anchors.margins: drawer.padding - spacing: 0 - visible: children.length > 0 + height: pane.height - topItem.height + visible: children.length > 0 - Layout.margins: drawer.padding - Layout.fillWidth: true - Layout.fillHeight: true + Behavior on height { + NumberAnimation { duration: FluidControls.Units.shortDuration } } } } diff --git a/src/imports/controls/NavigationListView.qml b/src/imports/controls/NavigationListView.qml index fbe4efde..56267686 100644 --- a/src/imports/controls/NavigationListView.qml +++ b/src/imports/controls/NavigationListView.qml @@ -13,107 +13,21 @@ */ import QtQuick 2.10 -import QtQuick.Layouts 1.3 import QtQuick.Controls 2.3 import Fluid.Core 1.0 as FluidCore import Fluid.Controls 1.0 as FluidControls -/*! - \qmltype NavigationListView - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief The navigation drawer slides in from the left and is a common pattern in apps. - - This is a temporary navigation drawer: it can toggle open or closed. - Closed by default, this type of navigation drawer opens temporarily above all - other content until a section is selected or the overlay is tapped. - - NavigationDrawer is recommended on phones and tablets. - - This navigation drawer comes with a built-in ListView. - - \code - import QtQuick.Window 2.2 - import Fluid.Controls 2.0 as FluidControls - - Window { - id: window - width: 400 - height: 400 - visible: true - - Button { - text: "Open" - onClicked: drawer.open() - } - - FluidControls.NavigationListView { - topContent: Image { - source: "background.png" - - Layout.fillWidth: true - Layout.preferredHeight: 200 - } - - actions: [ - FluidControls.Action { - text: "Action 1" - }, - FluidControls.Action { - text: "Action 2" - } - ] - } - } - \endcode - - For more information you can read the - \l{https://material.io/guidelines/patterns/navigation-drawer.html}{Material Design guidelines}. -*/ FluidControls.NavigationDrawer { id: drawer - /*! - \qmlproperty int currentIndex - - The \c currentIndex property holds the index of the current item. - */ property alias currentIndex: navDrawerListView.currentIndex - - /*! - \qmlproperty Item currentItem - - The \c currentItem property holds the current item. - */ property alias currentItem: navDrawerListView.currentItem - - /*! - \qmlproperty bool autoHighlight - - This property holds whether auto-highlight is enabled. - - If this property is \c true, the current item will be automatically highlighted. - - The default value is \c false. - */ property bool autoHighlight: false - - /*! - \qmlproperty list actions - - List of actions to be displayed by the drawer. - */ property list actions - - /*! - \qmlproperty Component delegate - - The delegate for item that constitute a menu item. - */ property alias delegate : navDrawerListView.delegate ScrollView { + anchors.fill: parent clip: true ListView { @@ -144,8 +58,5 @@ FluidControls.NavigationDrawer { visible: count > 0 } - - Layout.fillWidth: true - Layout.fillHeight: true } } diff --git a/src/imports/controls/NoiseBackground.qml b/src/imports/controls/NoiseBackground.qml index cb10eee8..816ac7e6 100644 --- a/src/imports/controls/NoiseBackground.qml +++ b/src/imports/controls/NoiseBackground.qml @@ -55,30 +55,8 @@ import QtQuick 2.10 -/*! - \qmltype NoiseBackground - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Background with noise. -*/ ShaderEffect { - /*! - \qmlproperty Gradient gradient - - The gradient to use to fill the rectangle. - - \sa Rectangle::gradient - */ property alias gradient: rect.gradient - - /*! - \qmlproperty color color - - The color to use to fill the rectangle. - - \sa Rectangle::color - */ property alias color: rect.color Rectangle { diff --git a/src/imports/controls/OverlayView.qml b/src/imports/controls/OverlayView.qml index 0044f768..f1f47665 100644 --- a/src/imports/controls/OverlayView.qml +++ b/src/imports/controls/OverlayView.qml @@ -15,21 +15,6 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -/*! - \qmltype OverlayView - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Ready made popup centered on its parent. - - This controls provides a ready made popup visual element that can be - used with \l Window or \l ApplicationWindow. - - Overlay is centered to its parent. In order to ensure it is displayed - above other items in the scene, it is recommended to use ApplicationWindow. - ApplicationWindow also provides background dimming effects since Overlay - acts as a modal popup. - */ Popup { x: (parent.width - width) / 2 y: (parent.height - height) / 2 diff --git a/src/imports/controls/Page.qml b/src/imports/controls/Page.qml index 62e9748b..b0491e00 100644 --- a/src/imports/controls/Page.qml +++ b/src/imports/controls/Page.qml @@ -18,130 +18,46 @@ import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 import Fluid.Controls 1.0 as FluidControls -/*! - \qmltype Page - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Represents a page on the navigation page stack. - - Example: - - \qml - import QtQuick 2.10 - import Fluid.Controls 1.0 as FluidControls - - FluidControls.Page { - title: "Application Name" - - actions: [ - FluidControls.Action { - name: "Print" - - // Icon name from the Google Material Design icon pack - icon.source: FluidControls.Utils.iconUrl("action/print") - } - ] - } - \endqml - */ Page { id: page - /*! - \qmlproperty ActionBar actionBar - - The action bar for this page. Use it as a group property to customize - this page's action bar. See the \l Page example for details on how to use - this property. - */ property alias appBar: appBar - /*! - The page's actions shown in the action bar. - */ property alias actions: appBar.actions - /*! - The action shown to the left of the title in the action bar. By default, - this is a back button which shows when there is a page behind the current - page in the page stack. However, you can replace it with your own action, - for example, an icon to open a navigation drawer when on your root page. - */ property alias leftAction: appBar.leftAction - /*! - \internal - Set by the page stack to true if there is a page behind this page on the - page stack. - */ property bool canGoBack: false - /*! - \qmlsignal void goBack(var event) - - This signal is emitted when the back action is triggered or back key is released. - - By default, the page will be popped from the page stack. To change the default - behavior, for example to show a confirmation dialog, listen for this signal using - \c onGoBack and set \c event.accepted to \c true. To dismiss the page from your - dialog without triggering this signal and re-showing the dialog, call - \c page.forcePop(). - */ signal goBack(var event) - /*! - \qmlmethod void Page::pop(event event, bool force) - - Pop this page from the page stack. This does nothing if this page is not - the current page on the page stack. - - Use \c force to avoid calling the \l goBack signal. This is useful if you - use the \l goBack signal to show a confirmation dialog, and want to close - the page from your dialog without showing the dialog again. You can also - use \l Page::forcePop() as a shortcut to this behavior. - - \sa Page::forcePop() - */ function pop(event, force) { if (StackView.view.currentItem !== page) - return false + return false; if (!event) - event = {accepted: false} + event = {accepted: false}; if (!force) - goBack(event) + goBack(event); if (event.accepted) { - return true + return true; } else { - return StackView.view.pop() + return StackView.view.pop(); } } - /*! - \qmlmethod void Page::forcePop() - - Force a pop from the page stack. - */ function forcePop() { - pop(null, true) + pop(null, true); } - /*! - \qmlmethod void Page::push(Component component, object properties) - - Push the specified component onto the page stack. - - \sa StackView::push() - */ function push(component, properties) { return StackView.view.push(component, properties); } Keys.onReleased: { - // catches the Android back button event and pops the page, if it isn't the top page + // Catches the Android back button event and pops the page, if it isn't the top page if (event.key === Qt.Key_Back && StackView.view.depth > 1) { pop(event, false); event.accepted = true; @@ -163,6 +79,7 @@ Page { text: qsTr("Back") toolTip: qsTr("Go back") + shortcut: StandardKey.Back visible: page.canGoBack onTriggered: page.pop() diff --git a/src/imports/controls/Page11.qml b/src/imports/controls/Page11.qml new file mode 100644 index 00000000..822945b1 --- /dev/null +++ b/src/imports/controls/Page11.qml @@ -0,0 +1,128 @@ +/* + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * Copyright (C) 2018 Michael Spencer + * + * $BEGIN_LICENSE:MPL2$ + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * $END_LICENSE$ + */ + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Controls.Material 2.3 +import Fluid.Controls 1.1 as FluidControls + +Page { + id: page + + default property alias data: content.data + + property alias appBar: appBar + + property alias actions: appBar.actions + + property alias leftAction: appBar.leftAction + + property bool canGoBack: false + + property alias customContent: appBar.customContent + + property Item rightSidebar: null + + signal goBack(var event) + + onRightSidebarChanged: { + if (rightSidebar) + rightSidebar.edge = Qt.RightEdge; + } + + function pop(event, force) { + if (StackView.view.currentItem !== page) + return false; + + if (!event) + event = {accepted: false}; + + if (!force) + goBack(event); + + if (event.accepted) { + return true; + } else { + return StackView.view.pop(); + } + } + + function forcePop() { + pop(null, true); + } + + function push(component, properties) { + return StackView.view.push(component, properties); + } + + Keys.onReleased: { + // Catches the Android back button event and pops the page, if it isn't the top page + if (event.key === Qt.Key_Back && StackView.view.depth > 1) { + pop(event, false); + event.accepted = true; + } + + // Toggle overflow menu when the menu button is released + if (event.key === Qt.Key_Menu) { + appBar.toggleOverflowMenu(); + event.accepted = true; + } + } + + header: null + footer: null + + FluidControls.AppBar { + id: appBar + + Material.elevation: 0 + + title: page.title + + leftAction: FluidControls.Action { + icon.source: FluidControls.Utils.iconUrl("navigation/arrow_back") + + text: qsTr("Back") + toolTip: qsTr("Go back") + shortcut: StandardKey.Back + visible: page.canGoBack + + onTriggered: page.pop() + } + } + + Item { + id: content + + anchors.left: parent.left + anchors.top: parent.top + anchors.right: rightSidebarContent.left + anchors.bottom: parent.bottom + } + + Item { + id: rightSidebarContent + + anchors.top: parent.top + anchors.right: parent.right + anchors.bottom: parent.bottom + + children: [rightSidebar] + + width: rightSidebar + ? rightSidebar.width + rightSidebar.anchors.rightMargin + : 0 + } +} diff --git a/src/imports/controls/PageSidebar.qml b/src/imports/controls/PageSidebar.qml new file mode 100644 index 00000000..0d491cfe --- /dev/null +++ b/src/imports/controls/PageSidebar.qml @@ -0,0 +1,46 @@ +/* + * This file is part of Fluid. + * + * Copyright (C) 2018 Pier Luigi Fiorini + * Copyright (C) 2018 Michael Spencer + * + * $BEGIN_LICENSE:MPL2$ + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * $END_LICENSE$ + */ + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import Fluid.Controls 1.1 as FluidControls + +FluidControls.Page { + id: pageSidebar + + default property alias sidebar: sidebar.data + + property alias edge: sidebar.edge + property bool showing: true + + anchors.rightMargin: showing ? 0 : -width + + height: parent.height + + Behavior on anchors.rightMargin { + id: behavior + enabled: false + + NumberAnimation { duration: FluidControls.Units.mediumDuration } + } + + FluidControls.Sidebar { + id: sidebar + + anchors.fill: parent + } + + Component.onCompleted: behavior.enabled = true +} diff --git a/src/imports/controls/PageStack.qml b/src/imports/controls/PageStack.qml index 88102932..417a579f 100644 --- a/src/imports/controls/PageStack.qml +++ b/src/imports/controls/PageStack.qml @@ -15,35 +15,11 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -/*! - \qmltype PageStack - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Manages the page stack used for navigation. -*/ StackView { id: stackView - /*! - \qmlsignal pushed(Item page) - - This signal is emitted when an item is pushed to the stack. - */ signal pushed(Item page) - - /*! - \qmlsignal popped(Item page) - - This signal is emitted when an item is popped from the stack. - */ signal popped(Item page) - - /*! - \qmlsignal replaced(Item page) - - This signal is emitted when an item is replaced in the stack. - */ signal replaced(Item page) property int __lastDepth: 0 diff --git a/src/imports/controls/Placeholder.qml b/src/imports/controls/Placeholder.qml index b45b6388..9a2a373e 100644 --- a/src/imports/controls/Placeholder.qml +++ b/src/imports/controls/Placeholder.qml @@ -20,33 +20,11 @@ import QtQuick.Controls.impl 2.3 import QtQuick.Controls.Material 2.3 import Fluid.Controls 1.0 -/*! - \qmltype Placeholder - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Shows a placeholder icon and text. - - For more information you can read the - \l{https://material.io/guidelines/patterns/empty-states.html#empty-states-avoiding-completely-empty-states}{Material Design guidelines}. -*/ Control { id: control property alias icon: iconLabel.icon - - /*! - \qmlproperty string text - - Text. - */ property alias text: textLabel.text - - /*! - \qmlproperty string subText - - Sub text. - */ property alias subText: subTextLabel.text implicitWidth: columnLayout.implicitWidth diff --git a/src/imports/controls/Ripple.qml b/src/imports/controls/Ripple.qml index e7690531..604640bf 100644 --- a/src/imports/controls/Ripple.qml +++ b/src/imports/controls/Ripple.qml @@ -18,76 +18,15 @@ import Fluid.Core 1.0 import Fluid.Controls 1.0 as FluidControls import Fluid.Effects 1.0 -/*! - \qmltype Ripple - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Represents a Material Design ripple ink animation used in various touchable components. - - This component is useful for including in Material Design-specific components, which should be implemented using the +material file selector. Eventually this should be upstreamed to QtQuick - Controls 2. - - For more information you can read the - \l{https://material.io/guidelines/motion/material-motion.html#material-motion-how-does-material-move}{Material Design guidelines}. - */ MouseArea { id: ripple - /*! - \qmlproperty color color - - The color of the ripple. Defaults to black with 12% opacity. - */ property color color: Qt.rgba(0,0,0,0.12) - - /*! - \qmlproperty bool circular - - Set to \c true if the ripple is used on a circular component, such as a button in an - action bar or a floating action button. - */ property bool circular: false - - /*! - \qmlproperty bool centered - - Set to \c true if the ripple should be centered regardless of where the mouse/touch - input came from. - */ property bool centered: false - - /*! - \qmlproperty bool focused - - Set to \c true if the component is focused and should display a focus ripple. - */ property bool focused - - /*! - \qmlproperty color focusColor - - The color of the focus ripple. Also used to determine the color of the focus background - behind the ripple. - - \sa Ripple::focused - */ property color focusColor: "transparent" - - /*! - \qmlproperty int focusWidth - - The width of the focus ripple. - - \sa Ripple::focused - */ property int focusWidth: width - 32 - - /*! - \qmlproperty Item control - - Control that that needs the ripple effect. - */ property Item control clip: true diff --git a/src/imports/controls/SearchBar.qml b/src/imports/controls/SearchBar.qml index 078151a0..c8621c81 100644 --- a/src/imports/controls/SearchBar.qml +++ b/src/imports/controls/SearchBar.qml @@ -18,96 +18,38 @@ import QtQuick.Controls.Material 2.3 import QtQuick.Layouts 1.3 import Fluid.Controls 1.0 as FluidControls -/*! - \qmltype SearchBar - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Provides a searchbar, that supports autocompletion and displays search results using cards. -*/ Item { id: searchBar - /*! - \qmlproperty string searchText - - The current search text in the search bar typed in so far. - */ property alias searchText: searchTextField.text - /*! - \qmlproperty any model - - The suggestions to display. - - \sa SearchBar::suggestionTextRole - \sa SearchBar::suggestionDelegate - */ property alias searchSuggestions: suggestionsListView.model - /*! - The delegate item for the suggestion list view. - \sa searchSuggestions - */ property alias suggestionDelegate: suggestionsListView.delegate - /*! - The model type that contains the text to display in the suggestion delegate - \sa searchSuggestions - */ property string suggestionTextRole: "text" - /*! - The string to display when the search field is empty - */ property string searchPlaceHolder: qsTr("Search") - /*! - The width of the search card. By default the search bar centers in the parent with a margin of 64 each side - */ property int cardWidth: searchBar.width - Units.largeSpacing - /*! - The viewable area of the suggestions list until it begins scrolling. - */ property int suggestionsHeight: 300 - /*! - The background color of the expanded search bar. - */ property color waveColor: Material.accentColor - /*! - Whether the SearchBar is persistent or expandable - */ property bool persistent: false - /*! - Whether the SearchBar is currently open - */ readonly property alias expanded: searchWave.open - /*! - The model containing the search results - */ property var searchResults: ListModel {} - /*! - Is emitted, when the user searches for a query. The \a query parameter contains the search query as string. Use this signal to provide search results. - */ signal search(string query) - /*! - Opens the search bar - */ function open() { searchWave.openWave(openSearchButton.x, openSearchButton.y); searchTextField.forceActiveFocus(); } - /*! - Closes the search bar - */ function close() { if (persistent) diff --git a/src/imports/controls/SearchBar11.qml b/src/imports/controls/SearchBar11.qml new file mode 100644 index 00000000..a912c6ba --- /dev/null +++ b/src/imports/controls/SearchBar11.qml @@ -0,0 +1,196 @@ +/* + * This file is part of Fluid. + * + * Copyright (C) 2018 Magnus Groß + * + * $BEGIN_LICENSE:MPL2$ + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * $END_LICENSE$ + */ + +import QtQuick 2.10 +import QtQuick.Controls 2.3 +import QtQuick.Controls.Material 2.3 +import QtQuick.Layouts 1.3 +import Fluid.Controls 1.1 as FluidControls + +Item { + id: searchBar + + property alias searchText: searchTextField.text + + property alias searchSuggestions: suggestionsListView.model + + property alias suggestionDelegate: suggestionsListView.delegate + + property string suggestionTextRole: "text" + + property string searchPlaceHolder: qsTr("Search") + + property int cardWidth: searchBar.width - Units.largeSpacing + + property int suggestionsHeight: 300 + + property color waveColor: Material.accentColor + + property bool persistent: false + + readonly property alias expanded: searchWave.open + + property alias searchTextFont: searchTextField.font + + property var searchResults: ListModel {} + + signal search(string query) + + function open() { + searchWave.openWave(openSearchButton.x, openSearchButton.y); + searchTextField.forceActiveFocus(); + } + + function close() { + + if (persistent) + return; + + searchWave.closeWave(searchWave.initialX, searchWave.initialY); + searchSuggestions.clear(); + searchResults.clear(); + searchTextField.focus = false; + } + + anchors {left: parent.left; right: parent.right; top: parent.top} + height: 64 + + Item { + anchors.fill: parent + FluidControls.ToolButton { + id: openSearchButton + + anchors.right: parent.right + anchors.top: parent.top + anchors.margins: 8 + + icon.source: FluidControls.Utils.iconUrl("action/search") + + onClicked: open() + } + + FluidControls.Wave { + id: searchWave + anchors.fill: parent + size: persistent ? diameter : 0 + visible: persistent + Rectangle { + anchors.fill: parent + color: waveColor + } + FluidControls.Card { + id: searchCard + anchors.top: parent.top + anchors.left: parent.left + anchors.margins: Units.smallSpacing + width: cardWidth + height: openSearchButton.height + FluidControls.ToolButton { + id: dismissSearchButton + icon.source: FluidControls.Utils.iconUrl(persistent ? "action/search" : "navigation/arrow_back") + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + rotation: persistent ? 0 : searchWave.open ? 0 : 180 + onClicked: { + if (persistent) + search(searchTextField.text); + else + close(); + } + + Behavior on rotation { + NumberAnimation { + easing.type: Easing.InOutCubic + duration: 150 + } + } + } + TextInput { + id: searchTextField + anchors.verticalCenter: parent.verticalCenter + anchors.left: dismissSearchButton.right + anchors.right: resetSearchButton.left + font.pixelSize: parent.height/2 + Keys.onReturnPressed: search(text) + Keys.onEscapePressed: { + if (!persistent) + close(); + } + Keys.onDownPressed: suggestionsListView.forceActiveFocus() + onTextChanged: { + searchResults.clear(); + searchSuggestions.clear(); + } + inputMethodHints: Qt.ImhNoPredictiveText + } + Label { + text: searchPlaceHolder + visible: searchTextField.displayText === "" + anchors.fill: searchTextField + verticalAlignment: Label.AlignVCenter + font.pixelSize: searchTextField.font.pixelSize + color: Material.color(Material.Grey, Material.Shade400) + } + + FluidControls.ToolButton { + id: resetSearchButton + opacity: searchTextField.displayText !== "" + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.right: parent.right + icon.source: FluidControls.Utils.iconUrl("navigation/close") + rotation: opacity*90 + onClicked: { + searchTextField.clear(); + searchTextField.forceActiveFocus(); + } + Behavior on opacity { + NumberAnimation { + easing.type: Easing.InOutCubic + duration: 200 + } + } + } + } + } + } + ListView { + id: suggestionsListView + visible: searchResults.count === 0 && searchSuggestions.count !== 0 + anchors.top: parent.bottom + x: searchCard.x + width: cardWidth + height: suggestionsHeight + model: ListModel {} + clip: true + Keys.onUpPressed: { + if (currentIndex == 0) { + searchTextField.forceActiveFocus(); + } else { + decrementCurrentIndex(); + } + } + delegate: ListItem { + text: model[suggestionTextRole] + highlighted: suggestionsListView.focus === true && suggestionsListView.currentIndex === index + function autoComplete() { + searchTextField.text = this.text; + searchTextField.forceActiveFocus(); + } + Keys.onReturnPressed: autoComplete(); + onClicked: autoComplete(); + icon.source: FluidControls.Utils.iconUrl("action/search") + } + } +} diff --git a/src/imports/controls/Showable.qml b/src/imports/controls/Showable.qml index c34d539c..eaf0056e 100644 --- a/src/imports/controls/Showable.qml +++ b/src/imports/controls/Showable.qml @@ -14,26 +14,8 @@ import QtQuick 2.10 -/*! - \qmltype Showable - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Showtable component. -*/ FocusScope { - /*! - \qmlproperty Animation showAnimation - - Animation to play to show the component. - */ property var showAnimation - - /*! - \qmlproperty Animation hideAnimation - - Animation to play to hide the component. - */ property var hideAnimation id: root @@ -54,11 +36,6 @@ FocusScope { } } - /*! - \qmlmethod void Showable::show() - - Show the component. - */ function show() { // Stop hide animation if it's still running if (hideAnimation != undefined && hideAnimation.running) @@ -72,11 +49,6 @@ FocusScope { showAnimation.restart(); } - /*! - \qmlmethod void Showable::hide() - - Hide the component. - */ function hide() { // Stop show animation if it's still running if (showAnimation != undefined && showAnimation.running) diff --git a/src/imports/controls/Sidebar.qml b/src/imports/controls/Sidebar.qml index 9df39b98..63cb33e8 100644 --- a/src/imports/controls/Sidebar.qml +++ b/src/imports/controls/Sidebar.qml @@ -18,37 +18,7 @@ import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 import Fluid.Controls 1.0 -/*! - \qmltype Sidebar - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - \brief A sidebar component for use in adaptive layouts - - To use, simply add an instance to your code, and anchor other components to it. - - To show or hide, set the expanded property. - - By default, the sidebar has a flickable built in, and whatever contents are added - will be placed in the flickable. When you want this disabled, or want to fill the - entire sidebar, set the autoFill property to false. - - Examples: - \code - Item { - property bool wideAspect: width > Units.gu(80) - - Sidebar { - expanded: wideAspect - - // Anchoring is automatic - } - } - \endcode - - For more information you can read the - \l{https://material.io/guidelines/patterns/navigation-drawer.html}{Material Design guidelines}. - */ Pane { id: sidebar @@ -57,24 +27,9 @@ Pane { */ default property alias contents: contents.data - /*! - The text displayed for the action. - */ property int edge: Qt.LeftEdge - - /*! - Show or hide the sidebar. - */ property bool expanded: true - - /*! - Flick automatically. - */ property bool autoFlick: true - - /*! - The text displayed as header. - */ property alias header: headerItem.text Behavior on anchors.leftMargin { diff --git a/src/imports/controls/SmoothFadeImage.qml b/src/imports/controls/SmoothFadeImage.qml index ac9b979a..691ae24b 100644 --- a/src/imports/controls/SmoothFadeImage.qml +++ b/src/imports/controls/SmoothFadeImage.qml @@ -14,181 +14,18 @@ import QtQuick 2.10 -/*! - \qmltype SmoothFadeImage - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Displays an image and smoothly fade when the source is changed. - - This component can be used in place of an Image when a smooth fade animation - between two sources is needed. - - When the source is changed and the fade animation ends, the image loaded before - is unloaded; this means that only one image at a time is loaded. - - Images are loaded asynchronously and are not cache, so unlike the Image - component the \c asynchronous and \c cache properties are not available. - - Example of usage: - \code - import QtQuick 2.10 - import Fluid.Controls 1.0 - - Item { - width: 128 - height: 128 - - SmoothFadeImage { - anchors.fill: parent - source: "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Qt_logo_2015.svg/1380px-Qt_logo_2015.svg.png" - fillMode: Image.PreserveAspectFit - smooth: true - fadeDuration: 400 - - MouseArea { - anchors.fill: parent - onClicked: parent.source = "https://upload.wikimedia.org/wikipedia/commons/thumb/0/0b/Qt_logo_2016.svg/1280px-Qt_logo_2016.svg.png" - } - } - } - \endcode -*/ Item { id: root - /*! - The image being displayed. - SmoothFadeImage can handle any image format supported by Qt, loaded - from any URL scheme supported by Qt. - - \sa Image::source - */ property url source - - /*! - \qmlproperty enumeration fillMode - - Set this property to define what happens when the source image has a - different size than the item. - - \list - \li Image.Stretch - the image is scaled to fit (default) - \li Image.PreserveAspectFit - the image is scaled uniformly to fit without cropping - \li Image.PreserveAspectCrop - the image is scaled uniformly to fill, cropping if necessary - \li Image.Tile - the image is duplicated horizontally and vertically - \li Image.TileVertically - the image is stretched horizontally and tiled vertically - \li Image.TileHorizontally - the image is stretched vertically and tiled horizontally - \li Image.Pad - the image is not transformed - \endlist - - Defaults to \c Image.Stretch. - - Note that \c clip is false by default which means that the item might - paint outside its bounding rectangle even if the fillMode is set to PreserveAspectCrop. - */ - property int fillMode : Image.Stretch - - /*! - Set this to change the fade animation time (in milliseconds). - Default value is 250 ms. - */ + property int fillMode: Image.Stretch property int fadeDuration: 250 - - /*! - This property holds whether the fade animation is running or not. - */ readonly property bool running: animation.running - - /*! - Set this property to false to disable the fade animation. - If the animation is disable, SmoothFadeImage behaves like a normal Image. - - The fade animation is enabled by default. - */ property bool animationEnabled: true - - /*! - This property holds the actual width and height of the loaded image. - - Unlike the \c width and \c height properties, which scale the painting of the - image, this property sets the actual number of pixels stored for the - loaded image so that large images do not use more memory than necessary. - - For example, this ensures the image in memory is no larger than - 1024x1024 pixels, regardless of the SmoothFadeImage's width and height values: - - \code - Rectangle { - width: ... - height: ... - - Image { - anchors.fill: parent - source: "reallyBigImage.jpg" - sourceSize.width: 1024 - sourceSize.height: 1024 - } - } - \endcode - - If the image's actual size is larger than the sourceSize, the image is - scaled down. If only one dimension of the size is set to greater than 0, - the other dimension is set in proportion to preserve the source image's - aspect ratio. (The \c fillMode is independent of this.) - - If both the sourceSize.width and sourceSize.height are set the image - will be scaled down to fit within the specified size, maintaining the - image's aspect ratio. The actual size of the image after scaling is - available via \c Item::implicitWidth and \c Item::implicitHeight. - - If the source is an intrinsically scalable image (eg. SVG), this property - determines the size of the loaded image regardless of intrinsic size. - Avoid changing this property dynamically; rendering an SVG is slow compared - to an image. - - If the source is a non-scalable image (eg. JPEG), the loaded image will be - no greater than this property specifies. For some formats (currently only - JPEG), the whole image will never actually be loaded into memory. - - sourceSize can be cleared to the natural size of the image by setting - sourceSize to undefined. - - Note: Changing this property dynamically causes the image source to be - reloaded, potentially even from the network, if it is not in the disk cache. - */ property alias sourceSize: __priv.sourceSize - - /*! - \qmlproperty enumeration status - - This property holds the status of image loading. It can be one of: - - \list - \li Image.Null - no image has been set - \li Image.Ready - the image has been loaded - \li Image.Loading - the image is currently being loaded - \li Image.Error - an error occurred while loading the image - \endlist - */ readonly property int status: __priv.loadingImage ? __priv.loadingImage.status : Image.Null - - /*! - This property holds whether the image is smoothly filtered when scaled or - transformed. Smooth filtering gives better visual quality, but it may be - slower on some hardware. - - If the image is displayed at its natural size, this property has no - visual or performance effect. - - By default, this property is set to \c true. - */ property bool smooth: true - /*! - This signal is emitted when the swap between the old source and the new - one has happened. - */ signal imageSwapped() QtObject { diff --git a/src/imports/controls/SmoothFadeLoader.qml b/src/imports/controls/SmoothFadeLoader.qml index 1498c339..bd6fae48 100644 --- a/src/imports/controls/SmoothFadeLoader.qml +++ b/src/imports/controls/SmoothFadeLoader.qml @@ -14,58 +14,9 @@ import QtQuick 2.10 -/*! - \qmltype SmoothFadeLoader - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Displays an item and smoothly fade when the source is changed. - - This component loads an item with a Loader and smoothly fade to another item when - the source URL is changed. - - Items are loaded synchronously, also the item being hidden is not unloaded to - avoid an unpleasant "flash" after the transition. - - Example of usage: - \code - import QtQuick 2.10 - import Fluid.Controls 1.0 - - Item { - width: 640 - height: 480 - - SmoothFadeLoader { - anchors.fill: parent - source: "MyComponent.qml" - fadeDuration: 400 - - MouseArea { - anchors.fill: parent - onClicked: parent.source = "AnotherComponent.qml" - } - } - } - \endcode -*/ Item { - /*! - The item being displayed. - - \sa Loader::source - */ property url source - - /*! - Set this to change the fade animation time (in milliseconds). - Default value is 250 ms. - */ property int fadeDuration: 250 - - /*! - This property holds whether the fade animation is running or not. - */ readonly property bool running: animation.running id: root diff --git a/src/imports/controls/SnackBar.qml b/src/imports/controls/SnackBar.qml index a442809e..be4e8505 100644 --- a/src/imports/controls/SnackBar.qml +++ b/src/imports/controls/SnackBar.qml @@ -19,205 +19,117 @@ import QtQuick.Controls.Material 2.3 import Fluid.Core 1.0 as FluidCore import Fluid.Effects 1.0 as FluidEffects -/*! - \qmltype SnackBar - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief SnackBar provides a brief feedback about an operation. - - \code - Page { - title: qsTr("Send a message") - - Button { - anchors.centerIn: parent - text: qsTr("Send Message") - onClicked: snackBar.open(qsTr("Message sent")) - } - - SnackBar { - id: snackBar - } - } - \endcode - - SnackBar provides a brief feedback about an operation through a - message at the bottom of the screen. - - It contains a single line of text directly related to the operation performed. - There can be a text action, but no icons. - - For more information you can read the - \l{https://material.io/guidelines/components/snackbars-toasts.html}{Material Design guidelines}. -*/ -Rectangle { - id: control - - /*! - \qmlproperty bool opened - - Whether the snack bar is currently open or not. - */ - readonly property bool opened: d.opened - - /*! - \qmlproperty int duration - - Amount of time (in ms) to keep the notification visible. - The default is 2s. - */ - property int duration: 2000 - - /*! - \qmlproperty bool fullWidth +Item { + id: snackBar - Whether the bar should take full screen width. - The default depends on the device: full width only on phones and tablets. - */ - property bool fullWidth: FluidCore.Device.type === FluidCore.Device.phone || FluidCore.Device.type === FluidCore.Device.phablet - - /*! - \qmlsignal clicked() + readonly property bool opened: popup.visible + property int duration: 2000 + property bool fullWidth: FluidCore.Device.formFactor === FluidCore.Device.Phone || FluidCore.Device.formFactor === FluidCore.Device.Phablet - This signal is emitted when the button is clicked. - The handler is \c onClicked. - */ signal clicked() - /*! - \qmlmethod void SnackBar::open(string text, string buttonText = "") - - Open the bar with the specified \a text and \a buttonText. - */ function open(text, buttonText) { snackText.text = text; snackButton.text = buttonText; snackButton.visible = buttonText !== ""; - d.opened = true; - timer.restart(); + popup.open(); } - /*! - \qmlmethod void SnackBar::close() - - Close the bar. - */ function close() { - d.opened = false; + popup.close(); } - states: [ - State { - name: "fullWidth" - when: fullWidth - - AnchorChanges { - target: control - anchors.left: parent.left - anchors.right: parent.right - } - }, - State { - name: "normalWidth" - when: !fullWidth - - PropertyChanges { - target: control - width: snackLayout.implicitWidth - } - AnchorChanges { - target: control - anchors.horizontalCenter: parent.horizontalCenter - } - } - ] + Timer { + id: timer - anchors.bottom: parent.bottom - anchors.bottomMargin: d.opened ? 0 : -control.height + interval: snackBar.duration + running: popup.visible - Behavior on anchors.bottomMargin { - NumberAnimation { duration: 300 } + onTriggered: popup.close() } - radius: fullWidth ? 0 : 2 - color: Material.background - height: snackLayout.implicitHeight - z: 10000 + Popup { + id: popup - layer.enabled: !fullWidth - layer.effect: FluidEffects.Elevation { - elevation: 1 - } + Material.theme: Material.Dark - Material.theme: Material.Dark + modal: false + closePolicy: Popup.NoAutoClose - QtObject { - id: d + x: snackBar.fullWidth ? 0 : (snackBar.parent.width - width) / 2 - property bool opened: false - } + width: snackBar.fullWidth ? snackBar.parent.width : snackLayout.implicitWidth + height: snackLayout.implicitHeight - Timer { - id: timer + enter: Transition { + NumberAnimation { property: "y"; from: snackBar.parent.height; to: snackBar.parent.height - popup.height } + } - interval: control.duration + exit: Transition { + NumberAnimation { property: "y"; from: snackBar.parent.height - popup.height; to: snackBar.parent.height } + } - onTriggered: { - if (!running) - d.opened = false; + background: Rectangle { + radius: snackBar.fullWidth ? 0 : 2 + color: Material.background + + layer.enabled: !snackBar.fullWidth + layer.effect: FluidEffects.Elevation { + elevation: 1 + } } - } - MouseArea { - anchors.fill: parent - } + contentItem: Item { + implicitWidth: snackLayout.implicitWidth + implicitHeight: snackLayout.implicitHeight - RowLayout { - id: snackLayout + RowLayout { + id: snackLayout - anchors { - verticalCenter: parent.verticalCenter - left: control.fullWidth ? parent.left : undefined - right: control.fullWidth ? parent.right : undefined - } + anchors { + verticalCenter: parent.verticalCenter + left: snackBar.fullWidth ? parent.left : undefined + right: snackBar.fullWidth ? parent.right : undefined + } - spacing: 0 + spacing: 0 - Item { - width: 24 - } + Item { + width: 24 + } - Label { - id: snackText + Label { + id: snackText - verticalAlignment: Text.AlignVCenter - maximumLineCount: 2 - wrapMode: Text.Wrap - elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter + maximumLineCount: 2 + wrapMode: Text.Wrap + elide: Text.ElideRight - Layout.fillWidth: true - Layout.minimumWidth: control.fullWidth ? -1 : 288 - Layout.maximumWidth: control.fullWidth ? -1 : 568 - Layout.preferredHeight: lineCount == 2 ? 80 : 48 - } + Layout.fillWidth: true + Layout.minimumWidth: snackBar.fullWidth ? -1 : 288 + Layout.maximumWidth: snackBar.fullWidth ? -1 : 568 + Layout.preferredHeight: lineCount == 2 ? 80 : 48 + } - Item { - id: middleSpacer - width: snackButton.text == "" ? 0 : (control.fullWidth ? 24 : 48) - } + Item { + id: middleSpacer + width: snackButton.text == "" ? 0 : (snackBar.fullWidth ? 24 : 48) + } - Button { - id: snackButton + Button { + id: snackButton - flat: true - onClicked: control.clicked() + flat: true + onClicked: snackBar.clicked() - Material.foreground: Material.accentColor - } + Material.foreground: Material.accentColor + } - Item { - width: 24 + Item { + width: 24 + } + } } } } diff --git a/src/imports/controls/Subheader.qml b/src/imports/controls/Subheader.qml index ac8578e2..7216b698 100644 --- a/src/imports/controls/Subheader.qml +++ b/src/imports/controls/Subheader.qml @@ -18,24 +18,9 @@ import QtQuick.Layouts 1.3 import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 -/*! - \qmltype Subheader - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Subheaders are special list tiles that delineate distinct sections of a list or grid list. - - For more information you can read the - \l{https://material.io/guidelines/components/subheaders.html}{Material Design guidelines}. - */ ItemDelegate { id: listItem - /*! - \qmlproperty color textColor - - Text color. - */ property alias textColor: label.color width: parent ? parent.width : undefined diff --git a/src/imports/controls/SubheadingLabel.qml b/src/imports/controls/SubheadingLabel.qml index 0abd830e..dcc4a8ca 100644 --- a/src/imports/controls/SubheadingLabel.qml +++ b/src/imports/controls/SubheadingLabel.qml @@ -16,31 +16,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import Fluid.Core 1.0 as FluidCore -/*! - \qmltype SubheadingLabel - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Text label with standard font and styling suitable to subheading. - - Text label for the Material Design subheading text style. - - \snippet fluidcontrols-subheadinglabel.qml file - - For more information you can read the - \l{https://material.io/guidelines/style/typography.html}{Material Design guidelines}. -*/ Label { - /*! - \qmlproperty int level - - This property holds the label level that controls - font style and size. - - Only values between 1 and 4 are allowed. - - Default value is 1. - */ property int level: 1 font.pixelSize: FluidCore.Device.isMobile ? 16 : 15 diff --git a/src/imports/controls/Tab.qml b/src/imports/controls/Tab.qml index 24cfd0d8..d355a066 100644 --- a/src/imports/controls/Tab.qml +++ b/src/imports/controls/Tab.qml @@ -15,21 +15,10 @@ import QtQuick 2.10 -/*! - \qmltype Tab - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - \brief Tab for tabbed pages. - - Tab of a \l TabbedPage. - */ Item { id: tab - /*! - This property holds the tab icon information. - */ property QtObject icon: QtObject { property string name property url source @@ -37,14 +26,6 @@ Item { property int height: 24 property color color: "transparent" } - - /*! - The title of this tab. - */ property string title - - /*! - Controls whether a close button will be shown for this tab. - */ property bool canRemove: false } diff --git a/src/imports/controls/TabbedPage.qml b/src/imports/controls/TabbedPage.qml index 01e61813..a9f6d5f8 100644 --- a/src/imports/controls/TabbedPage.qml +++ b/src/imports/controls/TabbedPage.qml @@ -20,86 +20,18 @@ import QtQuick.Controls.impl 2.3 import QtQuick.Controls.Material 2.3 import Fluid.Controls 1.0 as FluidControls -/*! - \qmltype TabbedPage - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Page with tabs. - - \qml - import QtQuick 2.10 - import Fluid.Controls 1.0 as FluidControls - - FluidControls.ApplicationWindow { - title: "Application Name" - width: 1024 - height: 800 - visible: true - - initialPage: FluidControls.TabbedPage { - FluidControls.Tab { - title: "Tab 1" - - Label { - anchors.centerIn: parent - text: "Hello World!" - } - } - - FluidControls.Tab { - title: "Tab 2" - - Label { - anchors.centerIn: parent - text: "Hello World!" - } - } - } - } - \endqml - */ FluidControls.Page { id: page /*! \internal - */ - default property alias contents: swipeView.contentChildren - - /*! - \qmlproperty int count - - Number of tabs. */ - readonly property alias count: swipeView.count + default property alias contents: swipeView.contentData - /*! - \qmlproperty int currentIndex - - Index of the currently selected tab. - */ + readonly property alias count: swipeView.count readonly property alias currentIndex: swipeView.currentIndex - - /*! - \qmlproperty Item selectedTab - - The currently selected tab. - */ readonly property alias selectedTab: swipeView.currentItem - - /*! - \qmlproperty ToolBar tabBar - - Tool bar that contains tabs. - */ readonly property alias tabBar: tabToolBar - - /*! - \qmlproperty TabBar tabs - - Tab bar. - */ readonly property alias tabs: tabBar appBar.elevation: 0 diff --git a/src/imports/controls/ThinDivider.qml b/src/imports/controls/ThinDivider.qml index 182b8cca..c2ae2a5b 100644 --- a/src/imports/controls/ThinDivider.qml +++ b/src/imports/controls/ThinDivider.qml @@ -15,13 +15,6 @@ import QtQuick 2.10 import QtQuick.Controls.Material 2.3 -/*! - \qmltype ThinDivider - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief A 1px high divider for use in lists and other columns of content. - */ Rectangle { color: Material.dividerColor width: parent.width diff --git a/src/imports/controls/TimePickerDialog.qml b/src/imports/controls/TimePickerDialog.qml index de490771..1bbe318d 100644 --- a/src/imports/controls/TimePickerDialog.qml +++ b/src/imports/controls/TimePickerDialog.qml @@ -17,84 +17,12 @@ import QtQuick.Controls 2.3 import QtQuick.Controls.Material 2.3 import Fluid.Controls 1.0 as FluidControls -/*! - \qmltype TimePickerDialog - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Dialog with a picker to select time - - A dialog that lets you selected time. - - \code - import QtQuick 2.10 - import Fluid.Controls 1.0 as FluidControls - - Item { - width: 600 - height: 600 - - FluidControls.TimePickerDialog { - onAccepted: { - console.log(selectedDate); - } - standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel - } - } - \endcode - - For more information you can read the - \l{https://material.io/guidelines/components/pickers.html}{Material Design guidelines}. -*/ Dialog { id: dialog - /*! - \qmlproperty enumeration Fluid.Controls::TimePickerDialog::orientation - - This property holds the picker orientation. - The default value is automatically selected based on the device orientation. - - Possible values: - \value TimePicker.Landscape The picker is landscape. - \value TimePicker.Portrait The picker is portrait. - */ property alias orientation: timePicker.orientation - - /*! - \qmlproperty bool Fluid.Controls::TimePickerDialog::prefer24Hour - - This property determines the visibility of the AM/PM switch. - */ property alias prefer24Hour: timePicker.prefer24Hour - - /*! - \qmlproperty date Fluid.Controls::TimePickerDialog::selectedTime - - This property holds the time that has been selected by the user. - The default value is the current time. - */ property alias selectedTime: timePicker.selectedTime - - /*! - \qmlproperty list Fluid.Controls::TimePickerDialog::standardButtonsContainer - - This property allows you to place additional buttons alongside the standard buttons - of the dialog, like in this example: - - \code - FluidControls.TimePickerDialog { - id: timePickerDialog - standardButtons: DialogButtonBox.Ok | DialogButtonBox.Cancel - standardButtonsContainer: Button { - anchors.verticalCenter: parent.verticalCenter - text: qsTr("Now") - flat: true - onClicked: timePickerDialog.selectedTime = new Date() - } - } - \endcode - */ property alias standardButtonsContainer: buttonBox.data x: (parent.width - width) / 2 diff --git a/src/imports/controls/TitleLabel.qml b/src/imports/controls/TitleLabel.qml index afdcde87..cb899b65 100644 --- a/src/imports/controls/TitleLabel.qml +++ b/src/imports/controls/TitleLabel.qml @@ -15,20 +15,6 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -/*! - \qmltype TitleLabel - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Text label with standard font and styling suitable to titles. - - Text label for the Material Design title text style. - - \snippet fluidcontrols-titlelabel.qml file - - For more information you can read the - \l{https://material.io/guidelines/style/typography.html}{Material Design guidelines}. -*/ Label { font.pixelSize: 20 font.weight: Font.Medium diff --git a/src/imports/controls/ToolButton.qml b/src/imports/controls/ToolButton.qml index df96e054..745ecb13 100644 --- a/src/imports/controls/ToolButton.qml +++ b/src/imports/controls/ToolButton.qml @@ -16,22 +16,9 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 as QQC2 import QtQuick.Controls.impl 2.3 as QQCImpl2 -/*! - \qmltype ToolButton - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief \l ToolButton with a extra features. -*/ QQC2.ToolButton { id: control - /*! - \qmlproperty bool hoverAnimation - - Specify whether the icon should be rotated 90 degrees when the mouse hovers. - Default is \c false. - */ property bool hoverAnimation: false contentItem: QQCImpl2.IconLabel { diff --git a/src/imports/controls/Units.qml b/src/imports/controls/Units.qml index 624d4de9..3388eb93 100644 --- a/src/imports/controls/Units.qml +++ b/src/imports/controls/Units.qml @@ -17,72 +17,17 @@ pragma Singleton import QtQuick 2.10 import Fluid.Core 1.0 -/*! - \qmltype Units - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Units. -*/ Item { - /*! - \qmlproperty int gridUnit - - Fundamental unit of space for sizes depending on the current font. - It correspond to the capital letter M width in pixel. - */ readonly property int gridUnit: textMetrics.height - /*! - \qmlproperty real smallSpacing - - The amount of spacing that should be used around smaller UI - elements. It can be used as margin around button box and - spacing between buttons. - */ readonly property real smallSpacing: 8 - - /*! - \qmlproperty real mediumSpacing - - The amount of spacing that should be used inside medium UI - elements such as padding between title and body text in a dialog box. - */ readonly property real mediumSpacing: 20 - - /*! - \qmlproperty real largeSpacing - - The amount of spacing that should be used inside bigger UI - elements such as padding in a dialog box. - */ readonly property real largeSpacing: 24 - /*! - \qmlproperty int shortDuration - - Duration for short animations to make UI events noticeable. - */ readonly property int shortDuration: 100 - - /*! - \qmlproperty int mediumDuration - - Duration for medium length animations. - */ readonly property int mediumDuration: 200 - - /*! - \qmlproperty int longDuration - - Duration for long animations such as windows opening or closing. - */ readonly property int longDuration: 400 - /*! - \qmlproperty object iconSizes - Standard icon sizes. - */ readonly property QtObject iconSizes: QtObject { readonly property int tiny: 8 readonly property int small: 16 @@ -98,20 +43,10 @@ Item { text: "M" } - /*! - \qmlmethod int Units::gu(real size) - - Returns a round size in pixels multiplied by grid unit. - */ function gu(x) { return Math.round(x * gridUnit); } - /*! - \qmlmethod int Units::roundToIconSize(real size) - - Returns the size in pixel closes to the icon size. - */ function roundToIconSize(x) { // Find the size closest to icon size if (x <= 0) diff --git a/src/imports/controls/Wave.qml b/src/imports/controls/Wave.qml index ba724f74..d7588532 100644 --- a/src/imports/controls/Wave.qml +++ b/src/imports/controls/Wave.qml @@ -16,67 +16,26 @@ import QtQuick 2.10 import QtGraphicalEffects 1.0 -/*! - \qmltype Wave - \inqmlmodule Fluid.Controls - \ingroup fluidcontrols - - \brief Provides a wave animation for transitioning between views of content. - - For more information you can read the - \l{https://material.io/guidelines/motion/material-motion.html#material-motion-how-does-material-move}{Material Design guidelines}. -*/ Item { id: wave - /*! - Whether wave is open. - */ property bool open: false - /*! - The current size of the wave - */ property real size: 0 - /*! - The horizontal center of the wave - */ property real initialX - /*! - The vertical center of the wave - */ property real initialY - /*! - The abstract width of the wave - */ property real abstractWidth: parent.width - /*! - The abstract height of the wave - */ property real abstractHeight: parent.height - /*! - The diameter of the completely open wave - */ property real diameter: 2 * Math.sqrt(Math.pow(Math.max(initialX, abstractWidth - initialX), 2) + Math.pow(Math.max(initialY, abstractHeight - initialY), 2)) - /*! - This signal is emitted, when the wave has finished opening or closing. - \a open defines, whether the wave was being opened or closed - */ signal finished(bool open) - /*! - Opens the wave centering the wave at (\a x, \a y) - */ function openWave(x, y) { wave.initialX = x || parent.width/2; wave.initialY = y || parent.height/2; wave.open = true; } - /*! - Closes the wave centering the wave at (\a x, \a y) - */ function closeWave(x, y) { wave.initialX = x || parent.width/2; wave.initialY = y || parent.height/2; diff --git a/src/imports/controls/controls.pro b/src/imports/controls/controls.pro index 043ba280..4b0f4901 100644 --- a/src/imports/controls/controls.pro +++ b/src/imports/controls/controls.pro @@ -1,6 +1,6 @@ TARGET = fluidcontrolsplugin TARGETPATH = Fluid/Controls -IMPORT_VERSION = 1.0 +IMPORT_VERSION = 1.1 QT += qml quick quickcontrols2 svg diff --git a/src/imports/controls/controls.qbs b/src/imports/controls/controls.qbs index 303a8c4f..bf7aa974 100644 --- a/src/imports/controls/controls.qbs +++ b/src/imports/controls/controls.qbs @@ -27,6 +27,8 @@ LiriQmlPlugin { Group { name: "QML" files: ["qmldir", "*.qml", "*.qmltypes"] + qbs.install: true + qbs.installDir: FileInfo.joinPaths(lirideployment.qmlDir, pluginPath) } Group { diff --git a/src/imports/controls/controlsplugin.cpp b/src/imports/controls/controlsplugin.cpp index 4b35c3d1..138a84e5 100644 --- a/src/imports/controls/controlsplugin.cpp +++ b/src/imports/controls/controlsplugin.cpp @@ -14,8 +14,8 @@ #include "color.h" #include "controlsplugin.h" +#include "controlsutils.h" #include "iconthemeimageprovider.h" -#include "utils.h" static QObject *colorProvider(QQmlEngine *engine, QJSEngine *jsEngine) { @@ -29,7 +29,7 @@ static QObject *utilsProvider(QQmlEngine *engine, QJSEngine *jsEngine) { Q_UNUSED(jsEngine); - return new Utils(engine->baseUrl()); + return new ControlsUtils(engine->baseUrl()); } void FluidControlsPlugin::initializeEngine(QQmlEngine *engine, const char *uri) @@ -48,5 +48,5 @@ void FluidControlsPlugin::registerTypes(const char *uri) Q_ASSERT(QLatin1String(uri) == QLatin1String("Fluid.Controls")); qmlRegisterSingletonType(uri, 1, 0, "Color", colorProvider); - qmlRegisterSingletonType(uri, 1, 0, "Utils", utilsProvider); + qmlRegisterSingletonType(uri, 1, 0, "Utils", utilsProvider); } diff --git a/src/imports/controls/utils.cpp b/src/imports/controls/controlsutils.cpp similarity index 85% rename from src/imports/controls/utils.cpp rename to src/imports/controls/controlsutils.cpp index f0b76367..ee410f9d 100644 --- a/src/imports/controls/utils.cpp +++ b/src/imports/controls/controlsutils.cpp @@ -12,7 +12,7 @@ * $END_LICENSE$ */ -#include "utils.h" +#include "controlsutils.h" /*! \qmltype Utils @@ -21,7 +21,7 @@ \brief A collection of helpful utility methods. */ -Utils::Utils(const QUrl &baseUrl, QObject *parent) +ControlsUtils::ControlsUtils(const QUrl &baseUrl, QObject *parent) : QObject(parent) , m_baseUrl(baseUrl) { @@ -35,6 +35,7 @@ Utils::Utils(const QUrl &baseUrl, QObject *parent) \code import QtQuick 2.10 + import Fluid.Controls 1.0 as FluidControls Image { source: FluidControls.Utils.iconUrl("action/alarm") @@ -46,6 +47,7 @@ Utils::Utils(const QUrl &baseUrl, QObject *parent) \code import QtQuick 2.10 import QtQuick.Controls 2.3 + import Fluid.Controls 1.0 as FluidControls Button { icon.source: FluidControls.Utils.iconUrl("action/alarm") @@ -53,7 +55,7 @@ Utils::Utils(const QUrl &baseUrl, QObject *parent) } \endcode */ -QUrl Utils::iconUrl(const QString &name) +QUrl ControlsUtils::iconUrl(const QString &name) { #if FLUID_INSTALL_ICONS == 1 return QUrl::fromLocalFile(QStringLiteral("%1/icons/%2.svg").arg(m_baseUrl.toLocalFile()).arg(name)); diff --git a/src/imports/controls/utils.h b/src/imports/controls/controlsutils.h similarity index 72% rename from src/imports/controls/utils.h rename to src/imports/controls/controlsutils.h index 9b0e0fa1..2d88d45d 100644 --- a/src/imports/controls/utils.h +++ b/src/imports/controls/controlsutils.h @@ -12,17 +12,17 @@ * $END_LICENSE$ */ -#ifndef FLUID_CONTROLS_UTILS_H -#define FLUID_CONTROLS_UTILS_H +#ifndef CONTROLSUTILS_H +#define CONTROLSUTILS_H #include #include -class Utils : public QObject +class ControlsUtils : public QObject { Q_OBJECT public: - explicit Utils(const QUrl &baseUrl, QObject *parent = nullptr); + explicit ControlsUtils(const QUrl &baseUrl, QObject *parent = nullptr); Q_INVOKABLE QUrl iconUrl(const QString &name); @@ -30,4 +30,4 @@ class Utils : public QObject QUrl m_baseUrl; }; -#endif // FLUID_CONTROLS_UTILS_H +#endif // CONTROLSUTILS_H diff --git a/src/imports/controls/plugins.qmltypes b/src/imports/controls/plugins.qmltypes index 79bd0931..fe20b2e3 100644 --- a/src/imports/controls/plugins.qmltypes +++ b/src/imports/controls/plugins.qmltypes @@ -4,7 +4,7 @@ import QtQuick.tooling 1.2 // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump -noinstantiate -notrelocatable Fluid.Controls 1.0' +// 'qmlplugindump-qt5 -v -noinstantiate -notrelocatable Fluid.Controls 1.1' Module { dependencies: [ @@ -170,14 +170,12 @@ Module { } Component { prototype: "QQuickRectangle" - name: "QtQuick.Controls.Fusion.impl/CheckIndicator 2.3" - exports: ["QtQuick.Controls.Fusion.impl/CheckIndicator 2.3"] - exportMetaObjectRevisions: [3] + name: "QtQuick.Controls.Material.impl/CheckIndicator 2.0" + exports: ["QtQuick.Controls.Material.impl/CheckIndicator 2.0"] + exportMetaObjectRevisions: [0] isComposite: true defaultProperty: "data" Property { name: "control"; type: "QQuickItem"; isPointer: true } - Property { name: "pressedColor"; type: "QColor"; isReadonly: true } - Property { name: "checkMarkColor"; type: "QColor"; isReadonly: true } } Component { prototype: "QQuickRectangle" @@ -191,12 +189,14 @@ Module { } Component { prototype: "QQuickRectangle" - name: "QtQuick.Controls.Material.impl/CheckIndicator 2.0" - exports: ["QtQuick.Controls.Material.impl/CheckIndicator 2.0"] - exportMetaObjectRevisions: [0] + name: "QtQuick.Controls.Fusion.impl/CheckIndicator 2.3" + exports: ["QtQuick.Controls.Fusion.impl/CheckIndicator 2.3"] + exportMetaObjectRevisions: [3] isComposite: true defaultProperty: "data" Property { name: "control"; type: "QQuickItem"; isPointer: true } + Property { name: "pressedColor"; type: "QColor"; isReadonly: true } + Property { name: "checkMarkColor"; type: "QColor"; isReadonly: true } } Component { prototype: "QQuickComboBox" @@ -415,21 +415,21 @@ Module { } Component { prototype: "QQuickRectangle" - name: "QtQuick.Controls.Material.impl/RadioIndicator 2.0" - exports: ["QtQuick.Controls.Material.impl/RadioIndicator 2.0"] + name: "QtQuick.Controls.Universal.impl/RadioIndicator 2.0" + exports: ["QtQuick.Controls.Universal.impl/RadioIndicator 2.0"] exportMetaObjectRevisions: [0] isComposite: true defaultProperty: "data" - Property { name: "control"; type: "QQuickItem"; isPointer: true } + Property { name: "control"; type: "QVariant" } } Component { prototype: "QQuickRectangle" - name: "QtQuick.Controls.Universal.impl/RadioIndicator 2.0" - exports: ["QtQuick.Controls.Universal.impl/RadioIndicator 2.0"] + name: "QtQuick.Controls.Material.impl/RadioIndicator 2.0" + exports: ["QtQuick.Controls.Material.impl/RadioIndicator 2.0"] exportMetaObjectRevisions: [0] isComposite: true defaultProperty: "data" - Property { name: "control"; type: "QVariant" } + Property { name: "control"; type: "QQuickItem"; isPointer: true } } Component { prototype: "QQuickRectangle" @@ -515,19 +515,6 @@ Module { Property { name: "progress"; type: "double" } Property { name: "visualProgress"; type: "double" } } - Component { - prototype: "QQuickRectangle" - name: "QtQuick.Controls.Fusion.impl/SliderHandle 2.3" - exports: ["QtQuick.Controls.Fusion.impl/SliderHandle 2.3"] - exportMetaObjectRevisions: [3] - isComposite: true - defaultProperty: "data" - Property { name: "palette"; type: "QVariant" } - Property { name: "pressed"; type: "bool" } - Property { name: "hovered"; type: "bool" } - Property { name: "vertical"; type: "bool" } - Property { name: "visualFocus"; type: "bool" } - } Component { prototype: "QQuickItem" name: "QtQuick.Controls.Material.impl/SliderHandle 2.0" @@ -542,6 +529,19 @@ Module { Property { name: "initialSize"; type: "int"; isReadonly: true } Property { name: "control"; type: "QVariant"; isReadonly: true } } + Component { + prototype: "QQuickRectangle" + name: "QtQuick.Controls.Fusion.impl/SliderHandle 2.3" + exports: ["QtQuick.Controls.Fusion.impl/SliderHandle 2.3"] + exportMetaObjectRevisions: [3] + isComposite: true + defaultProperty: "data" + Property { name: "palette"; type: "QVariant" } + Property { name: "pressed"; type: "bool" } + Property { name: "hovered"; type: "bool" } + Property { name: "vertical"; type: "bool" } + Property { name: "visualFocus"; type: "bool" } + } Component { prototype: "QQuickSpinBox" name: "QtQuick.Controls/SpinBox 2.0" @@ -599,6 +599,16 @@ Module { defaultProperty: "data" Property { name: "control"; type: "QQuickItem"; isPointer: true } } + Component { + prototype: "QQuickItem" + name: "QtQuick.Controls.Material.impl/SwitchIndicator 2.0" + exports: ["QtQuick.Controls.Material.impl/SwitchIndicator 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + Property { name: "control"; type: "QQuickItem"; isPointer: true } + Property { name: "handle"; type: "QQuickRectangle"; isReadonly: true; isPointer: true } + } Component { prototype: "QQuickRectangle" name: "QtQuick.Controls.Fusion.impl/SwitchIndicator 2.3" @@ -610,16 +620,6 @@ Module { Property { name: "pressedColor"; type: "QColor"; isReadonly: true } Property { name: "checkMarkColor"; type: "QColor"; isReadonly: true } } - Component { - prototype: "QQuickItem" - name: "QtQuick.Controls.Material.impl/SwitchIndicator 2.0" - exports: ["QtQuick.Controls.Material.impl/SwitchIndicator 2.0"] - exportMetaObjectRevisions: [0] - isComposite: true - defaultProperty: "data" - Property { name: "control"; type: "QQuickItem"; isPointer: true } - Property { name: "handle"; type: "QQuickRectangle"; isReadonly: true; isPointer: true } - } Component { prototype: "QQuickTabBar" name: "QtQuick.Controls/TabBar 2.0" diff --git a/src/imports/controls/qmldir b/src/imports/controls/qmldir index 656038f5..1f08659d 100644 --- a/src/imports/controls/qmldir +++ b/src/imports/controls/qmldir @@ -2,9 +2,10 @@ module Fluid.Controls plugin fluidcontrolsplugin classname FluidControlsPlugin depends QtQuick.Controls 2.0 -depends Fluid.Template 1.0 +depends Fluid.Templates 1.0 typeinfo plugins.qmltypes +# 1.0 AbstractCard 1.0 AbstractCard.qml Action 1.0 Action.qml AlertDialog 1.0 AlertDialog.qml @@ -55,3 +56,13 @@ TitleLabel 1.0 TitleLabel.qml ToolButton 1.0 ToolButton.qml singleton Units 1.0 Units.qml Wave 1.0 Wave.qml + +# 1.1 +ApplicationWindow 1.1 ApplicationWindow11.qml +AppToolBar 1.1 AppToolBar11.qml +AppBar 1.1 AppBar11.qml +Chip 1.1 Chip.qml +ContactChip 1.1 ContactChip.qml +Page 1.1 Page11.qml +PageSidebar 1.1 PageSidebar.qml +SearchBar 1.1 SearchBar11.qml diff --git a/src/imports/core/coreplugin.cpp b/src/imports/core/coreplugin.cpp index c5a32ef1..be93da5d 100644 --- a/src/imports/core/coreplugin.cpp +++ b/src/imports/core/coreplugin.cpp @@ -15,19 +15,19 @@ #include #include "coreplugin.h" +#include "coreutils.h" #include "clipboard.h" #include "device.h" #include "dateutils.h" #include "qqmlsortfilterproxymodel.h" #include "standardpaths.h" -#include "utils.h" static QObject *utilsProvider(QQmlEngine *engine, QJSEngine *jsEngine) { Q_UNUSED(engine); Q_UNUSED(jsEngine); - return new Utils(); + return new CoreUtils(); } @@ -69,5 +69,5 @@ void FluidCorePlugin::registerTypes(const char *uri) qmlRegisterSingletonType(uri, 1, 0, "DateUtils", dateUtilsProvider); qmlRegisterSingletonType(uri, 1, 0, "Device", deviceProvider); qmlRegisterSingletonType(uri, 1, 0, "StandardPaths", standardPathsProvider); - qmlRegisterSingletonType(uri, 1, 0, "Utils", utilsProvider); + qmlRegisterSingletonType(uri, 1, 0, "Utils", utilsProvider); } diff --git a/src/imports/core/utils.cpp b/src/imports/core/coreutils.cpp similarity index 76% rename from src/imports/core/utils.cpp rename to src/imports/core/coreutils.cpp index bf476c75..43613d52 100644 --- a/src/imports/core/utils.cpp +++ b/src/imports/core/coreutils.cpp @@ -12,7 +12,7 @@ * $END_LICENSE$ */ -#include "utils.h" +#include "coreutils.h" /*! \qmltype Utils @@ -21,17 +21,17 @@ \brief A collection of helpful utility methods. */ -Utils::Utils(QObject *parent) +CoreUtils::CoreUtils(QObject *parent) : QObject(parent) { } /*! - \qmlmethod real Fluid.Controls::Utils::scale(real percent, real start, real end) + \qmlmethod real Fluid.Core::Utils::scale(real percent, real start, real end) Scale \a percent in the range between \a start and \a end. */ -qreal Utils::scale(qreal percent, qreal start, qreal end) +qreal CoreUtils::scale(qreal percent, qreal start, qreal end) { return start + ((end - start) * (percent / 100)); } diff --git a/src/imports/core/utils.h b/src/imports/core/coreutils.h similarity index 77% rename from src/imports/core/utils.h rename to src/imports/core/coreutils.h index 48e9a1e9..29ac8df0 100644 --- a/src/imports/core/utils.h +++ b/src/imports/core/coreutils.h @@ -12,19 +12,19 @@ * $END_LICENSE$ */ -#ifndef UTILS_H -#define UTILS_H +#ifndef COREUTILS_H +#define COREUTILS_H #include #include -class Utils : public QObject +class CoreUtils : public QObject { Q_OBJECT public: - explicit Utils(QObject *parent = nullptr); + explicit CoreUtils(QObject *parent = nullptr); Q_INVOKABLE qreal scale(qreal percent, qreal start, qreal end); }; -#endif // UTILS_H +#endif // COREUTILS_H diff --git a/src/imports/core/plugins.qmltypes b/src/imports/core/plugins.qmltypes index 3e46b461..c9c1b26d 100644 --- a/src/imports/core/plugins.qmltypes +++ b/src/imports/core/plugins.qmltypes @@ -4,7 +4,7 @@ import QtQuick.tooling 1.2 // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump -noinstantiate -notrelocatable Fluid.Core 1.0' +// 'qmlplugindump-qt5 -v -noinstantiate -notrelocatable Fluid.Core 1.0' Module { dependencies: ["QtQuick 2.10"] diff --git a/src/imports/effects/plugins.qmltypes b/src/imports/effects/plugins.qmltypes index 1657ef12..03485dae 100644 --- a/src/imports/effects/plugins.qmltypes +++ b/src/imports/effects/plugins.qmltypes @@ -4,7 +4,7 @@ import QtQuick.tooling 1.2 // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump -noinstantiate -notrelocatable Fluid.Effects 1.0' +// 'qmlplugindump-qt5 -v -noinstantiate -notrelocatable Fluid.Effects 1.0' Module { dependencies: [ diff --git a/src/imports/layouts/plugins.qmltypes b/src/imports/layouts/plugins.qmltypes index 576bbe7a..e647bf3e 100644 --- a/src/imports/layouts/plugins.qmltypes +++ b/src/imports/layouts/plugins.qmltypes @@ -4,7 +4,7 @@ import QtQuick.tooling 1.2 // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump -noinstantiate -notrelocatable Fluid.Layouts 1.0' +// 'qmlplugindump-qt5 -v -noinstantiate -notrelocatable Fluid.Layouts 1.0' Module { dependencies: ["QtQuick 2.10"] diff --git a/src/imports/templates/Card.qml b/src/imports/templates/Card.qml index f83f8e8c..2d02412f 100644 --- a/src/imports/templates/Card.qml +++ b/src/imports/templates/Card.qml @@ -16,7 +16,7 @@ import QtQuick.Controls 2.3 as C import QtQuick.Controls.Material 2.3 /*! - \qmltype AbstractCard + \qmltype Card \inqmlmodule Fluid.Templates \ingroup fluidtemplates diff --git a/src/imports/templates/plugins.qmltypes b/src/imports/templates/plugins.qmltypes index 8bfdb43f..1f916a27 100644 --- a/src/imports/templates/plugins.qmltypes +++ b/src/imports/templates/plugins.qmltypes @@ -4,10 +4,25 @@ import QtQuick.tooling 1.2 // It is used for QML tooling purposes only. // // This file was auto-generated by: -// 'qmlplugindump -noinstantiate -notrelocatable Fluid.Templates 1.0' +// 'qmlplugindump-qt5 -v -noinstantiate -notrelocatable Fluid.Templates 1.0' Module { - dependencies: ["QtQuick 2.8"] + dependencies: [ + "QtGraphicalEffects 1.0", + "QtQuick 2.8", + "QtQuick.Controls 2.3", + "QtQuick.Controls.Fusion 2.3", + "QtQuick.Controls.Fusion.impl 2.3", + "QtQuick.Controls.Imagine 2.3", + "QtQuick.Controls.Imagine.impl 2.3", + "QtQuick.Controls.Material 2.3", + "QtQuick.Controls.Material.impl 2.3", + "QtQuick.Controls.Universal 2.3", + "QtQuick.Controls.Universal.impl 2.3", + "QtQuick.Controls.impl 2.3", + "QtQuick.Templates 2.3", + "QtQuick.Window 2.3" + ] Component { name: "DatePicker" defaultProperty: "data" @@ -158,4 +173,628 @@ Module { Property { name: "to"; type: "QDate" } Property { name: "selectedYear"; type: "int" } } + Component { + prototype: "QQuickAbstractButton" + name: "QtQuick.Controls/AbstractButton 2.0" + exports: ["QtQuick.Controls/AbstractButton 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickAction" + name: "QtQuick.Controls/Action 2.3" + exports: ["QtQuick.Controls/Action 2.3"] + exportMetaObjectRevisions: [3] + isComposite: true + } + Component { + prototype: "QQuickActionGroup" + name: "QtQuick.Controls/ActionGroup 2.3" + exports: ["QtQuick.Controls/ActionGroup 2.3"] + exportMetaObjectRevisions: [3] + isComposite: true + defaultProperty: "actions" + } + Component { + prototype: "QQuickApplicationWindow" + name: "QtQuick.Controls/ApplicationWindow 2.0" + exports: ["QtQuick.Controls/ApplicationWindow 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickItem" + name: "QtQuick.Controls.Material.impl/BoxShadow 2.0" + exports: ["QtQuick.Controls.Material.impl/BoxShadow 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + Property { name: "offsetX"; type: "int" } + Property { name: "offsetY"; type: "int" } + Property { name: "blurRadius"; type: "int" } + Property { name: "spreadRadius"; type: "int" } + Property { name: "source"; type: "QQuickItem"; isPointer: true } + Property { name: "fullWidth"; type: "bool" } + Property { name: "fullHeight"; type: "bool" } + Property { name: "glowRadius"; type: "double" } + Property { name: "spread"; type: "double" } + Property { name: "color"; type: "QColor" } + Property { name: "cornerRadius"; type: "double" } + Property { name: "cached"; type: "bool" } + } + Component { + prototype: "QQuickBusyIndicator" + name: "QtQuick.Controls/BusyIndicator 2.0" + exports: ["QtQuick.Controls/BusyIndicator 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickButton" + name: "QtQuick.Controls/Button 2.0" + exports: ["QtQuick.Controls/Button 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickButtonGroup" + name: "QtQuick.Controls/ButtonGroup 2.0" + exports: ["QtQuick.Controls/ButtonGroup 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + } + Component { + prototype: "QQuickRectangle" + name: "QtQuick.Controls.Fusion.impl/ButtonPanel 2.3" + exports: ["QtQuick.Controls.Fusion.impl/ButtonPanel 2.3"] + exportMetaObjectRevisions: [3] + isComposite: true + defaultProperty: "data" + Property { name: "control"; type: "QQuickItem"; isPointer: true } + Property { name: "highlighted"; type: "bool" } + } + Component { + prototype: "QQuickCheckBox" + name: "QtQuick.Controls/CheckBox 2.0" + exports: ["QtQuick.Controls/CheckBox 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickCheckDelegate" + name: "QtQuick.Controls/CheckDelegate 2.0" + exports: ["QtQuick.Controls/CheckDelegate 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickRectangle" + name: "QtQuick.Controls.Fusion.impl/CheckIndicator 2.3" + exports: ["QtQuick.Controls.Fusion.impl/CheckIndicator 2.3"] + exportMetaObjectRevisions: [3] + isComposite: true + defaultProperty: "data" + Property { name: "control"; type: "QQuickItem"; isPointer: true } + Property { name: "pressedColor"; type: "QColor"; isReadonly: true } + Property { name: "checkMarkColor"; type: "QColor"; isReadonly: true } + } + Component { + prototype: "QQuickRectangle" + name: "QtQuick.Controls.Universal.impl/CheckIndicator 2.0" + exports: ["QtQuick.Controls.Universal.impl/CheckIndicator 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + Property { name: "control"; type: "QQuickItem"; isPointer: true } + Property { name: "partiallyChecked"; type: "bool"; isReadonly: true } + } + Component { + prototype: "QQuickRectangle" + name: "QtQuick.Controls.Material.impl/CheckIndicator 2.0" + exports: ["QtQuick.Controls.Material.impl/CheckIndicator 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + Property { name: "control"; type: "QQuickItem"; isPointer: true } + } + Component { + prototype: "QQuickComboBox" + name: "QtQuick.Controls/ComboBox 2.0" + exports: ["QtQuick.Controls/ComboBox 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickContainer" + name: "QtQuick.Controls/Container 2.0" + exports: ["QtQuick.Controls/Container 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickControl" + name: "QtQuick.Controls/Control 2.0" + exports: ["QtQuick.Controls/Control 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickRectangle" + name: "QtQuick.Controls.Material.impl/CursorDelegate 2.0" + exports: ["QtQuick.Controls.Material.impl/CursorDelegate 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickDelayButton" + name: "QtQuick.Controls/DelayButton 2.2" + exports: ["QtQuick.Controls/DelayButton 2.2"] + exportMetaObjectRevisions: [2] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickDial" + name: "QtQuick.Controls/Dial 2.0" + exports: ["QtQuick.Controls/Dial 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickDialog" + name: "QtQuick.Controls/Dialog 2.1" + exports: ["QtQuick.Controls/Dialog 2.1"] + exportMetaObjectRevisions: [1] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickDialogButtonBox" + name: "QtQuick.Controls/DialogButtonBox 2.1" + exports: ["QtQuick.Controls/DialogButtonBox 2.1"] + exportMetaObjectRevisions: [1] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickDrawer" + name: "QtQuick.Controls/Drawer 2.0" + exports: ["QtQuick.Controls/Drawer 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickItem" + name: "QtQuick.Controls.Material.impl/ElevationEffect 2.0" + exports: ["QtQuick.Controls.Material.impl/ElevationEffect 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + Property { name: "source"; type: "QVariant" } + Property { name: "elevation"; type: "int" } + Property { name: "fullWidth"; type: "bool" } + Property { name: "fullHeight"; type: "bool" } + Property { name: "sourceItem"; type: "QQuickItem"; isReadonly: true; isPointer: true } + Property { name: "_shadows"; type: "QVariant"; isReadonly: true } + Property { name: "_shadow"; type: "QVariant"; isReadonly: true } + } + Component { + prototype: "QQuickFrame" + name: "QtQuick.Controls/Frame 2.0" + exports: ["QtQuick.Controls/Frame 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickGroupBox" + name: "QtQuick.Controls/GroupBox 2.0" + exports: ["QtQuick.Controls/GroupBox 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickItemDelegate" + name: "QtQuick.Controls/ItemDelegate 2.0" + exports: ["QtQuick.Controls/ItemDelegate 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickLabel" + name: "QtQuick.Controls/Label 2.0" + exports: ["QtQuick.Controls/Label 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickMenu" + name: "QtQuick.Controls/Menu 2.0" + exports: ["QtQuick.Controls/Menu 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickMenuBar" + name: "QtQuick.Controls/MenuBar 2.3" + exports: ["QtQuick.Controls/MenuBar 2.3"] + exportMetaObjectRevisions: [3] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickMenuBarItem" + name: "QtQuick.Controls/MenuBarItem 2.3" + exports: ["QtQuick.Controls/MenuBarItem 2.3"] + exportMetaObjectRevisions: [3] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickMenuItem" + name: "QtQuick.Controls/MenuItem 2.0" + exports: ["QtQuick.Controls/MenuItem 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickMenuSeparator" + name: "QtQuick.Controls/MenuSeparator 2.1" + exports: ["QtQuick.Controls/MenuSeparator 2.1"] + exportMetaObjectRevisions: [1] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickPage" + name: "QtQuick.Controls/Page 2.0" + exports: ["QtQuick.Controls/Page 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickPageIndicator" + name: "QtQuick.Controls/PageIndicator 2.0" + exports: ["QtQuick.Controls/PageIndicator 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickPane" + name: "QtQuick.Controls/Pane 2.0" + exports: ["QtQuick.Controls/Pane 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickPopup" + name: "QtQuick.Controls/Popup 2.0" + exports: ["QtQuick.Controls/Popup 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickProgressBar" + name: "QtQuick.Controls/ProgressBar 2.0" + exports: ["QtQuick.Controls/ProgressBar 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickRadioButton" + name: "QtQuick.Controls/RadioButton 2.0" + exports: ["QtQuick.Controls/RadioButton 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickRadioDelegate" + name: "QtQuick.Controls/RadioDelegate 2.0" + exports: ["QtQuick.Controls/RadioDelegate 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickRectangle" + name: "QtQuick.Controls.Universal.impl/RadioIndicator 2.0" + exports: ["QtQuick.Controls.Universal.impl/RadioIndicator 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + Property { name: "control"; type: "QVariant" } + } + Component { + prototype: "QQuickRectangle" + name: "QtQuick.Controls.Fusion.impl/RadioIndicator 2.3" + exports: ["QtQuick.Controls.Fusion.impl/RadioIndicator 2.3"] + exportMetaObjectRevisions: [3] + isComposite: true + defaultProperty: "data" + Property { name: "control"; type: "QQuickItem"; isPointer: true } + Property { name: "pressedColor"; type: "QColor"; isReadonly: true } + Property { name: "checkMarkColor"; type: "QColor"; isReadonly: true } + } + Component { + prototype: "QQuickRectangle" + name: "QtQuick.Controls.Material.impl/RadioIndicator 2.0" + exports: ["QtQuick.Controls.Material.impl/RadioIndicator 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + Property { name: "control"; type: "QQuickItem"; isPointer: true } + } + Component { + prototype: "QQuickRangeSlider" + name: "QtQuick.Controls/RangeSlider 2.0" + exports: ["QtQuick.Controls/RangeSlider 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickItem" + name: "QtQuick.Controls.Material.impl/RectangularGlow 2.0" + exports: ["QtQuick.Controls.Material.impl/RectangularGlow 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + Property { name: "glowRadius"; type: "double" } + Property { name: "spread"; type: "double" } + Property { name: "color"; type: "QColor" } + Property { name: "cornerRadius"; type: "double" } + Property { name: "cached"; type: "bool" } + } + Component { + prototype: "QQuickRoundButton" + name: "QtQuick.Controls/RoundButton 2.1" + exports: ["QtQuick.Controls/RoundButton 2.1"] + exportMetaObjectRevisions: [1] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickScrollBar" + name: "QtQuick.Controls/ScrollBar 2.0" + exports: ["QtQuick.Controls/ScrollBar 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickScrollIndicator" + name: "QtQuick.Controls/ScrollIndicator 2.0" + exports: ["QtQuick.Controls/ScrollIndicator 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickScrollView" + name: "QtQuick.Controls/ScrollView 2.2" + exports: ["QtQuick.Controls/ScrollView 2.2"] + exportMetaObjectRevisions: [2] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickSlider" + name: "QtQuick.Controls/Slider 2.0" + exports: ["QtQuick.Controls/Slider 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickRectangle" + name: "QtQuick.Controls.Fusion.impl/SliderGroove 2.3" + exports: ["QtQuick.Controls.Fusion.impl/SliderGroove 2.3"] + exportMetaObjectRevisions: [3] + isComposite: true + defaultProperty: "data" + Property { name: "control"; type: "QQuickItem"; isPointer: true } + Property { name: "offset"; type: "double" } + Property { name: "progress"; type: "double" } + Property { name: "visualProgress"; type: "double" } + } + Component { + prototype: "QQuickRectangle" + name: "QtQuick.Controls.Fusion.impl/SliderHandle 2.3" + exports: ["QtQuick.Controls.Fusion.impl/SliderHandle 2.3"] + exportMetaObjectRevisions: [3] + isComposite: true + defaultProperty: "data" + Property { name: "palette"; type: "QVariant" } + Property { name: "pressed"; type: "bool" } + Property { name: "hovered"; type: "bool" } + Property { name: "vertical"; type: "bool" } + Property { name: "visualFocus"; type: "bool" } + } + Component { + prototype: "QQuickItem" + name: "QtQuick.Controls.Material.impl/SliderHandle 2.0" + exports: ["QtQuick.Controls.Material.impl/SliderHandle 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + Property { name: "value"; type: "double" } + Property { name: "handleHasFocus"; type: "bool" } + Property { name: "handlePressed"; type: "bool" } + Property { name: "handleHovered"; type: "bool" } + Property { name: "initialSize"; type: "int"; isReadonly: true } + Property { name: "control"; type: "QVariant"; isReadonly: true } + } + Component { + prototype: "QQuickSpinBox" + name: "QtQuick.Controls/SpinBox 2.0" + exports: ["QtQuick.Controls/SpinBox 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickStackView" + name: "QtQuick.Controls/StackView 2.0" + exports: ["QtQuick.Controls/StackView 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickSwipeDelegate" + name: "QtQuick.Controls/SwipeDelegate 2.0" + exports: ["QtQuick.Controls/SwipeDelegate 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickSwipeView" + name: "QtQuick.Controls/SwipeView 2.0" + exports: ["QtQuick.Controls/SwipeView 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickSwitch" + name: "QtQuick.Controls/Switch 2.0" + exports: ["QtQuick.Controls/Switch 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickSwitchDelegate" + name: "QtQuick.Controls/SwitchDelegate 2.0" + exports: ["QtQuick.Controls/SwitchDelegate 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickItem" + name: "QtQuick.Controls.Universal.impl/SwitchIndicator 2.0" + exports: ["QtQuick.Controls.Universal.impl/SwitchIndicator 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + Property { name: "control"; type: "QQuickItem"; isPointer: true } + } + Component { + prototype: "QQuickItem" + name: "QtQuick.Controls.Material.impl/SwitchIndicator 2.0" + exports: ["QtQuick.Controls.Material.impl/SwitchIndicator 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + Property { name: "control"; type: "QQuickItem"; isPointer: true } + Property { name: "handle"; type: "QQuickRectangle"; isReadonly: true; isPointer: true } + } + Component { + prototype: "QQuickRectangle" + name: "QtQuick.Controls.Fusion.impl/SwitchIndicator 2.3" + exports: ["QtQuick.Controls.Fusion.impl/SwitchIndicator 2.3"] + exportMetaObjectRevisions: [3] + isComposite: true + defaultProperty: "data" + Property { name: "control"; type: "QQuickItem"; isPointer: true } + Property { name: "pressedColor"; type: "QColor"; isReadonly: true } + Property { name: "checkMarkColor"; type: "QColor"; isReadonly: true } + } + Component { + prototype: "QQuickTabBar" + name: "QtQuick.Controls/TabBar 2.0" + exports: ["QtQuick.Controls/TabBar 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickTabButton" + name: "QtQuick.Controls/TabButton 2.0" + exports: ["QtQuick.Controls/TabButton 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickTextArea" + name: "QtQuick.Controls/TextArea 2.0" + exports: ["QtQuick.Controls/TextArea 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickTextField" + name: "QtQuick.Controls/TextField 2.0" + exports: ["QtQuick.Controls/TextField 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickToolBar" + name: "QtQuick.Controls/ToolBar 2.0" + exports: ["QtQuick.Controls/ToolBar 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickToolButton" + name: "QtQuick.Controls/ToolButton 2.0" + exports: ["QtQuick.Controls/ToolButton 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickToolSeparator" + name: "QtQuick.Controls/ToolSeparator 2.1" + exports: ["QtQuick.Controls/ToolSeparator 2.1"] + exportMetaObjectRevisions: [1] + isComposite: true + defaultProperty: "data" + } + Component { + prototype: "QQuickToolTip" + name: "QtQuick.Controls/ToolTip 2.0" + exports: ["QtQuick.Controls/ToolTip 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "contentData" + } + Component { + prototype: "QQuickTumbler" + name: "QtQuick.Controls/Tumbler 2.0" + exports: ["QtQuick.Controls/Tumbler 2.0"] + exportMetaObjectRevisions: [0] + isComposite: true + defaultProperty: "data" + } } diff --git a/tests/auto/auto.qbs b/tests/auto/auto.qbs index 8dcb5deb..2373d4bf 100644 --- a/tests/auto/auto.qbs +++ b/tests/auto/auto.qbs @@ -3,7 +3,7 @@ import qbs.FileInfo Project { name: "Autotests" - condition: project.autotestEnabled && project.withQmlImports + condition: project.autotestEnabled && project.withQmlModules references: [ "controls/controls.qbs", diff --git a/tests/auto/controls/tst_listitem.qml b/tests/auto/controls/tst_listitem.qml index a77c0869..06c975dd 100644 --- a/tests/auto/controls/tst_listitem.qml +++ b/tests/auto/controls/tst_listitem.qml @@ -47,7 +47,7 @@ Item { id: listItemWithSubtext2 maximumLineCount: 3 - subText: "Random Text" + subText: "Random Text\nRandom Text\nRandom Text" } ListItem { @@ -55,7 +55,7 @@ Item { secondaryItem: Item { width: parent.width - height: 42 + height: 90 } } @@ -75,7 +75,7 @@ Item { text: "Random Text" rightItem: Item { width: parent.width - height: 69 + height: 70 } } } @@ -111,12 +111,12 @@ Item { } function test_implicit_height() { - compare(listItemWithSubtext1.implicitHeight, 72); - compare(listItemWithSubtext2.implicitHeight, 88); - compare(listItemWithSecondaryItem.implicitHeight, 58); + compare(listItemWithSubtext1.implicitHeight, 48); + compare(listItemWithSubtext2.implicitHeight, 60); + compare(listItemWithSecondaryItem.implicitHeight, 106); compare(listItemWithoutSecondaryItem.implicitHeight, 48); compare(listItemWithLeftItem.implicitHeight, 48); - compare(listItemWithRightItem.implicitHeight, 85); + compare(listItemWithRightItem.implicitHeight, 86); } } }