From 776a4b08088b74ddaf8ae0701a478b87302a9244 Mon Sep 17 00:00:00 2001 From: Joan CiberSheep Date: Sun, 5 Jan 2020 02:05:24 +0100 Subject: [PATCH] Doc fixes --- src/UbuntuToolkit/qquickclipboard.cpp | 2 +- src/UbuntuToolkit/sortfiltermodel.cpp | 99 ++++++++++--------- src/UbuntuToolkit/ucubuntushape.cpp | 7 +- .../Themes/Ambiance/1.3/CheckBoxStyle.qml | 1 + .../Ambiance/1.3/OptionSelectorStyle.qml | 1 + .../Themes/Ambiance/1.3/SwitchStyle.qml | 2 + 6 files changed, 62 insertions(+), 50 deletions(-) diff --git a/src/UbuntuToolkit/qquickclipboard.cpp b/src/UbuntuToolkit/qquickclipboard.cpp index b02d94062..5d4625a44 100644 --- a/src/UbuntuToolkit/qquickclipboard.cpp +++ b/src/UbuntuToolkit/qquickclipboard.cpp @@ -38,7 +38,7 @@ UT_NAMESPACE_BEGIN * * The clipboard data cannot be modified through the type returned by the data * property, for this a new instance of MimeData type must be used. This instance - * can be either a standalone MimeDala component or an object created using newData() + * can be either a standalone MimeData component or an object created using newData() * function. Remember that standalone MimeData types duplicate the clipboard data * which may cause extensive memory use. * diff --git a/src/UbuntuToolkit/sortfiltermodel.cpp b/src/UbuntuToolkit/sortfiltermodel.cpp index 3bf58bc2e..9c893dd99 100644 --- a/src/UbuntuToolkit/sortfiltermodel.cpp +++ b/src/UbuntuToolkit/sortfiltermodel.cpp @@ -36,58 +36,65 @@ UT_NAMESPACE_BEGIN * * Example usage: * \qml - * import QtQuick 2.4 - * import Ubuntu.Components 1.2 - * import Ubuntu.Components.ListItems 1.1 + * import QtQuick 2.9 + * import Ubuntu.Components 1.3 * * MainView { * width: units.gu(80) * height: units.gu(40) * * ListModel { - * id: movies - * ListElement { - * title: "Esign" - * producer: "Chris Larkee" - * } - * ListElement { - * title: "Elephants Dream" - * // lowercase b - * producer: "blender" - * } - * ListElement { - * title: "Big Buck Bunny" - * producer: "Blender" - * } - * } - * - * SortFilterModel { - * id: sortedMovies - * model: movies - * sort.property: "title" - * sort.order: Qt.DescendingOrder - * // case insensitive sorting - * sortCaseSensitivity: Qt.CaseInsensitive - * - * filter.property: "producer" - * // case insensitive matches - * filter.pattern: /blender/i - * } - * - * ListView { - * model: sortedMovies - * anchors.fill: parent - * - * delegate: Subtitled { - * text: title - * subText: producer - * } - * - * section.delegate: ListItem.Header { text: i18n.tr(section) } - * section.property: "title" - * section.criteria: ViewSection.FirstCharacter - * } - * } + * id: movies + * + * ListElement { + * title: "Esign" + * producer: "Chris Larkee" + * } + * + * ListElement { + * title: "Elephants Dream" + * producer: "Blender" + * } + * + * ListElement { + * title: "Big Buck Bunny" + * producer: "blender" + * } + * } + * + * SortFilterModel { + * id: sortedMovies + * model: movies + * + * sort { + * property: "title" + * order: Qt.DescendingOrder + * } + * + * filter { + * property: "producer" + * //Add i for case insensitive + * pattern: /Blender/i + * } + * } + * + * ListView { + * model: sortedMovies + * anchors.fill: parent + * delegate: ListItemLayout { + * title.text: model.title + * subtitle.text: model.producer + * } + * + * section { + * property: "title" + * criteria: ViewSection.FirstCharacter + * delegate: Text { + * text: i18n.tr(section) + * } + * } + * } + *} * \endqml * * Pay attention to the differences between the original model and the result: diff --git a/src/UbuntuToolkit/ucubuntushape.cpp b/src/UbuntuToolkit/ucubuntushape.cpp index 0ef20ca04..4e05f749a 100644 --- a/src/UbuntuToolkit/ucubuntushape.cpp +++ b/src/UbuntuToolkit/ucubuntushape.cpp @@ -366,7 +366,7 @@ UCUbuntuShape::UCUbuntuShape(QQuickItem* parent) , m_sourceTransform(1.0f, 1.0f, 0.0f, 0.0f) , m_relativeRadius(0) , m_radius(Small) - , m_aspect(Inset) + , m_aspect(DropShadow) , m_imageHorizontalAlignment(AlignHCenter) , m_imageVerticalAlignment(AlignVCenter) , m_backgroundMode(SolidColor) @@ -423,7 +423,7 @@ void UCUbuntuShape::setRadius(const QString& radius) /*! \qmlproperty enumeration UbuntuShape::aspect This property defines the graphical style of the UbuntuShape. The default value is \c - UbuntuShape.Inset. + UbuntuShape.DropShadow. \note Setting this disables support for the deprecated \l borderSource property. Use the UbuntuShapeOverlay item in order to provide the inset "pressed" aspect previously supported by @@ -432,6 +432,7 @@ void UCUbuntuShape::setRadius(const QString& radius) \list \li \b UbuntuShape.Flat - no effects applied \li \b UbuntuShape.Inset - inner shadow slightly moved downwards and bevelled bottom + \li \b UbuntuShape.DropShadow - outer non-blurred shadow slightly moved downwards \endlist */ void UCUbuntuShape::setAspect(Aspect aspect) @@ -857,7 +858,7 @@ void UCUbuntuShape::setBorderSource(const QString& borderSource) if (!(m_flags & AspectSet)) { quint8 aspect; if (borderSource.endsWith(QStringLiteral("radius_idle.sci"))) { - aspect = Inset; + aspect = DropShadow; } else if (borderSource.endsWith(QStringLiteral("radius_pressed.sci"))) { aspect = Pressed; } else { diff --git a/src/imports/Components/Themes/Ambiance/1.3/CheckBoxStyle.qml b/src/imports/Components/Themes/Ambiance/1.3/CheckBoxStyle.qml index 025a1f8fc..663c865b4 100644 --- a/src/imports/Components/Themes/Ambiance/1.3/CheckBoxStyle.qml +++ b/src/imports/Components/Themes/Ambiance/1.3/CheckBoxStyle.qml @@ -64,6 +64,7 @@ Item { UbuntuShape { id: background + aspect: UbuntuShape.Inset anchors { margins: checkBoxStyle.backgroundPadding } diff --git a/src/imports/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml b/src/imports/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml index d004ce03d..b9cf6080d 100644 --- a/src/imports/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml +++ b/src/imports/Components/Themes/Ambiance/1.3/OptionSelectorStyle.qml @@ -29,6 +29,7 @@ Item { UbuntuShape { id: background + aspect: UbuntuShape.Inset width: styledItem.width height: styledItem.height diff --git a/src/imports/Components/Themes/Ambiance/1.3/SwitchStyle.qml b/src/imports/Components/Themes/Ambiance/1.3/SwitchStyle.qml index 641dc6124..3074c67f4 100644 --- a/src/imports/Components/Themes/Ambiance/1.3/SwitchStyle.qml +++ b/src/imports/Components/Themes/Ambiance/1.3/SwitchStyle.qml @@ -49,12 +49,14 @@ Item { UbuntuShape { id: background + aspect: UbuntuShape.Inset anchors.fill: parent backgroundColor: switchStyle.backgroundColor clip: true UbuntuShape { id: thumb + aspect: UbuntuShape.Inset states: [ State { name: "checked"