Merge lp:~zsombi/ubuntu-ui-toolkit/separate-uitk-versions into lp:ubuntu-ui-toolkit/staging

Proposed by Zsombor Egri
Status: Merged
Merged at revision: 1501
Proposed branch: lp:~zsombi/ubuntu-ui-toolkit/separate-uitk-versions
Merge into: lp:ubuntu-ui-toolkit/staging
Prerequisite: lp:~zsombi/ubuntu-ui-toolkit/fix-import-versions
Diff against target: 21182 lines (+18252/-1101)
194 files modified
components.api (+918/-365)
debian/qtdeclarative5-ubuntu-ui-toolkit-plugin.install (+15/-10)
documentation/ubuntu-theming.qdoc (+1/-1)
documentation/ubuntu-ui-toolkit-common.qdocconf (+7/-1)
examples/1.3/1.3.pro (+0/-10)
examples/examples.pro (+7/-20)
examples/locale/locale.qml (+1/-1)
examples/ubuntu-ui-toolkit-gallery/Buttons.qml (+1/-1)
examples/ubuntu-ui-toolkit-gallery/Dialog.qml (+1/-1)
examples/ubuntu-ui-toolkit-gallery/Icons.qml (+2/-2)
examples/ubuntu-ui-toolkit-gallery/ListItems.qml (+1/-1)
examples/ubuntu-ui-toolkit-gallery/Pickers.qml (+12/-1)
examples/ubuntu-ui-toolkit-gallery/Popover.qml (+1/-1)
examples/ubuntu-ui-toolkit-gallery/Sheet.qml (+1/-1)
examples/ubuntu-ui-toolkit-gallery/UbuntuListViews.qml (+1/-1)
examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.qml (+1/-1)
modules/Ubuntu/Components/1.0/1.0.pro (+2/-2)
modules/Ubuntu/Components/1.1/1.1.pro (+2/-2)
modules/Ubuntu/Components/1.1/Haptics.qml (+1/-1)
modules/Ubuntu/Components/1.2/1.2.pro (+15/-0)
modules/Ubuntu/Components/1.2/AbstractButton.qml (+109/-0)
modules/Ubuntu/Components/1.2/ActionItem.qml (+96/-0)
modules/Ubuntu/Components/1.2/ActionList.qml (+47/-0)
modules/Ubuntu/Components/1.2/ActivityIndicator.qml (+59/-0)
modules/Ubuntu/Components/1.2/AnimatedItem.qml (+37/-0)
modules/Ubuntu/Components/1.2/AppHeader.qml (+258/-0)
modules/Ubuntu/Components/1.2/Captions.qml (+150/-0)
modules/Ubuntu/Components/1.2/CheckBox.qml (+53/-0)
modules/Ubuntu/Components/1.2/ComboButton.qml (+367/-0)
modules/Ubuntu/Components/1.2/CrossFadeImage10.qml (+173/-0)
modules/Ubuntu/Components/1.2/CrossFadeImage11.qml (+192/-0)
modules/Ubuntu/Components/1.2/DraggingArea.qml (+114/-0)
modules/Ubuntu/Components/1.2/Header.qml (+39/-0)
modules/Ubuntu/Components/1.2/InputHandler.qml (+518/-0)
modules/Ubuntu/Components/1.2/Label.qml (+59/-0)
modules/Ubuntu/Components/1.2/MainView.qml (+1/-1)
modules/Ubuntu/Components/1.2/MainView12.qml (+163/-0)
modules/Ubuntu/Components/1.2/MainViewBase.qml (+83/-0)
modules/Ubuntu/Components/1.2/OptionSelector.qml (+297/-0)
modules/Ubuntu/Components/1.2/OptionSelectorDelegate.qml (+365/-0)
modules/Ubuntu/Components/1.2/OrientationHelper.qml (+205/-0)
modules/Ubuntu/Components/1.2/Page10.qml (+32/-5)
modules/Ubuntu/Components/1.2/Page11.qml (+2/-4)
modules/Ubuntu/Components/1.2/PageHeadConfiguration.qml (+207/-0)
modules/Ubuntu/Components/1.2/PageHeadSections.qml (+78/-0)
modules/Ubuntu/Components/1.2/PageHeadState.qml (+113/-0)
modules/Ubuntu/Components/1.2/PageStack.qml (+304/-0)
modules/Ubuntu/Components/1.2/PageTreeNode.qml (+158/-0)
modules/Ubuntu/Components/1.2/PageWrapper.qml (+99/-0)
modules/Ubuntu/Components/1.2/Panel.qml (+646/-0)
modules/Ubuntu/Components/1.2/ProgressBar10.qml (+68/-0)
modules/Ubuntu/Components/1.2/ProgressBar11.qml (+21/-0)
modules/Ubuntu/Components/1.2/PullToRefresh.qml (+242/-0)
modules/Ubuntu/Components/1.2/Scrollbar.qml (+150/-0)
modules/Ubuntu/Components/1.2/Slider.qml (+211/-0)
modules/Ubuntu/Components/1.2/Switch.qml (+44/-0)
modules/Ubuntu/Components/1.2/Tab.qml (+168/-0)
modules/Ubuntu/Components/1.2/TabBar.qml (+167/-0)
modules/Ubuntu/Components/1.2/Tabs.qml (+448/-0)
modules/Ubuntu/Components/1.2/TextArea.qml (+877/-0)
modules/Ubuntu/Components/1.2/TextCursor.qml (+318/-0)
modules/Ubuntu/Components/1.2/TextField.qml (+1023/-0)
modules/Ubuntu/Components/1.2/TextInputPopover.qml (+103/-0)
modules/Ubuntu/Components/1.2/Toolbar.qml (+147/-0)
modules/Ubuntu/Components/1.2/ToolbarButton.qml (+87/-0)
modules/Ubuntu/Components/1.2/ToolbarItems.qml (+224/-0)
modules/Ubuntu/Components/1.2/UbuntuListView.qml (+143/-0)
modules/Ubuntu/Components/1.2/UbuntuListView11.qml (+33/-0)
modules/Ubuntu/Components/1.2/UbuntuNumberAnimation.qml (+56/-0)
modules/Ubuntu/Components/1.3/1.3.pro (+15/-0)
modules/Ubuntu/Components/1.3/AppHeader.qml (+1/-1)
modules/Ubuntu/Components/1.3/Button.qml (+126/-0)
modules/Ubuntu/Components/1.3/ComboButton.qml (+3/-4)
modules/Ubuntu/Components/1.3/DraggingArea.qml (+1/-2)
modules/Ubuntu/Components/1.3/MainView.qml (+1/-1)
modules/Ubuntu/Components/1.3/OptionSelector.qml (+1/-1)
modules/Ubuntu/Components/1.3/OptionSelectorDelegate.qml (+1/-1)
modules/Ubuntu/Components/1.3/Page.qml (+1/-1)
modules/Ubuntu/Components/1.3/PageHeadConfiguration.qml (+32/-3)
modules/Ubuntu/Components/1.3/PageStack.qml (+2/-2)
modules/Ubuntu/Components/1.3/PageTreeNode.qml (+2/-2)
modules/Ubuntu/Components/1.3/PageWrapper.qml (+2/-2)
modules/Ubuntu/Components/1.3/ProgressBar.qml (+56/-2)
modules/Ubuntu/Components/1.3/PullToRefresh.qml (+3/-3)
modules/Ubuntu/Components/1.3/Slider.qml (+1/-2)
modules/Ubuntu/Components/1.3/Tab.qml (+1/-1)
modules/Ubuntu/Components/1.3/Tabs.qml (+3/-2)
modules/Ubuntu/Components/1.3/TextArea.qml (+2/-3)
modules/Ubuntu/Components/1.3/TextCursor.qml (+1/-1)
modules/Ubuntu/Components/1.3/TextField.qml (+2/-2)
modules/Ubuntu/Components/1.3/TextInputPopover.qml (+1/-1)
modules/Ubuntu/Components/1.3/ToolbarItems.qml (+1/-1)
modules/Ubuntu/Components/1.3/UbuntuColors.qml (+132/-0)
modules/Ubuntu/Components/1.3/UbuntuListView.qml (+1/-1)
modules/Ubuntu/Components/ComponentModule.pro (+1/-9)
modules/Ubuntu/Components/Components.pro (+4/-2)
modules/Ubuntu/Components/CrossFadeImage10.qml (+0/-173)
modules/Ubuntu/Components/ListItems/1.2/1.2.pro (+15/-0)
modules/Ubuntu/Components/ListItems/1.2/Base.qml (+183/-0)
modules/Ubuntu/Components/ListItems/1.2/Caption.qml (+59/-0)
modules/Ubuntu/Components/ListItems/1.2/Divider.qml (+36/-0)
modules/Ubuntu/Components/ListItems/1.2/Empty.qml (+486/-0)
modules/Ubuntu/Components/ListItems/1.2/Expandable.qml (+221/-0)
modules/Ubuntu/Components/ListItems/1.2/ExpandablesColumn.qml (+131/-0)
modules/Ubuntu/Components/ListItems/1.2/Header.qml (+77/-0)
modules/Ubuntu/Components/ListItems/1.2/IconVisual.qml (+58/-0)
modules/Ubuntu/Components/ListItems/1.2/ImageWithFallback.qml (+46/-0)
modules/Ubuntu/Components/ListItems/1.2/ItemSelector.qml (+286/-0)
modules/Ubuntu/Components/ListItems/1.2/LabelVisual.qml (+38/-0)
modules/Ubuntu/Components/ListItems/1.2/MultiValue.qml (+95/-0)
modules/Ubuntu/Components/ListItems/1.2/ProgressionVisual.qml (+29/-0)
modules/Ubuntu/Components/ListItems/1.2/SingleControl.qml (+79/-0)
modules/Ubuntu/Components/ListItems/1.2/SingleValue.qml (+81/-0)
modules/Ubuntu/Components/ListItems/1.2/Standard.qml (+304/-0)
modules/Ubuntu/Components/ListItems/1.2/Subtitled.qml (+112/-0)
modules/Ubuntu/Components/ListItems/1.2/ThinDivider.qml (+64/-0)
modules/Ubuntu/Components/ListItems/1.2/ValueSelector.qml (+297/-0)
modules/Ubuntu/Components/ListItems/1.3/1.3.pro (+15/-0)
modules/Ubuntu/Components/ListItems/1.3/Caption.qml (+1/-1)
modules/Ubuntu/Components/ListItems/1.3/Divider.qml (+1/-1)
modules/Ubuntu/Components/ListItems/1.3/Empty.qml (+2/-2)
modules/Ubuntu/Components/ListItems/1.3/Expandable.qml (+1/-1)
modules/Ubuntu/Components/ListItems/1.3/ExpandablesColumn.qml (+1/-1)
modules/Ubuntu/Components/ListItems/1.3/Header.qml (+1/-1)
modules/Ubuntu/Components/ListItems/1.3/ItemSelector.qml (+1/-1)
modules/Ubuntu/Components/ListItems/1.3/MultiValue.qml (+1/-1)
modules/Ubuntu/Components/ListItems/1.3/SingleControl.qml (+2/-2)
modules/Ubuntu/Components/ListItems/1.3/SingleValue.qml (+1/-1)
modules/Ubuntu/Components/ListItems/1.3/Standard.qml (+1/-1)
modules/Ubuntu/Components/ListItems/1.3/Subtitled.qml (+1/-1)
modules/Ubuntu/Components/ListItems/1.3/ThinDivider.qml (+1/-1)
modules/Ubuntu/Components/ListItems/1.3/ValueSelector.qml (+2/-2)
modules/Ubuntu/Components/ListItems/ListItems.pro (+5/-25)
modules/Ubuntu/Components/ListItems/ListItemsModule.pro (+13/-0)
modules/Ubuntu/Components/ListItems/qmldir (+48/-30)
modules/Ubuntu/Components/PageHeadConfiguration11.qml (+0/-55)
modules/Ubuntu/Components/Pickers/1.2/1.2.pro (+15/-0)
modules/Ubuntu/Components/Pickers/1.2/DatePicker.qml (+672/-0)
modules/Ubuntu/Components/Pickers/1.2/DayModel.qml (+86/-0)
modules/Ubuntu/Components/Pickers/1.2/Dialer.qml (+179/-0)
modules/Ubuntu/Components/Pickers/1.2/DialerHand.qml (+224/-0)
modules/Ubuntu/Components/Pickers/1.2/DialerHandGroup.qml (+29/-0)
modules/Ubuntu/Components/Pickers/1.2/HoursModel.qml (+63/-0)
modules/Ubuntu/Components/Pickers/1.2/MinutesModel.qml (+63/-0)
modules/Ubuntu/Components/Pickers/1.2/MonthModel.qml (+98/-0)
modules/Ubuntu/Components/Pickers/1.2/Picker.qml (+447/-0)
modules/Ubuntu/Components/Pickers/1.2/PickerDelegate.qml (+58/-0)
modules/Ubuntu/Components/Pickers/1.2/PickerModelBase.qml (+154/-0)
modules/Ubuntu/Components/Pickers/1.2/PickerPanel.qml (+267/-0)
modules/Ubuntu/Components/Pickers/1.2/PickerRow.qml (+137/-0)
modules/Ubuntu/Components/Pickers/1.2/SecondsModel.qml (+63/-0)
modules/Ubuntu/Components/Pickers/1.2/YearModel.qml (+69/-0)
modules/Ubuntu/Components/Pickers/1.3/1.3.pro (+15/-0)
modules/Ubuntu/Components/Pickers/1.3/PickerPanel.qml (+2/-2)
modules/Ubuntu/Components/Pickers/Pickers.pro (+5/-25)
modules/Ubuntu/Components/Pickers/PickersModule.pro (+14/-0)
modules/Ubuntu/Components/Pickers/qmldir (+21/-16)
modules/Ubuntu/Components/Popups/1.2/1.2.pro (+15/-0)
modules/Ubuntu/Components/Popups/1.2/ActionSelectionPopover.qml (+165/-0)
modules/Ubuntu/Components/Popups/1.2/ComposerSheet.qml (+97/-0)
modules/Ubuntu/Components/Popups/1.2/DefaultSheet.qml (+104/-0)
modules/Ubuntu/Components/Popups/1.2/Dialog.qml (+218/-0)
modules/Ubuntu/Components/Popups/1.2/Popover.qml (+300/-0)
modules/Ubuntu/Components/Popups/1.2/PopupBase.qml (+261/-0)
modules/Ubuntu/Components/Popups/1.2/SheetBase.qml (+113/-0)
modules/Ubuntu/Components/Popups/1.2/internalPopupUtils.js (+290/-0)
modules/Ubuntu/Components/Popups/1.3/1.3.pro (+15/-0)
modules/Ubuntu/Components/Popups/1.3/ActionSelectionPopover.qml (+1/-1)
modules/Ubuntu/Components/Popups/1.3/ComposerSheet.qml (+1/-1)
modules/Ubuntu/Components/Popups/1.3/DefaultSheet.qml (+1/-1)
modules/Ubuntu/Components/Popups/1.3/Dialog.qml (+1/-1)
modules/Ubuntu/Components/Popups/1.3/Popover.qml (+2/-2)
modules/Ubuntu/Components/Popups/1.3/internalPopupUtils.js (+5/-5)
modules/Ubuntu/Components/Popups/PopupModule.pro (+14/-0)
modules/Ubuntu/Components/Popups/Popups.pro (+5/-25)
modules/Ubuntu/Components/Popups/qmldir (+27/-17)
modules/Ubuntu/Components/ProgressBar10.qml (+0/-69)
modules/Ubuntu/Components/ProgressBar11.qdoc (+0/-6)
modules/Ubuntu/Components/Styles/1.2/1.2.pro (+11/-0)
modules/Ubuntu/Components/Styles/Styles.pro (+4/-25)
modules/Ubuntu/Components/Styles/StylesModule.pro (+25/-0)
modules/Ubuntu/Components/Styles/qmldir (+5/-3)
modules/Ubuntu/Components/Themes/Ambiance/1.3/DatePickerStyle.qml (+1/-1)
modules/Ubuntu/Components/Themes/Ambiance/1.3/OverflowPanel.qml (+2/-2)
modules/Ubuntu/Components/Themes/Ambiance/1.3/PageHeadStyle.qml (+3/-3)
modules/Ubuntu/Components/Themes/Ambiance/1.3/PickerStyle.qml (+1/-1)
modules/Ubuntu/Components/plugin/plugin.cpp (+9/-1)
modules/Ubuntu/Components/plugin/plugin.h (+1/-0)
modules/Ubuntu/Components/qmldir (+131/-103)
modules/Ubuntu/PerformanceMetrics/BarGraph.qml (+1/-1)
tests/autopilot/ubuntuuitoolkit/tests/gallery/__init__.py (+2/-3)
tests/unit/runtest.sh (+1/-1)
tests/unit_x11/tst_components/tst_header_contents_width.qml (+2/-2)
tests/unit_x11/tst_components/tst_pagestack.new_header.qml (+1/-1)
To merge this branch: bzr merge lp:~zsombi/ubuntu-ui-toolkit/separate-uitk-versions
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Cris Dywan Approve
Review via email: mp+257455@code.launchpad.net

Commit message

Separate 1.2 from 1.3 versions in all Ubuntu.Component modules.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) wrote :

dh_install: qtdeclarative5-ubuntu-ui-toolkit-plugin missing files (usr/lib/*/qt5/qml/Ubuntu/Components/ListItems/artwork), aborting

You moved modules/Ubuntu/Components/ListItems/artwork/ListItemDivider6px@8.png move to Comoponents/ but didn't update .install - by accident?

Remember, you can use "bzr bd" to spot this more quickly as you won't have to wait for J to finish if it's just packaging changes.

review: Needs Fixing
Revision history for this message
Cris Dywan (kalikiana) wrote :

examples/1.2/ubuntu-ui-toolkit-gallery/po/es.po

Do we really have to duplicate translations? It should be fine to share strings and translators will appreciate not having to go through an exponential increase in strings.

Revision history for this message
Zsombor Egri (zsombi) wrote :

> dh_install: qtdeclarative5-ubuntu-ui-toolkit-plugin missing files
> (usr/lib/*/qt5/qml/Ubuntu/Components/ListItems/artwork), aborting
>
> You moved modules/Ubuntu/Components/ListItems/artwork/ListItemDivider6px@8.png
> move to Comoponents/ but didn't update .install - by accident?
>
> Remember, you can use "bzr bd" to spot this more quickly as you won't have to
> wait for J to finish if it's just packaging changes.

I wish I could, I tried, it fails building even on a perfect branch :/

Revision history for this message
Zsombor Egri (zsombi) wrote :

> examples/1.2/ubuntu-ui-toolkit-gallery/po/es.po
>
> Do we really have to duplicate translations? It should be fine to share
> strings and translators will appreciate not having to go through an
> exponential increase in strings.

I have chosen the easiest way no, we can shape it if we want to later. We can share, of course, but we may also have to add more stuff to the newer releases, so why do share?

Also, the gallery needs to be redesigned from the grounds, so we use Layouts, etc. And that is better to do in a separate branch too.

Revision history for this message
Cris Dywan (kalikiana) wrote :

> > examples/1.2/ubuntu-ui-toolkit-gallery/po/es.po
> >
> > Do we really have to duplicate translations? It should be fine to share
> > strings and translators will appreciate not having to go through an
> > exponential increase in strings.
>
> I have chosen the easiest way no, we can shape it if we want to later. We can
> share, of course, but we may also have to add more stuff to the newer
> releases, so why do share?

That really depends on what we do with it. Will we maintain additions to each copy and run all AP tests against multiple versions for compatibility testing? How many varianrts will we have? Which one will app developers read when looking for example code?

In that sense, multiplying the amount of translatable strings is not my only concern, but the most obvious problem.

> Also, the gallery needs to be redesigned from the grounds, so we use Layouts,
> etc. And that is better to do in a separate branch too.

For that matter, I don't see why the gallery has to be duplicated in this step. We've had good arguments to do that before the version revamp and didn't do it. Again my main concern is doing this by the way with no clear plan.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) wrote :

The on-going outages in CI make me uneasy… other than that the branch looks good and I didn't spot any genuine failures.

review: Approve
Revision history for this message
Zoltan Balogh (bzoltan) wrote :

> The on-going outages in CI make me uneasy… other than that the branch looks
> good and I didn't spot any genuine failures.

Well :) The bz push is always at our disposal... but it would be nice to see a clean merge executed by Jenkins.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'components.api'
--- components.api 2015-04-29 05:08:32 +0000
+++ components.api 2015-05-06 10:32:32 +0000
@@ -1,3 +1,47 @@
1Button 0.1 1.0
2AbstractButton
3 property color color
4 property Gradient gradient
5 property font font
6 property string iconPosition
7UbuntuColors 0.1 1.0
8QtObject
9 readonly property color orange
10 readonly property color lightAubergine
11 readonly property color midAubergine
12 readonly property color darkAubergine
13 readonly property color warmGrey
14 readonly property color coolGrey
15 property Gradient orangeGradient
16 property Gradient greyGradient
17Button 1.1
18AbstractButton
19 property color strokeColor
20 property color color
21 property Gradient gradient
22 property font font
23 property string iconPosition
24Haptics 0.1 1.0
25Object
26 readonly property bool enabled
27 property HapticsEffect effect
28 function play(customEffect)
29UbuntuColors 1.1
30QtObject
31 readonly property color orange
32 readonly property color lightAubergine
33 readonly property color midAubergine
34 readonly property color darkAubergine
35 readonly property color warmGrey
36 readonly property color coolGrey
37 property Gradient orangeGradient
38 property Gradient greyGradient
39 readonly property color lightGrey
40 readonly property color darkGrey
41 readonly property color red
42 readonly property color green
43 readonly property color blue
44 readonly property color purple
1AbstractButton 0.1 1.045AbstractButton 0.1 1.0
2ActionItem46ActionItem
3 signal clicked()47 signal clicked()
@@ -21,19 +65,6 @@
21ActivityIndicator 0.1 1.065ActivityIndicator 0.1 1.0
22AnimatedItem66AnimatedItem
23 property bool running67 property bool running
24Button 0.1 1.0
25AbstractButton
26 property color color
27 property Gradient gradient
28 property font font
29 property string iconPosition
30Button 1.1
31AbstractButton
32 property color strokeColor
33 property color color
34 property Gradient gradient
35 property font font
36 property string iconPosition
37Captions 1.268Captions 1.2
38ColumnLayout69ColumnLayout
39 property int captionStyle70 property int captionStyle
@@ -43,7 +74,7 @@
43AbstractButton74AbstractButton
44 property bool checked75 property bool checked
45ComboButton 1.176ComboButton 1.1
46Button77Toolkit.Button
47 property bool expanded78 property bool expanded
48 property real collapsedHeight79 property real collapsedHeight
49 property real expandedHeight80 property real expandedHeight
@@ -67,11 +98,6 @@
67 property string fadeStyle98 property string fadeStyle
68 readonly property bool running99 readonly property bool running
69 readonly property int status100 readonly property int status
70Haptics 0.1 1.0
71Object
72 readonly property bool enabled
73 property HapticsEffect effect
74 function play(customEffect)
75Header 0.1 1.0101Header 0.1 1.0
76AppHeader102AppHeader
77 property string _for_autopilot103 property string _for_autopilot
@@ -86,115 +112,6 @@
86Label 0.1 1.0112Label 0.1 1.0
87Text113Text
88 property string fontSize114 property string fontSize
89Base 0.1 1.0
90Empty
91 property variant icon
92 property url fallbackIconSource
93 property string fallbackIconName
94 property bool progression
95 property bool iconFrame
96 property real __iconWidth
97 property real __iconHeight
98 property real __leftIconMargin
99 property real __rightIconMargin
100 property bool __iconIsItem
101 default property internal children
102Caption 0.1 1.0
103Item
104 property string text
105Divider 0.1 1.0
106Image
107Empty 0.1 1.0
108AbstractButton
109 property bool selected
110 property bool highlightWhenPressed
111 property bool removable
112 property bool confirmRemoval
113 readonly property string swipingState
114 readonly property bool waitingConfirmationForRemoval
115 signal itemRemoved
116 property int __height
117 property bool showDivider
118 default property internal children
119 property internal __contents
120 property list<Item> backgroundIndicator
121 property ThinDivider divider
122 property real __contentsMargins
123 function cancelItemRemoval()
124Expandable 0.1 1.0
125Empty
126 property bool expanded
127 property real collapsedHeight
128 property real expandedHeight
129 property bool collapseOnClick
130 default property QtObject children
131ExpandablesColumn 0.1 1.0
132Flickable
133 readonly property Item expandedItem
134 function expandItem(item)
135 function collapse()
136 default property QtObject children
137Header 0.1 1.0
138Item
139 property string text
140 property internal __foregroundColor
141ItemSelector 0.1 1.0
142ListItem.Empty
143 property var model
144 property bool expanded
145 property bool multiSelection
146 property bool colourImage
147 property Component delegate
148 property real containerHeight
149 property int selectedIndex
150 property bool currentlyExpanded
151 readonly property real itemHeight
152 signal delegateClicked(int index)
153 signal expansionCompleted()
154MultiValue 0.1 1.0
155Base
156 property variant values
157SingleControl 0.1 1.0
158Empty
159 property Item control
160 function __updateControl()
161SingleValue 0.1 1.0
162Base
163 property string value
164Standard 0.1 1.0
165Empty
166 property variant icon
167 property url fallbackIconSource
168 property string fallbackIconName
169 property bool progression
170 property real __iconWidth
171 property real __iconHeight
172 property real __leftIconMargin
173 property real __rightIconMargin
174 property Item control
175 property bool iconFrame
176 property bool __controlAreaPressed
177 property bool __iconIsItem
178 property internal __foregroundColor
179Subtitled 0.1 1.0
180Base
181 property string subText
182ThinDivider 0.1 1.0
183Rectangle
184 property bool __lightBackground
185ValueSelector 0.1 1.0
186Empty
187 property variant icon
188 property url fallbackIconSource
189 property string fallbackIconName
190 property real __iconWidth
191 property real __iconHeight
192 property real __leftIconMargin
193 property real __rightIconMargin
194 property bool iconFrame
195 property variant values
196 property int selectedIndex
197 property bool expanded
198MainView 0.1 1.0115MainView 0.1 1.0
199MainViewBase116MainViewBase
200 property bool automaticOrientation117 property bool automaticOrientation
@@ -248,11 +165,6 @@
248Page 1.1165Page 1.1
249Page10166Page10
250 readonly property PageHeadConfiguration head167 readonly property PageHeadConfiguration head
251Page 1.3
252PageTreeNode
253 property string title
254 property Flickable flickable
255 readonly property PageHeadConfiguration head
256PageHeadConfiguration 1.1168PageHeadConfiguration 1.1
257Object169Object
258 property list<Action> actions170 property list<Action> actions
@@ -261,10 +173,6 @@
261 property string preset173 property string preset
262 readonly property PageHeadSections sections174 readonly property PageHeadSections sections
263 property color foregroundColor175 property color foregroundColor
264PageHeadConfiguration 1.3
265Toolkit12.PageHeadConfiguration
266 property bool locked
267 property bool visible
268PageHeadSections 1.1176PageHeadSections 1.1
269QtObject177QtObject
270 property bool enabled178 property bool enabled
@@ -302,6 +210,770 @@
302 property bool __closeOnContentsClicks210 property bool __closeOnContentsClicks
303 property bool __openOnHover211 property bool __openOnHover
304 property bool pressed212 property bool pressed
213ProgressBar 0.1 1.0
214AnimatedItem
215 property bool indeterminate
216 property real minimumValue
217 property real maximumValue
218 property real value
219ProgressBar 1.1
220ProgressBar
221 property bool showProgressPercentage
222PullToRefresh 1.1
223StyledItem
224 readonly property bool releaseToRefresh
225 readonly property real offset
226 property Component content
227 property Flickable target
228 property bool refreshing
229 signal refresh()
230Scrollbar 0.1 1.0
231StyledItem
232 property Flickable flickableItem
233 property int align
234 property bool __interactive
235 property internal __private
236Slider 0.1 1.0
237StyledItem
238 property real minimumValue
239 property real maximumValue
240 property real value
241 property bool live
242 property bool pressed
243 signal touched(bool onThumb)
244 function formatValue(v)
245 property internal __internals
246Switch 0.1 1.0
247CheckBox
248Tab 0.1 1.0
249PageTreeNode
250 property string title
251 property url iconSource
252 property Item page
253 readonly property int index
254 property internal __protected
255TabBar 0.1 1.0
256StyledItem
257 property Item tabsItem
258 property var model
259 readonly property bool pressed
260 property bool selectionMode
261 property int selectedIndex
262 property bool alwaysSelectionMode
263 property bool animate
264Tabs 0.1 1.0
265PageTreeNode
266 property int selectedTabIndex
267 readonly property Tab selectedTab
268 readonly property Item currentPage
269 property TabBar tabBar
270 default property list<Item> tabChildren
271 readonly property int count
272 signal modelChanged()
273 property var __model
274TextArea 0.1 1.0
275Ubuntu.StyledItem
276 property bool highlighted
277 property string placeholderText
278 readonly property string displayText
279 property bool selectByMouse
280 property bool autoExpand
281 property bool autoSize
282 property int maximumLineCount
283 property real contentWidth
284 property real contentHeight
285 property var popover
286 property bool activeFocusOnPress
287 property url baseUrl
288 property bool canPaste
289 property bool canRedo
290 property bool canUndo
291 property color color
292 property Component cursorDelegate
293 property int cursorPosition
294 property rectangle cursorRectangle
295 property bool cursorVisible
296 property enumeration effectiveHorizontalAlignment
297 property font font
298 property enumeration horizontalAlignment
299 property bool inputMethodComposing
300 property enumeration inputMethodHints
301 property int length
302 property int lineCount
303 property enumeration mouseSelectionMode
304 property enumeration persistentSelection
305 property bool readOnly
306 property enumeration renderType
307 property string selectedText
308 property color selectedTextColor
309 property color selectionColor
310 property int selectionEnd
311 property int selectionStart
312 property string text
313 property enumeration textFormat
314 property enumeration verticalAlignment
315 property enumeration wrapMode
316 signal linkActivated(string link)
317 function copy()
318 function cut()
319 function deselect()
320 function insert(position, text)
321 function positionAt(x, y)
322 function isRightToLeft(start, end)
323 function moveCursorSelection(position, mode)
324 function paste(data)
325 function positionToRectangle(position)
326 function redo()
327 function select(start, end)
328 function selectAll()
329 function selectWord()
330 function getFormattedText(start, end)
331 function getText(start, end)
332 function remove(start, end)
333 function undo()
334TextField 0.1 1.0
335ActionItem
336 property bool highlighted
337 property string placeholderText
338 property bool hasClearButton
339 property Component customSoftwareInputPanel
340 property var popover
341 property list<Object> primaryItem
342 property list<Object> secondaryItem
343 property bool errorHighlight
344 property bool acceptableInput
345 property bool activeFocusOnPress
346 property bool autoScroll
347 property bool canPaste
348 property bool canRedo
349 property bool canUndo
350 property color color
351 property real contentHeight
352 property real contentWidth
353 property Component cursorDelegate
354 property int cursorPosition
355 property rectangle cursorRectangle
356 property bool cursorVisible
357 property string displayText
358 property enumeration echoMode
359 property font font
360 property string inputMask
361 property bool inputMethodComposing
362 property enumeration inputMethodHints
363 property int length
364 property int maximumLength
365 property enumeration mouseSelectionMode
366 property bool persistentSelection
367 property bool readOnly
368 property enumeration renderType
369 property bool selectByMouse
370 readonly property string selectedText
371 property int selectionStart
372 property int selectionEnd
373 property string text
374 property Validator validator
375 property enumeration horizontalAlignment
376 property enumeration effectiveHorizontalAlignment
377 property enumeration verticalAlignment
378 property string passwordCharacter
379 property color selectionColor
380 property color selectedTextColor
381 signal accepted()
382 function copy()
383 function cut()
384 function paste(data)
385 function deselect()
386 function insert(position, text)
387 function positionAt(x, position)
388 function positionToRectangle(pos)
389 function select(start, end)
390 function selectAll()
391 function selectWord()
392 function isRightToLeft(start, end)
393 function moveCursorSelection(position, mode)
394 function redo()
395 function undo()
396 function remove(start, end)
397 function getText(start, end)
398ToolbarButton 0.1 1.0
399ActionItem
400ToolbarItems 0.1 1.0
401Item
402 default property list<Object> contents
403 property Item back
404 property Item pageStack
405 property bool opened
406 property bool locked
407UbuntuListView 0.1 1.0
408ListView
409 property int expandedIndex
410UbuntuListView 1.1
411UbuntuListView
412 property PullToRefresh pullToRefresh
413UbuntuNumberAnimation 0.1 1.0
414NumberAnimation
415AbstractButton 1.3
416ActionItem
417 signal clicked()
418 signal pressAndHold()
419 property bool pressed
420 property bool hovered
421 property bool __acceptEvents
422 property internal __mouseArea
423ActionItem 1.3
424StyledItem
425 property Action action
426 property string text
427 property url iconSource
428 property string iconName
429 signal triggered(var value)
430 function trigger(value)
431ActionList 1.3
432QtObject
433 default property list<Action> children
434 property list<Action> actions
435ActivityIndicator 1.3
436AnimatedItem
437 property bool running
438Button 1.3
439AbstractButton
440 property color strokeColor
441 property color color
442 property Gradient gradient
443 property font font
444 property string iconPosition
445Captions 1.3
446ColumnLayout
447 property int captionStyle
448 property Label title
449 property Label subtitle
450CheckBox 1.3
451AbstractButton
452 property bool checked
453ComboButton 1.3
454Button
455 property bool expanded
456 property real collapsedHeight
457 property real expandedHeight
458 readonly property real comboListHeight
459 default property list<Item> comboList
460 property color dropdownColor
461CrossFadeImage 1.3
462Item
463 property url source
464 property int fillMode
465 property int fadeDuration
466 property size sourceSize
467 property string fadeStyle
468 readonly property bool running
469 readonly property int status
470Header 1.3
471AppHeader
472 property string _for_autopilot
473Label 1.3
474Text
475 property string fontSize
476MainView 1.3
477MainViewBase
478 property internal automaticOrientation
479 default property internal contentsItem
480OptionSelector 1.3
481ListItem.Empty
482 property var model
483 property bool expanded
484 property bool multiSelection
485 property bool colourImage
486 property Component delegate
487 property real containerHeight
488 property int selectedIndex
489 property bool currentlyExpanded
490 readonly property real itemHeight
491 signal delegateClicked(int index)
492 signal expansionCompleted()
493OptionSelectorDelegate 1.3
494ListItem.Empty
495 property string subText
496 property url icon
497 property bool constrainImage
498 property bool colourImage
499 property color assetColour
500 readonly property ListView listView
501 readonly property string fragColourShader
502OrientationHelper 1.3
503Item
504 property bool automaticOrientation
505 property bool transitionEnabled
506 readonly property bool rotating
507 property int __orientationAngle
508 property int orientationAngle
509 property bool anchorToKeyboard
510Page 1.3
511PageTreeNode
512 property string title
513 property Flickable flickable
514 readonly property PageHeadConfiguration head
515PageHeadConfiguration 1.3
516Object
517 property list<Action> actions
518 property Action backAction
519 property Item contents
520 property string preset
521 readonly property PageHeadSections sections
522 property color foregroundColor
523 property bool locked
524 property bool visible
525PageHeadSections 1.3
526QtObject
527 property bool enabled
528 property var model
529 property int selectedIndex
530PageHeadState 1.3
531State
532 property PageHeadConfiguration head
533 property list<Action> actions
534 property Action backAction
535 property Item contents
536PageStack 1.3
537PageTreeNode
538 property bool __showHeader
539 property int depth
540 property Item currentPage
541 function push(page, properties)
542 function pop()
543 function clear()
544 default property list<Object> data
545Panel 1.3
546Item
547 default property list<Object> contents
548 property int align
549 property bool opened
550 function open()
551 function close()
552 property int hideTimeout
553 property bool locked
554 property real hintSize
555 property real triggerSize
556 readonly property real position
557 property bool animate
558 readonly property bool animating
559 property bool __closeOnContentsClicks
560 property bool __openOnHover
561 property bool pressed
562ProgressBar 1.3
563AnimatedItem
564 property bool indeterminate
565 property real minimumValue
566 property real maximumValue
567 property real value
568 property bool showProgressPercentage
569PullToRefresh 1.3
570StyledItem
571 readonly property bool releaseToRefresh
572 readonly property real offset
573 property Component content
574 property Flickable target
575 property bool refreshing
576 signal refresh()
577Scrollbar 1.3
578Toolkit.StyledItem
579 property Flickable flickableItem
580 property int align
581 property bool __interactive
582 property internal __private
583Slider 1.3
584Toolkit.StyledItem
585 property real minimumValue
586 property real maximumValue
587 property real value
588 property bool live
589 property bool pressed
590 signal touched(bool onThumb)
591 function formatValue(v)
592 property internal __internals
593Switch 1.3
594CheckBox
595Tab 1.3
596PageTreeNode
597 property string title
598 property url iconSource
599 property Item page
600 readonly property int index
601 property internal __protected
602TabBar 1.3
603Toolkit.StyledItem
604 property Item tabsItem
605 property var model
606 readonly property bool pressed
607 property bool selectionMode
608 property int selectedIndex
609 property bool alwaysSelectionMode
610 property bool animate
611Tabs 1.3
612PageTreeNode
613 property int selectedTabIndex
614 readonly property Tab selectedTab
615 readonly property Item currentPage
616 property TabBar tabBar
617 default property list<Item> tabChildren
618 readonly property int count
619 signal modelChanged()
620 property var __model
621TextArea 1.3
622Ubuntu.StyledItem
623 property bool highlighted
624 property string placeholderText
625 readonly property string displayText
626 property bool selectByMouse
627 property bool autoExpand
628 property bool autoSize
629 property int maximumLineCount
630 property real contentWidth
631 property real contentHeight
632 property var popover
633 property bool activeFocusOnPress
634 property url baseUrl
635 property bool canPaste
636 property bool canRedo
637 property bool canUndo
638 property color color
639 property Component cursorDelegate
640 property int cursorPosition
641 property rectangle cursorRectangle
642 property bool cursorVisible
643 property enumeration effectiveHorizontalAlignment
644 property font font
645 property enumeration horizontalAlignment
646 property bool inputMethodComposing
647 property enumeration inputMethodHints
648 property int length
649 property int lineCount
650 property enumeration mouseSelectionMode
651 property enumeration persistentSelection
652 property bool readOnly
653 property enumeration renderType
654 property string selectedText
655 property color selectedTextColor
656 property color selectionColor
657 property int selectionEnd
658 property int selectionStart
659 property string text
660 property enumeration textFormat
661 property enumeration verticalAlignment
662 property enumeration wrapMode
663 signal linkActivated(string link)
664 function copy()
665 function cut()
666 function deselect()
667 function insert(position, text)
668 function positionAt(x, y)
669 function isRightToLeft(start, end)
670 function moveCursorSelection(position, mode)
671 function paste(data)
672 function positionToRectangle(position)
673 function redo()
674 function select(start, end)
675 function selectAll()
676 function selectWord()
677 function getFormattedText(start, end)
678 function getText(start, end)
679 function remove(start, end)
680 function undo()
681TextField 1.3
682ActionItem
683 property bool highlighted
684 property string placeholderText
685 property bool hasClearButton
686 property Component customSoftwareInputPanel
687 property var popover
688 property list<Object> primaryItem
689 property list<Object> secondaryItem
690 property bool errorHighlight
691 property bool acceptableInput
692 property bool activeFocusOnPress
693 property bool autoScroll
694 property bool canPaste
695 property bool canRedo
696 property bool canUndo
697 property color color
698 property real contentHeight
699 property real contentWidth
700 property Component cursorDelegate
701 property int cursorPosition
702 property rectangle cursorRectangle
703 property bool cursorVisible
704 property string displayText
705 property enumeration echoMode
706 property font font
707 property string inputMask
708 property bool inputMethodComposing
709 property enumeration inputMethodHints
710 property int length
711 property int maximumLength
712 property enumeration mouseSelectionMode
713 property bool persistentSelection
714 property bool readOnly
715 property enumeration renderType
716 property bool selectByMouse
717 readonly property string selectedText
718 property int selectionStart
719 property int selectionEnd
720 property string text
721 property Validator validator
722 property enumeration horizontalAlignment
723 property enumeration effectiveHorizontalAlignment
724 property enumeration verticalAlignment
725 property string passwordCharacter
726 property color selectionColor
727 property color selectedTextColor
728 signal accepted()
729 function copy()
730 function cut()
731 function paste(data)
732 function deselect()
733 function insert(position, text)
734 function positionAt(x, position)
735 function positionToRectangle(pos)
736 function select(start, end)
737 function selectAll()
738 function selectWord()
739 function isRightToLeft(start, end)
740 function moveCursorSelection(position, mode)
741 function redo()
742 function undo()
743 function remove(start, end)
744 function getText(start, end)
745ToolbarButton 1.3
746ActionItem
747ToolbarItems 1.3
748Item
749 default property list<Object> contents
750 property Item back
751 property Item pageStack
752 property bool opened
753 property bool locked
754UbuntuListView 1.3
755UbuntuListView
756 property PullToRefresh pullToRefresh
757UbuntuNumberAnimation 1.3
758NumberAnimation
759Base 0.1 1.0
760Empty
761 property variant icon
762 property url fallbackIconSource
763 property string fallbackIconName
764 property bool progression
765 property bool iconFrame
766 property real __iconWidth
767 property real __iconHeight
768 property real __leftIconMargin
769 property real __rightIconMargin
770 property bool __iconIsItem
771 default property internal children
772Caption 0.1 1.0
773Item
774 property string text
775Divider 0.1 1.0
776Image
777Empty 0.1 1.0
778AbstractButton
779 property bool selected
780 property bool highlightWhenPressed
781 property bool removable
782 property bool confirmRemoval
783 readonly property string swipingState
784 readonly property bool waitingConfirmationForRemoval
785 signal itemRemoved
786 property int __height
787 property bool showDivider
788 default property internal children
789 property internal __contents
790 property list<Item> backgroundIndicator
791 property ThinDivider divider
792 property real __contentsMargins
793 function cancelItemRemoval()
794Expandable 0.1 1.0
795Empty
796 property bool expanded
797 property real collapsedHeight
798 property real expandedHeight
799 property bool collapseOnClick
800 default property QtObject children
801ExpandablesColumn 0.1 1.0
802Flickable
803 readonly property Item expandedItem
804 function expandItem(item)
805 function collapse()
806 default property QtObject children
807Header 0.1 1.0
808Item
809 property string text
810 property internal __foregroundColor
811ItemSelector 0.1 1.0
812ListItem.Empty
813 property var model
814 property bool expanded
815 property bool multiSelection
816 property bool colourImage
817 property Component delegate
818 property real containerHeight
819 property int selectedIndex
820 property bool currentlyExpanded
821 readonly property real itemHeight
822 signal delegateClicked(int index)
823 signal expansionCompleted()
824MultiValue 0.1 1.0
825Base
826 property variant values
827SingleControl 0.1 1.0
828Empty
829 property Item control
830 function __updateControl()
831SingleValue 0.1 1.0
832Base
833 property string value
834Standard 0.1 1.0
835Empty
836 property variant icon
837 property url fallbackIconSource
838 property string fallbackIconName
839 property bool progression
840 property real __iconWidth
841 property real __iconHeight
842 property real __leftIconMargin
843 property real __rightIconMargin
844 property Item control
845 property bool iconFrame
846 property bool __controlAreaPressed
847 property bool __iconIsItem
848 property internal __foregroundColor
849Subtitled 0.1 1.0
850Base
851 property string subText
852ThinDivider 0.1 1.0
853Rectangle
854 property bool __lightBackground
855ValueSelector 0.1 1.0
856Empty
857 property variant icon
858 property url fallbackIconSource
859 property string fallbackIconName
860 property real __iconWidth
861 property real __iconHeight
862 property real __leftIconMargin
863 property real __rightIconMargin
864 property bool iconFrame
865 property variant values
866 property int selectedIndex
867 property bool expanded
868Base 1.3
869Empty
870 property variant icon
871 property url fallbackIconSource
872 property string fallbackIconName
873 property bool progression
874 property bool iconFrame
875 property real __iconWidth
876 property real __iconHeight
877 property real __leftIconMargin
878 property real __rightIconMargin
879 property bool __iconIsItem
880 default property internal children
881Caption 1.3
882Item
883 property string text
884Divider 1.3
885Image
886Empty 1.3
887AbstractButton
888 property bool selected
889 property bool highlightWhenPressed
890 property bool removable
891 property bool confirmRemoval
892 readonly property string swipingState
893 readonly property bool waitingConfirmationForRemoval
894 signal itemRemoved
895 property int __height
896 property bool showDivider
897 default property internal children
898 property internal __contents
899 property list<Item> backgroundIndicator
900 property ThinDivider divider
901 property real __contentsMargins
902 function cancelItemRemoval()
903Expandable 1.3
904Empty
905 property bool expanded
906 property real collapsedHeight
907 property real expandedHeight
908 property bool collapseOnClick
909 default property QtObject children
910ExpandablesColumn 1.3
911Flickable
912 readonly property Item expandedItem
913 function expandItem(item)
914 function collapse()
915 default property QtObject children
916Header 1.3
917Item
918 property string text
919 property internal __foregroundColor
920ItemSelector 1.3
921ListItem.Empty
922 property var model
923 property bool expanded
924 property bool multiSelection
925 property bool colourImage
926 property Component delegate
927 property real containerHeight
928 property int selectedIndex
929 property bool currentlyExpanded
930 readonly property real itemHeight
931 signal delegateClicked(int index)
932 signal expansionCompleted()
933MultiValue 1.3
934Base
935 property variant values
936SingleControl 1.3
937Empty
938 property Item control
939 function __updateControl()
940SingleValue 1.3
941Base
942 property string value
943Standard 1.3
944Empty
945 property variant icon
946 property url fallbackIconSource
947 property string fallbackIconName
948 property bool progression
949 property real __iconWidth
950 property real __iconHeight
951 property real __leftIconMargin
952 property real __rightIconMargin
953 property Item control
954 property bool iconFrame
955 property bool __controlAreaPressed
956 property bool __iconIsItem
957 property internal __foregroundColor
958Subtitled 1.3
959Base
960 property string subText
961ThinDivider 1.3
962Rectangle
963 property bool __lightBackground
964ValueSelector 1.3
965Empty
966 property variant icon
967 property url fallbackIconSource
968 property string fallbackIconName
969 property real __iconWidth
970 property real __iconHeight
971 property real __leftIconMargin
972 property real __rightIconMargin
973 property bool iconFrame
974 property variant values
975 property int selectedIndex
976 property bool expanded
305DatePicker 0.1 1.0977DatePicker 0.1 1.0
306StyledItem978StyledItem
307 property string mode979 property string mode
@@ -351,6 +1023,55 @@
351PickerPanel 0.1 1.01023PickerPanel 0.1 1.0
352Object1024Object
353 function openDatePicker(caller, property, mode)1025 function openDatePicker(caller, property, mode)
1026DatePicker 1.3
1027StyledItem
1028 property string mode
1029 property date date
1030 property date minimum
1031 property date maximum
1032 readonly property int year
1033 readonly property int month
1034 readonly property int day
1035 readonly property int week
1036 readonly property int hours
1037 readonly property int minutes
1038 readonly property int seconds
1039 property var locale
1040 readonly property bool moving
1041Dialer 1.3
1042StyledItem
1043 property real minimumValue
1044 property real maximumValue
1045 property real size
1046 property real handSpace
1047 readonly property Item centerItem
1048 property list<var> centerContent
1049 readonly property list<DialerHands> hands
1050 signal handUpdated(var hand)
1051DialerHand 1.3
1052StyledItem
1053 property real value
1054 property DialerHandGroup hand
1055 readonly property Dialer dialer
1056 default property list<QtObject> overlay
1057 readonly property int index
1058 property internal __grabber
1059Picker 1.3
1060StyledItem
1061 property bool circular
1062 property var model
1063 property Component delegate
1064 property int selectedIndex
1065 property bool live
1066 readonly property bool moving
1067 function positionViewAtIndex(index)
1068 property int __clickedIndex
1069PickerDelegate 1.3
1070AbstractButton
1071 readonly property Picker picker
1072PickerPanel 1.3
1073Object
1074 function openDatePicker(caller, property, mode)
354ActionSelectionPopover 0.1 1.01075ActionSelectionPopover 0.1 1.0
355Popover1076Popover
356 property Item target1077 property Item target
@@ -411,39 +1132,66 @@
411 property bool modal1132 property bool modal
412 property internal __leftButton1133 property internal __leftButton
413 property internal __rightButton1134 property internal __rightButton
414ProgressBar 0.1 1.01135ActionSelectionPopover 1.3
415AnimatedItem1136Popover
416 property bool indeterminate1137 property Item target
417 property real minimumValue1138 property var actions
418 property real maximumValue1139 property Component delegate
419 property real value1140ComposerSheet 1.3
420ProgressBar 1.11141SheetBase
421ProgressBar1142 signal cancelClicked
422 property bool showProgressPercentage1143 signal confirmClicked
423PullToRefresh 1.11144DefaultSheet 1.3
424StyledItem1145SheetBase
425 readonly property bool releaseToRefresh1146 property bool doneButton
426 readonly property real offset1147 signal closeClicked
427 property Component content1148 signal doneClicked
428 property Flickable target1149Dialog 1.3
429 property bool refreshing1150PopupBase
430 signal refresh()1151 default property list<Object> contents
431Scrollbar 0.1 1.01152 property string title
432Toolkit.StyledItem1153 property string text
433 property Flickable flickableItem1154 property Item caller
434 property int align1155 property Item pointerTarget
435 property bool __interactive1156 property real edgeMargins
436 property internal __private1157 property real callerMargin
437Slider 0.1 1.01158 property bool modal
438Toolkit.StyledItem1159Popover 1.3
439 property real minimumValue1160PopupBase
440 property real maximumValue1161 default property list<Object> container
441 property real value1162 property real contentWidth
442 property bool live1163 property real contentHeight
443 property bool pressed1164 property Item caller
444 signal touched(bool onThumb)1165 property Item pointerTarget
445 function formatValue(v)1166 property real edgeMargins
446 property internal __internals1167 property real callerMargin
1168 property bool autoClose
1169 property Component foregroundStyle
1170 function show()
1171 function hide()
1172 function __makeInvisible()
1173PopupBase 1.3
1174OrientationHelper
1175 property Item dismissArea
1176 property bool grabDismissAreaEvents
1177 property PropertyAnimation fadingAnimation
1178 function show()
1179 function hide()
1180 function __closeIfHidden()
1181 function __closePopup()
1182 property Item __foreground
1183 property bool __closeOnDismissAreaPress
1184 property internal __dimBackground
1185 property internal __eventGrabber
1186SheetBase 1.3
1187PopupBase
1188 default property list<Object> container
1189 property real contentsWidth
1190 property real contentsHeight
1191 property string title
1192 property bool modal
1193 property internal __leftButton
1194 property internal __rightButton
447ComboButtonStyle 1.11195ComboButtonStyle 1.1
448Item1196Item
449 property real dropDownWidth1197 property real dropDownWidth
@@ -470,158 +1218,6 @@
470 property Component defaultContent1218 property Component defaultContent
471 property real activationThreshold1219 property real activationThreshold
472 property bool releaseToRefresh1220 property bool releaseToRefresh
473Switch 0.1 1.0
474CheckBox
475Tab 0.1 1.0
476PageTreeNode
477 property string title
478 property url iconSource
479 property Item page
480 readonly property int index
481 property internal __protected
482TabBar 0.1 1.0
483Toolkit.StyledItem
484 property Item tabsItem
485 property var model
486 readonly property bool pressed
487 property bool selectionMode
488 property int selectedIndex
489 property bool alwaysSelectionMode
490 property bool animate
491Tabs 0.1 1.0
492PageTreeNode
493 property int selectedTabIndex
494 readonly property Tab selectedTab
495 readonly property Item currentPage
496 property TabBar tabBar
497 default property list<Item> tabChildren
498 readonly property int count
499 signal modelChanged()
500 property var __model
501TextArea 0.1 1.0
502Ubuntu.StyledItem
503 property bool highlighted
504 property string placeholderText
505 readonly property string displayText
506 property bool selectByMouse
507 property bool autoExpand
508 property bool autoSize
509 property int maximumLineCount
510 property real contentWidth
511 property real contentHeight
512 property var popover
513 property bool activeFocusOnPress
514 property url baseUrl
515 property bool canPaste
516 property bool canRedo
517 property bool canUndo
518 property color color
519 property Component cursorDelegate
520 property int cursorPosition
521 property rectangle cursorRectangle
522 property bool cursorVisible
523 property enumeration effectiveHorizontalAlignment
524 property font font
525 property enumeration horizontalAlignment
526 property bool inputMethodComposing
527 property enumeration inputMethodHints
528 property int length
529 property int lineCount
530 property enumeration mouseSelectionMode
531 property enumeration persistentSelection
532 property bool readOnly
533 property enumeration renderType
534 property string selectedText
535 property color selectedTextColor
536 property color selectionColor
537 property int selectionEnd
538 property int selectionStart
539 property string text
540 property enumeration textFormat
541 property enumeration verticalAlignment
542 property enumeration wrapMode
543 signal linkActivated(string link)
544 function copy()
545 function cut()
546 function deselect()
547 function insert(position, text)
548 function positionAt(x, y)
549 function isRightToLeft(start, end)
550 function moveCursorSelection(position, mode)
551 function paste(data)
552 function positionToRectangle(position)
553 function redo()
554 function select(start, end)
555 function selectAll()
556 function selectWord()
557 function getFormattedText(start, end)
558 function getText(start, end)
559 function remove(start, end)
560 function undo()
561TextField 0.1 1.0
562ActionItem
563 property bool highlighted
564 property string placeholderText
565 property bool hasClearButton
566 property Component customSoftwareInputPanel
567 property var popover
568 property list<Object> primaryItem
569 property list<Object> secondaryItem
570 property bool errorHighlight
571 property bool acceptableInput
572 property bool activeFocusOnPress
573 property bool autoScroll
574 property bool canPaste
575 property bool canRedo
576 property bool canUndo
577 property color color
578 property real contentHeight
579 property real contentWidth
580 property Component cursorDelegate
581 property int cursorPosition
582 property rectangle cursorRectangle
583 property bool cursorVisible
584 property string displayText
585 property enumeration echoMode
586 property font font
587 property string inputMask
588 property bool inputMethodComposing
589 property enumeration inputMethodHints
590 property int length
591 property int maximumLength
592 property enumeration mouseSelectionMode
593 property bool persistentSelection
594 property bool readOnly
595 property enumeration renderType
596 property bool selectByMouse
597 readonly property string selectedText
598 property int selectionStart
599 property int selectionEnd
600 property string text
601 property Validator validator
602 property enumeration horizontalAlignment
603 property enumeration effectiveHorizontalAlignment
604 property enumeration verticalAlignment
605 property string passwordCharacter
606 property color selectionColor
607 property color selectedTextColor
608 signal accepted()
609 function copy()
610 function cut()
611 function paste(data)
612 function deselect()
613 function insert(position, text)
614 function positionAt(x, position)
615 function positionToRectangle(pos)
616 function select(start, end)
617 function selectAll()
618 function selectWord()
619 function isRightToLeft(start, end)
620 function moveCursorSelection(position, mode)
621 function redo()
622 function undo()
623 function remove(start, end)
624 function getText(start, end)
625Palette 0.11221Palette 0.1
626QtObject1222QtObject
627 property PaletteValues normal1223 property PaletteValues normal
@@ -656,49 +1252,6 @@
656 property color field1252 property color field
657 property color fieldText1253 property color fieldText
658 property color selection1254 property color selection
659ToolbarButton 0.1 1.0
660ActionItem
661ToolbarItems 0.1 1.0
662Item
663 default property list<Object> contents
664 property Item back
665 property Item pageStack
666 property bool opened
667 property bool locked
668UbuntuColors 1.1
669QtObject
670 readonly property color orange
671 readonly property color lightAubergine
672 readonly property color midAubergine
673 readonly property color darkAubergine
674 readonly property color warmGrey
675 readonly property color coolGrey
676 property Gradient orangeGradient
677 property Gradient greyGradient
678 readonly property color lightGrey
679 readonly property color darkGrey
680 readonly property color red
681 readonly property color green
682 readonly property color blue
683 readonly property color purple
684UbuntuColors 0.1 1.0
685QtObject
686 readonly property color orange
687 readonly property color lightAubergine
688 readonly property color midAubergine
689 readonly property color darkAubergine
690 readonly property color warmGrey
691 readonly property color coolGrey
692 property Gradient orangeGradient
693 property Gradient greyGradient
694UbuntuListView 0.1 1.0
695ListView
696 property int expandedIndex
697UbuntuListView 1.1
698UbuntuListView
699 property PullToRefresh pullToRefresh
700UbuntuNumberAnimation 0.1 1.0
701NumberAnimation
702PerformanceOverlay 0.1 1.01255PerformanceOverlay 0.1 1.0
703Item1256Item
704 property bool active1257 property bool active
7051258
=== modified file 'debian/qtdeclarative5-ubuntu-ui-toolkit-plugin.install'
--- debian/qtdeclarative5-ubuntu-ui-toolkit-plugin.install 2014-09-03 08:17:24 +0000
+++ debian/qtdeclarative5-ubuntu-ui-toolkit-plugin.install 2015-05-06 10:32:32 +0000
@@ -5,23 +5,28 @@
5usr/lib/*/qt5/qml/Ubuntu/Layouts/qmldir5usr/lib/*/qt5/qml/Ubuntu/Layouts/qmldir
6usr/lib/*/qt5/qml/Ubuntu/Layouts/plugins.qmltypes6usr/lib/*/qt5/qml/Ubuntu/Layouts/plugins.qmltypes
7usr/lib/*/qt5/qml/Ubuntu/Layouts/libUbuntuLayouts.so7usr/lib/*/qt5/qml/Ubuntu/Layouts/libUbuntuLayouts.so
8usr/lib/*/qt5/qml/Ubuntu/Components/*.qml8usr/lib/*/qt5/qml/Ubuntu/Components/1.0/*.qml
9usr/lib/*/qt5/qml/Ubuntu/Components/10/*.qml9usr/lib/*/qt5/qml/Ubuntu/Components/1.1/*.qml
10usr/lib/*/qt5/qml/Ubuntu/Components/11/*.qml10usr/lib/*/qt5/qml/Ubuntu/Components/1.2/*.qml
11usr/lib/*/qt5/qml/Ubuntu/Components/*.js11usr/lib/*/qt5/qml/Ubuntu/Components/1.2/*.js
12usr/lib/*/qt5/qml/Ubuntu/Components/1.3/*.qml
13usr/lib/*/qt5/qml/Ubuntu/Components/1.3/*.js
12usr/lib/*/qt5/qml/Ubuntu/Components/qmldir14usr/lib/*/qt5/qml/Ubuntu/Components/qmldir
13usr/lib/*/qt5/qml/Ubuntu/Components/plugins.qmltypes15usr/lib/*/qt5/qml/Ubuntu/Components/plugins.qmltypes
14usr/lib/*/qt5/qml/Ubuntu/Components/libUbuntuComponents.so16usr/lib/*/qt5/qml/Ubuntu/Components/libUbuntuComponents.so
15usr/lib/*/qt5/qml/Ubuntu/Components/artwork17usr/lib/*/qt5/qml/Ubuntu/Components/artwork
16usr/lib/*/qt5/qml/Ubuntu/Components/ListItems/*.qml18usr/lib/*/qt5/qml/Ubuntu/Components/ListItems/1.2/*.qml
19usr/lib/*/qt5/qml/Ubuntu/Components/ListItems/1.3/*.qml
17usr/lib/*/qt5/qml/Ubuntu/Components/ListItems/qmldir20usr/lib/*/qt5/qml/Ubuntu/Components/ListItems/qmldir
18usr/lib/*/qt5/qml/Ubuntu/Components/ListItems/artwork
19usr/lib/*/qt5/qml/Ubuntu/Components/Popups/qmldir21usr/lib/*/qt5/qml/Ubuntu/Components/Popups/qmldir
20usr/lib/*/qt5/qml/Ubuntu/Components/Popups/*.qml22usr/lib/*/qt5/qml/Ubuntu/Components/Popups/1.2/*.qml
21usr/lib/*/qt5/qml/Ubuntu/Components/Popups/*.js23usr/lib/*/qt5/qml/Ubuntu/Components/Popups/1.2/*.js
22usr/lib/*/qt5/qml/Ubuntu/Components/Pickers/*.qml24usr/lib/*/qt5/qml/Ubuntu/Components/Popups/1.3/*.qml
25usr/lib/*/qt5/qml/Ubuntu/Components/Popups/1.3/*.js
26usr/lib/*/qt5/qml/Ubuntu/Components/Pickers/1.2/*.qml
27usr/lib/*/qt5/qml/Ubuntu/Components/Pickers/1.3/*.qml
23usr/lib/*/qt5/qml/Ubuntu/Components/Pickers/qmldir28usr/lib/*/qt5/qml/Ubuntu/Components/Pickers/qmldir
24usr/lib/*/qt5/qml/Ubuntu/Components/Styles/*.qml29usr/lib/*/qt5/qml/Ubuntu/Components/Styles/1.2/*.qml
25usr/lib/*/qt5/qml/Ubuntu/Components/Styles/qmldir30usr/lib/*/qt5/qml/Ubuntu/Components/Styles/qmldir
26usr/lib/*/qt5/qml/Ubuntu/Test31usr/lib/*/qt5/qml/Ubuntu/Test
27usr/share/locale/*/LC_MESSAGES/ubuntu-ui-toolkit.mo32usr/share/locale/*/LC_MESSAGES/ubuntu-ui-toolkit.mo
2833
=== modified file 'documentation/ubuntu-theming.qdoc'
--- documentation/ubuntu-theming.qdoc 2015-04-25 07:10:57 +0000
+++ documentation/ubuntu-theming.qdoc 2015-05-06 10:32:32 +0000
@@ -125,7 +125,7 @@
125 * Other styles are requested to provide additional \e content elements, which are then125 * Other styles are requested to provide additional \e content elements, which are then
126 * positioned by the styled component separately from the main visuals given by the style.126 * positioned by the styled component separately from the main visuals given by the style.
127 * A typical example of such a style API is the PullToRefresh component's style:127 * A typical example of such a style API is the PullToRefresh component's style:
128 * \snippet Styles/PullToRefreshStyle.qml 0128 * \snippet Styles/1.2/PullToRefreshStyle.qml 0
129 * The default style implementation can be found under Ubuntu.Components.Themes.Ambiance129 * The default style implementation can be found under Ubuntu.Components.Themes.Ambiance
130 * theme \l {http://bazaar.launchpad.net/~ubuntu-sdk-team/ubuntu-ui-toolkit/trunk/view/head:/modules/Ubuntu/Components/Themes/Ambiance/PullToRefreshStyle.qml}130 * theme \l {http://bazaar.launchpad.net/~ubuntu-sdk-team/ubuntu-ui-toolkit/trunk/view/head:/modules/Ubuntu/Components/Themes/Ambiance/PullToRefreshStyle.qml}
131 * {PullToRefreshStyle.qml}.131 * {PullToRefreshStyle.qml}.
132132
=== modified file 'documentation/ubuntu-ui-toolkit-common.qdocconf'
--- documentation/ubuntu-ui-toolkit-common.qdocconf 2015-04-27 06:08:34 +0000
+++ documentation/ubuntu-ui-toolkit-common.qdocconf 2015-05-06 10:32:32 +0000
@@ -11,8 +11,14 @@
11sourcedirs += ../modules/Ubuntu/Test11sourcedirs += ../modules/Ubuntu/Test
12headerdirs += ../modules/Ubuntu/Test/plugin12headerdirs += ../modules/Ubuntu/Test/plugin
13exampledirs += snippets13exampledirs += snippets
14exampledirs += ../examples/1.314exampledirs += ../examples
15exampledirs += ../modules/Ubuntu/Components15exampledirs += ../modules/Ubuntu/Components
16excludedirs += ../modules/Ubuntu/Components/1.0
17excludedirs += ../modules/Ubuntu/Components/1.1
18excludedirs += ../modules/Ubuntu/Components/1.2
19excludedirs += ../modules/Ubuntu/Components/ListItems/1.2
20excludedirs += ../modules/Ubuntu/Components/Pickers/1.2
21excludedirs += ../modules/Ubuntu/Components/Popups/1.2
16excludedirs += ../modules/Ubuntu/Components/Themes/Ambiance22excludedirs += ../modules/Ubuntu/Components/Themes/Ambiance
17excludedirs += ../modules/Ubuntu/Components/Themes/SuruDark23excludedirs += ../modules/Ubuntu/Components/Themes/SuruDark
18imagedirs = images24imagedirs = images
1925
=== removed directory 'examples/1.3'
=== removed file 'examples/1.3/1.3.pro'
--- examples/1.3/1.3.pro 2015-04-27 06:08:34 +0000
+++ examples/1.3/1.3.pro 1970-01-01 00:00:00 +0000
@@ -1,10 +0,0 @@
1TEMPLATE = subdirs
2
3SUBDIRS += \
4 ubuntu-ui-toolkit-gallery\
5 locale \
6 jokes \
7 unit-converter \
8 calculator \
9 customtheme
10
110
=== renamed directory 'examples/1.3/calculator' => 'examples/calculator'
=== renamed directory 'examples/1.3/customtheme' => 'examples/customtheme'
=== modified file 'examples/examples.pro'
--- examples/examples.pro 2015-04-27 06:08:34 +0000
+++ examples/examples.pro 2015-05-06 10:32:32 +0000
@@ -1,22 +1,9 @@
1TEMPLATE = subdirs1TEMPLATE = subdirs
22
3SUBDIRS += \ 3SUBDIRS += \
4 1.34 ubuntu-ui-toolkit-gallery\
55 locale \
66 jokes \
7#examples = jokes unit-converter7 unit-converter \
8#filetypes = qml png svg js jpg wav8 calculator \
9 9 customtheme
10#OTHER_FILES = ""
11
12#for(example, examples) {
13# for(filetype, filetypes) {
14# OTHER_FILES += $$example/*.$$filetype
15# }
16#}
17
18#other_files.path = /usr/lib/ubuntu-ui-toolkit/examples
19#other_files.files = $$OTHER_FILES
20
21#INSTALLS += other_files
22
2310
=== renamed directory 'examples/1.3/jokes' => 'examples/jokes'
=== renamed directory 'examples/1.3/locale' => 'examples/locale'
=== modified file 'examples/locale/locale.qml'
--- examples/1.3/locale/locale.qml 2015-04-09 09:42:36 +0000
+++ examples/locale/locale.qml 2015-05-06 10:32:32 +0000
@@ -17,7 +17,7 @@
1717
18import QtQuick 2.018import QtQuick 2.0
19import Ubuntu.Components 1.319import Ubuntu.Components 1.3
20import Ubuntu.Components.ListItems 1.0 as ListItem20import Ubuntu.Components.ListItems 1.3 as ListItem
2121
22/*!22/*!
23 \brief An application to test locales on the device23 \brief An application to test locales on the device
2424
=== renamed directory 'examples/1.3/ubuntu-ui-toolkit-gallery' => 'examples/ubuntu-ui-toolkit-gallery'
=== modified file 'examples/ubuntu-ui-toolkit-gallery/Buttons.qml'
--- examples/1.3/ubuntu-ui-toolkit-gallery/Buttons.qml 2015-04-25 08:18:45 +0000
+++ examples/ubuntu-ui-toolkit-gallery/Buttons.qml 2015-05-06 10:32:32 +0000
@@ -16,7 +16,7 @@
1616
17import QtQuick 2.417import QtQuick 2.4
18import Ubuntu.Components 1.318import Ubuntu.Components 1.3
19import Ubuntu.Components.ListItems 1.019import Ubuntu.Components.ListItems 1.3
2020
21Template {21Template {
22 objectName: "buttonsTemplate"22 objectName: "buttonsTemplate"
2323
=== modified file 'examples/ubuntu-ui-toolkit-gallery/Dialog.qml'
--- examples/1.3/ubuntu-ui-toolkit-gallery/Dialog.qml 2015-04-25 08:18:45 +0000
+++ examples/ubuntu-ui-toolkit-gallery/Dialog.qml 2015-05-06 10:32:32 +0000
@@ -16,7 +16,7 @@
1616
17import QtQuick 2.417import QtQuick 2.4
18import Ubuntu.Components 1.318import Ubuntu.Components 1.3
19import Ubuntu.Components.Popups 1.019import Ubuntu.Components.Popups 1.3
2020
21Template {21Template {
22 objectName: "dialogsTemplate"22 objectName: "dialogsTemplate"
2323
=== modified file 'examples/ubuntu-ui-toolkit-gallery/Icons.qml'
--- examples/1.3/ubuntu-ui-toolkit-gallery/Icons.qml 2015-04-25 08:18:45 +0000
+++ examples/ubuntu-ui-toolkit-gallery/Icons.qml 2015-05-06 10:32:32 +0000
@@ -16,8 +16,8 @@
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 1.318import Ubuntu.Components 1.3
19import Ubuntu.Components.ListItems 0.1 as ListItem19import Ubuntu.Components.ListItems 1.3 as ListItem
20import Ubuntu.Components.Popups 1.020import Ubuntu.Components.Popups 1.3
21import Qt.labs.folderlistmodel 2.121import Qt.labs.folderlistmodel 2.1
2222
23Template {23Template {
2424
=== modified file 'examples/ubuntu-ui-toolkit-gallery/ListItems.qml'
--- examples/1.3/ubuntu-ui-toolkit-gallery/ListItems.qml 2015-04-09 09:42:36 +0000
+++ examples/ubuntu-ui-toolkit-gallery/ListItems.qml 2015-05-06 10:32:32 +0000
@@ -16,7 +16,7 @@
1616
17import QtQuick 2.417import QtQuick 2.4
18import Ubuntu.Components 1.3 as Toolkit18import Ubuntu.Components 1.3 as Toolkit
19import Ubuntu.Components.ListItems 1.0 as ListItem19import Ubuntu.Components.ListItems 1.3 as ListItem
2020
21Template {21Template {
22 objectName: "listItemsTemplate"22 objectName: "listItemsTemplate"
2323
=== modified file 'examples/ubuntu-ui-toolkit-gallery/Pickers.qml'
--- examples/1.3/ubuntu-ui-toolkit-gallery/Pickers.qml 2015-04-09 09:42:36 +0000
+++ examples/ubuntu-ui-toolkit-gallery/Pickers.qml 2015-05-06 10:32:32 +0000
@@ -16,7 +16,7 @@
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 1.318import Ubuntu.Components 1.3
19import Ubuntu.Components.Pickers 1.019import Ubuntu.Components.Pickers 1.3
2020
21Template {21Template {
22 objectName: "pickersTemplate"22 objectName: "pickersTemplate"
@@ -209,4 +209,15 @@
209 }209 }
210 }210 }
211 }211 }
212
213 TemplateSection {
214 title: "PickerPanel"
215 TextField {
216 id: textField
217 readOnly: true
218 property date date: new Date()
219 text: date.toISOString()
220 Mouse.onClicked: PickerPanel.openDatePicker(textField, "date");
221 }
222 }
212}223}
213224
=== modified file 'examples/ubuntu-ui-toolkit-gallery/Popover.qml'
--- examples/1.3/ubuntu-ui-toolkit-gallery/Popover.qml 2015-04-25 08:18:45 +0000
+++ examples/ubuntu-ui-toolkit-gallery/Popover.qml 2015-05-06 10:32:32 +0000
@@ -16,7 +16,7 @@
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 1.318import Ubuntu.Components 1.3
19import Ubuntu.Components.Popups 0.119import Ubuntu.Components.Popups 1.3
2020
21Template {21Template {
22 objectName: "popoversTemplate"22 objectName: "popoversTemplate"
2323
=== modified file 'examples/ubuntu-ui-toolkit-gallery/Sheet.qml'
--- examples/1.3/ubuntu-ui-toolkit-gallery/Sheet.qml 2015-04-25 08:18:45 +0000
+++ examples/ubuntu-ui-toolkit-gallery/Sheet.qml 2015-05-06 10:32:32 +0000
@@ -16,7 +16,7 @@
1616
17import QtQuick 2.017import QtQuick 2.0
18import Ubuntu.Components 1.318import Ubuntu.Components 1.3
19import Ubuntu.Components.Popups 0.119import Ubuntu.Components.Popups 1.3
2020
21Template {21Template {
22 objectName: "sheetsTemplate"22 objectName: "sheetsTemplate"
2323
=== modified file 'examples/ubuntu-ui-toolkit-gallery/UbuntuListViews.qml'
--- examples/1.3/ubuntu-ui-toolkit-gallery/UbuntuListViews.qml 2015-04-25 08:18:45 +0000
+++ examples/ubuntu-ui-toolkit-gallery/UbuntuListViews.qml 2015-05-06 10:32:32 +0000
@@ -16,7 +16,7 @@
1616
17import QtQuick 2.417import QtQuick 2.4
18import Ubuntu.Components 1.318import Ubuntu.Components 1.3
19import Ubuntu.Components.ListItems 1.0 as ListItem19import Ubuntu.Components.ListItems 1.3 as ListItem
2020
21Template {21Template {
22 objectName: "ubuntuListViewTemplate"22 objectName: "ubuntuListViewTemplate"
2323
=== modified file 'examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.qml'
--- examples/1.3/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.qml 2015-04-25 08:18:45 +0000
+++ examples/ubuntu-ui-toolkit-gallery/ubuntu-ui-toolkit-gallery.qml 2015-05-06 10:32:32 +0000
@@ -16,7 +16,7 @@
1616
17import QtQuick 2.417import QtQuick 2.4
18import Ubuntu.Components 1.318import Ubuntu.Components 1.3
19import Ubuntu.Components.ListItems 0.1 as ListItem19import Ubuntu.Components.ListItems 1.3 as ListItem
2020
21MainView {21MainView {
22 id: gallery22 id: gallery
2323
=== renamed directory 'examples/1.3/unit-converter' => 'examples/unit-converter'
=== renamed directory 'modules/Ubuntu/Components/10' => 'modules/Ubuntu/Components/1.0'
=== renamed file 'modules/Ubuntu/Components/10/10.pro' => 'modules/Ubuntu/Components/1.0/1.0.pro'
--- modules/Ubuntu/Components/10/10.pro 2014-11-21 15:26:25 +0000
+++ modules/Ubuntu/Components/1.0/1.0.pro 2015-05-06 10:32:32 +0000
@@ -2,8 +2,8 @@
22
3CONFIG+=ubuntu_qml_module3CONFIG+=ubuntu_qml_module
44
5uri = Ubuntu.Components.105uri = Ubuntu.Components
6installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /)6installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /)/1.0
77
8qml_files.installPath = $$installPath8qml_files.installPath = $$installPath
9qml_files.files = *.qml \9qml_files.files = *.qml \
1010
=== renamed directory 'modules/Ubuntu/Components/11' => 'modules/Ubuntu/Components/1.1'
=== renamed file 'modules/Ubuntu/Components/11/11.pro' => 'modules/Ubuntu/Components/1.1/1.1.pro'
--- modules/Ubuntu/Components/11/11.pro 2014-11-21 15:26:25 +0000
+++ modules/Ubuntu/Components/1.1/1.1.pro 2015-05-06 10:32:32 +0000
@@ -2,8 +2,8 @@
22
3CONFIG+=ubuntu_qml_module3CONFIG+=ubuntu_qml_module
44
5uri = Ubuntu.Components.115uri = Ubuntu.Components
6installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /)6installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /)/1.1
77
8qml_files.installPath = $$installPath8qml_files.installPath = $$installPath
9qml_files.files = *.qml9qml_files.files = *.qml
1010
=== modified file 'modules/Ubuntu/Components/1.1/Haptics.qml'
--- modules/Ubuntu/Components/11/Haptics.qml 2015-03-03 13:47:48 +0000
+++ modules/Ubuntu/Components/1.1/Haptics.qml 2015-05-06 10:32:32 +0000
@@ -17,7 +17,7 @@
17pragma Singleton17pragma Singleton
18import QtQuick 2.418import QtQuick 2.4
19import QtFeedback 5.019import QtFeedback 5.0
20import Ubuntu.Components 1.220import Ubuntu.Components 1.3 // FIXME move back to import 1.2 once we get 1.2 sources in
2121
22/*!22/*!
23 \qmltype Haptics23 \qmltype Haptics
2424
=== added directory 'modules/Ubuntu/Components/1.2'
=== added file 'modules/Ubuntu/Components/1.2/1.2.pro'
--- modules/Ubuntu/Components/1.2/1.2.pro 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/1.2.pro 2015-05-06 10:32:32 +0000
@@ -0,0 +1,15 @@
1TEMPLATE = aux
2
3CONFIG+=ubuntu_qml_module
4
5uri = Ubuntu.Components
6installPath = $$[QT_INSTALL_QML]/$$replace(uri, \\., /)/1.2
7
8qml_files.installPath = $$installPath
9qml_files.files = *.qml
10
11# javascript files
12js_files.installPath = $$installPath
13js_files.files = *.js
14
15UBUNTU_QML_MODULE_FILES += qml_files js_files
016
=== added file 'modules/Ubuntu/Components/1.2/AbstractButton.qml'
--- modules/Ubuntu/Components/1.2/AbstractButton.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/AbstractButton.qml 2015-05-06 10:32:32 +0000
@@ -0,0 +1,109 @@
1/*
2 * Copyright 2012 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.2
19
20/*!
21 \qmlabstract AbstractButton
22 \inqmlmodule Ubuntu.Components 1.1
23 \ingroup ubuntu
24 \brief The AbstractButton class defines the behavior of the button.
25
26 This class defines the behavior of the button: it defines the MouseArea
27 and the states.
28 All components deriving from this class support haptic feedback out of the box.
29*/
30ActionItem {
31 id: button
32
33 /*!
34 If an action is specified, the button's clicked signal will trigger the action.
35 Subclasses of AbstractButton can use other properties of action (for example
36 the text and iconName).
37 \qmlproperty Action action
38 */
39
40 /*!
41 This handler is called when there is a mouse click on the button
42 and the button is not disabled. If \b action is defined,
43 the action will be triggered.
44 */
45 signal clicked()
46
47 /*!
48 If a button is clicked, its triggered() signal will automatically be called.
49 */
50 onClicked: button.trigger()
51
52 Keys.onEnterPressed: clicked()
53 Keys.onReturnPressed: clicked()
54
55 /*!
56 This handler is called when there is a long press.
57 */
58 signal pressAndHold()
59
60 /*!
61 True if the user presses a mouse button in the button's mouse area.
62 */
63 property bool pressed: mouseArea.pressed
64
65 /*!
66 True if the mouse cursor hovers over the button's mouse area.
67 */
68 property bool hovered: __acceptEvents && mouseArea.containsMouse
69
70 /*!
71 \internal
72 Disable or enable signal emition by default.
73 Some classes want to emit the signal by themselves (ListItem.Standard)
74 */
75 property bool __acceptEvents: true
76
77 /*!
78 \internal
79 To get the properties of the mouse area in subclasses.
80 */
81 property alias __mouseArea: mouseArea
82
83 activeFocusOnPress: true
84
85 MouseArea {
86 id: mouseArea
87 anchors.fill: parent
88 // if mouseArea is given a new value, disable defaultMouseArea
89 // as it might occlude the newly assigned mouse area.
90 hoverEnabled: true
91
92 // invoke Haptics singleton earlier than we press the button,
93 // so we give some time for the singleton to sync settings with the service
94 property bool hapticsEnabled: Haptics.enabled
95
96 onClicked: {
97 if (button.__acceptEvents) {
98 // FIXME (Vivid) call this in the style rather than from AbstractButton
99 Haptics.play();
100 button.clicked()
101 }
102 }
103 onPressAndHold: {
104 if (button.__acceptEvents) {
105 button.pressAndHold()
106 }
107 }
108 }
109}
0110
=== added file 'modules/Ubuntu/Components/1.2/ActionItem.qml'
--- modules/Ubuntu/Components/1.2/ActionItem.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/ActionItem.qml 2015-05-06 10:32:32 +0000
@@ -0,0 +1,96 @@
1/*
2 * Copyright 2012 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.2
19
20/*!
21 \qmlabstract ActionItem
22 \inqmlmodule Ubuntu.Components 1.1
23 \ingroup ubuntu
24 \brief A visual representation of an Action. The API of ActionItem is a
25 copy of the API of \l Action, with additional properties to define
26 visual aspects of the ActionItem.
27
28 If \l action is set, the values of the other properties will by default
29 be identical to the \l Action's property values. Setting the other properties
30 will override the properties copied from the \l Action.
31
32 See \l ToolbarItems for examples of how to use \l ToolbarButton or other ActionItems
33 in a toolbar.
34*/
35StyledItem {
36 id: actionItem
37
38 /*!
39 The \l Action associated with this ActionItem. If action is set,
40 the values of the Action properties are copied to the values of
41 the ActionItem properties.
42 */
43 property Action action: null
44
45 visible: action ? action.visible : true
46 enabled: action ? action.enabled : true
47
48 /*!
49 The title of the actionItem.
50 Default value: action.text
51 */
52 property string text: action ? action.text : ""
53
54 /*!
55 The image associated with the actionItem.
56 Default value: action.iconSource.
57
58 This is the URL of any image file
59 If both iconSource and iconName are defined, iconName will be ignored.
60 */
61 property url iconSource: action ? action.iconSource : (iconName ? "image://theme/" + iconName : "")
62
63 /*!
64 The icon associated with the actionItem in the suru icon theme.
65 Default value: action.iconName.
66
67 \note The complete list of icons available in Ubuntu is not published yet.
68 For now please refer to the folders where the icon themes are installed:
69 \list
70 \li Ubuntu Touch: \l file:/usr/share/icons/suru
71 \li Ubuntu Desktop: \l file:/usr/share/icons/ubuntu-mono-dark
72 \endlist
73 These 2 separate icon themes will be merged soon.
74
75 If both iconSource and iconName are defined, iconName will be ignored.
76 */
77 property string iconName: action ? action.iconName : ""
78
79 /*!
80 Called when the actionItem is triggered.
81 */
82 signal triggered(var value)
83
84 /*!
85 If \l action is set, this will trigger it.
86 */
87 onTriggered: if (action) action.trigger(value)
88
89 /*!
90 Trigger this action item if it is enabled.
91 */
92 function trigger(value) {
93 var passingValue = value ? value : null
94 if (actionItem.enabled) actionItem.triggered(passingValue);
95 }
96}
097
=== added file 'modules/Ubuntu/Components/1.2/ActionList.qml'
--- modules/Ubuntu/Components/1.2/ActionList.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/ActionList.qml 2015-05-06 10:32:32 +0000
@@ -0,0 +1,47 @@
1/*
2 * Copyright 2012 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.2
19
20/*!
21 \qmltype ActionList
22 \inqmlmodule Ubuntu.Components 1.1
23 \ingroup ubuntu
24 \brief List of \l Action items
25*/
26
27QtObject {
28 id: list
29 // internal objects using nested elements,
30 // which isn't allowed by QtObject; this fix makes this possible
31 /*!
32 Default property to allow adding of children.
33 \qmlproperty list<Action> children
34 \default
35 */
36 default property alias children: list.actions
37
38 /*!
39 List of already defined actions when not defining them as children of the ActionList.
40 Note that when you set this property, the children of the ActionList will be ignored,
41 so do not set the list and define children.
42
43 The advantage of setting actions over using the children is that the same
44 \l Action items can be used in several sets of actions.
45 */
46 property list<Action> actions
47}
048
=== added file 'modules/Ubuntu/Components/1.2/ActivityIndicator.qml'
--- modules/Ubuntu/Components/1.2/ActivityIndicator.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/ActivityIndicator.qml 2015-05-06 10:32:32 +0000
@@ -0,0 +1,59 @@
1/*
2 * Copyright 2012 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18
19/*!
20 \qmltype ActivityIndicator
21 \inqmlmodule Ubuntu.Components 1.1
22 \ingroup ubuntu
23 \brief The ActivityIndicator component visually indicates that a task of
24 unknown duration is in progress, e.g. busy indication, connection in progress
25 indication, etc.
26
27 Note: for time consuming JavaScript operations use WorkerScript, otherwise no
28 UI interaction will be possible and the ActicityIndicator animation will freeze.
29
30 Example:
31 \qml
32 Item {
33 ActivityIndicator {
34 id: activity
35 }
36
37 Button {
38 id: toggleActive
39 text: (activity.running) ? "Deactivate" : "Activate"
40 onClicked: activity.running = !activity.running
41 }
42 }
43 \endqml
44*/
45AnimatedItem {
46 id: indicator
47
48 /*!
49 Presents whether there is activity to be visualized or not. The default value is false.
50 When activated (set to true), an animation is shown indicating an ongoing activity, which
51 continues until deactivated (set to false).
52 */
53 property bool running: false
54
55 implicitWidth: units.gu(3)
56 implicitHeight: units.gu(3)
57
58 style: Theme.createStyleComponent("ActivityIndicatorStyle.qml", indicator)
59}
060
=== added file 'modules/Ubuntu/Components/1.2/AnimatedItem.qml'
--- modules/Ubuntu/Components/1.2/AnimatedItem.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/AnimatedItem.qml 2015-05-06 10:32:32 +0000
@@ -0,0 +1,37 @@
1/*
2 * Copyright 2012 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17/*!
18 \qmltype AnimatedItem
19 \inqmlmodule Ubuntu.Components 1.1
20 \ingroup ubuntu
21 \brief The AnimatedItem drives the animated components behavior inside a Flickable.
22 Reports whether the component whos parent is a Flickable is in the visible area or not,
23 so derived components can pause animations while off-screen.
24
25*/
26
27import QtQuick 2.4
28import Ubuntu.Components 1.2
29
30StyledItem {
31 id: root
32 /*!
33 \deprecated
34 Specifies whether the component is on the visible area of the Flickable or not.
35 */
36 property bool onScreen: true
37}
038
=== added file 'modules/Ubuntu/Components/1.2/AppHeader.qml'
--- modules/Ubuntu/Components/1.2/AppHeader.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/AppHeader.qml 2015-05-06 10:32:32 +0000
@@ -0,0 +1,258 @@
1/*
2 * Copyright 2013-2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.2 as Components
19
20/*!
21 \internal
22 \qmltype AppHeader
23 \inqmlmodule Ubuntu.Components 1.1
24 \ingroup ubuntu
25*/
26Components.StyledItem {
27 id: header
28
29 anchors {
30 left: parent.left
31 right: parent.right
32 }
33 y: 0
34
35 /*!
36 Animate showing and hiding of the header.
37 */
38 property bool animate: true
39
40 /*!
41 The background color of the divider. Value set by MainView.
42 */
43 property color dividerColor
44
45 /*!
46 The background color of the panel. Value set by MainView.
47 */
48 property color panelColor
49
50 Behavior on y {
51 enabled: animate && !(header.flickable && header.flickable.moving)
52 SmoothedAnimation {
53 duration: Components.UbuntuAnimation.BriskDuration
54 }
55 }
56
57 /*! \internal */
58 onHeightChanged: {
59 internal.checkFlickableMargins();
60 internal.movementEnded();
61 }
62
63 visible: title || contents || tabsModel
64 onVisibleChanged: {
65 internal.checkFlickableMargins();
66 }
67
68 /*!
69 Show the header
70 */
71 function show() {
72 header.y = 0;
73 }
74
75 /*!
76 Hide the header
77 */
78 function hide() {
79 header.y = - header.height;
80 }
81
82 /*!
83 The text to display in the header
84 */
85 property string title: ""
86 onTitleChanged: {
87 header.show();
88 }
89
90 /*!
91 The contents of the header. If this is set, \l title will be ignored.
92 */
93 property Item contents: null
94 onContentsChanged: {
95 header.show();
96 }
97
98 /*!
99 A model of tabs to represent in the header.
100 This is automatically set by \l Tabs.
101 */
102 property var tabsModel: null
103
104 /*!
105 If it is possible to pop this PageStack, a back button will be
106 shown in the header.
107 */
108 property var pageStack: null
109
110 /*!
111 \deprecated
112 \qmlproperty list<Action> actions
113 The list of actions actions that will be shown in the header.
114 DEPRECATED. Use Page.head.actions instead.
115 */
116 property var actions
117 onActionsChanged: print("WARNING: Header.actions property is DEPRECATED. "+
118 "Use Page.head.actions instead.")
119
120 /*!
121 \internal
122 \deprecated
123 Action shown before the title. Setting this will disable the back
124 button and tabs drawer button in the new header and replace it with a button
125 representing the action below.
126 DEPRECATED. Use Page.head.backAction property instead.
127 */
128 property var __customBackAction: null
129
130 // FIXME: Currently autopilot can only get visual items, but once bug #1273956
131 // is fixed to support non-visual items, a QtObject may be used.
132 // --timp - 2014-03-20
133 Item {
134 // FIXME: This is a workaround to be able to get the properties of
135 // tabsModel in an autopilot test.
136 objectName: "tabsModelProperties"
137 property int count: tabsModel ? tabsModel.count : 0
138 property int selectedIndex: tabsModel ? tabsModel.selectedIndex : -1
139 }
140 Item {
141 // FIXME: This is a workaround to be able to get the properties of
142 // the sections in an autopilot test.
143 objectName: "sectionsProperties"
144 property int selectedIndex: header.config ? header.config.sections.selectedIndex : -1
145 }
146
147 /*!
148 The flickable that controls the movement of the header.
149 Will be set automatically by Pages inside a MainView, but can
150 be overridden.
151 */
152 property Flickable flickable: null
153 onFlickableChanged: {
154 internal.checkFlickableMargins();
155 internal.connectFlickable();
156 header.show();
157 }
158
159 /*!
160 Set by \l MainView
161 */
162 property bool useDeprecatedToolbar: true
163
164 /*!
165 Configuration of the header.
166 */
167 property PageHeadConfiguration config: null
168
169 QtObject {
170 id: internal
171
172 /*!
173 Track the y-position inside the flickable.
174 */
175 property real previousContentY: 0
176
177 /*!
178 The previous flickable to disconnect events
179 */
180 property Flickable previousFlickable: null
181
182 /*!
183 Disconnect previous flickable, and connect the new one.
184 */
185 function connectFlickable() {
186 if (previousFlickable) {
187 previousFlickable.contentYChanged.disconnect(internal.scrollContents);
188 previousFlickable.movementEnded.disconnect(internal.movementEnded);
189 previousFlickable.interactiveChanged.disconnect(internal.interactiveChanged);
190 }
191 if (flickable) {
192 // Connect flicking to movements of the header
193 previousContentY = flickable.contentY;
194 flickable.contentYChanged.connect(internal.scrollContents);
195 flickable.movementEnded.connect(internal.movementEnded);
196 flickable.interactiveChanged.connect(internal.interactiveChanged);
197 flickable.contentHeightChanged.connect(internal.contentHeightChanged);
198 }
199 previousFlickable = flickable;
200 }
201
202 /*!
203 Update the position of the header to scroll with the flickable.
204 */
205 function scrollContents() {
206 // Avoid updating header.y when rebounding or being dragged over the bounds.
207 if (!flickable.atYBeginning && !flickable.atYEnd) {
208 var deltaContentY = flickable.contentY - previousContentY;
209 // FIXME: MathUtils.clamp is expensive. Fix clamp, or replace it here.
210 header.y = MathUtils.clamp(header.y - deltaContentY, -header.height, 0);
211 }
212 previousContentY = flickable.contentY;
213 }
214
215 /*!
216 Fully show or hide the header, depending on its current y.
217 */
218 function movementEnded() {
219 if (flickable && flickable.contentY < 0) header.show();
220 else if (header.y < -header.height/2) header.hide();
221 else header.show();
222 }
223
224 /*
225 Content height of flickable changed
226 */
227 function contentHeightChanged() {
228 if (flickable && flickable.height >= flickable.contentHeight) header.show();
229 }
230
231 /*
232 Flickable became interactive or non-interactive.
233 */
234 function interactiveChanged() {
235 if (flickable && !flickable.interactive) header.show();
236 }
237
238 /*
239 Check the topMargin of the flickable and set it if needed to avoid
240 contents becoming unavailable behind the header.
241 */
242 function checkFlickableMargins() {
243 if (header.flickable) {
244 var headerHeight = header.visible ? header.height : 0
245 if (flickable.topMargin !== headerHeight) {
246 var previousHeaderHeight = flickable.topMargin;
247 flickable.topMargin = headerHeight;
248 // push down contents when header grows,
249 // pull up contents when header shrinks.
250 flickable.contentY -= headerHeight - previousHeaderHeight;
251 }
252 }
253 }
254 }
255
256 style: header.useDeprecatedToolbar ? Theme.createStyleComponent("HeaderStyle.qml", header) :
257 Theme.createStyleComponent("PageHeadStyle.qml", header)
258}
0259
=== added file 'modules/Ubuntu/Components/1.2/Captions.qml'
--- modules/Ubuntu/Components/1.2/Captions.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/Captions.qml 2015-05-06 10:32:32 +0000
@@ -0,0 +1,150 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import QtQuick.Layouts 1.1
19import Ubuntu.Components 1.2
20
21/*!
22 \qmltype Captions
23 \inqmlmodule Ubuntu.Components 1.2
24 \ingroup ubuntu-listitem
25 \since Ubuntu.Components 1.2
26 \brief Container providing captionStyles for a twin-label column that can be used in
27 RowLayout or GridLayout.
28
29 The labels are placed in a column and can be accessed through \l title and
30 \l subtitle properties. The default spacing between the labels is 0.5 grid units.
31
32 The container only shows the labels which has its text property set to a valid
33 string. The labels not having any text set are not occupying the space. When
34 embedded in a positioner or in a RowLayout, the container is aligned vertically
35 centered. It is recommended to be used in context with RowLayout or GridLayout,
36 however can be used with any component.
37
38 \qml
39 import QtQuick 2.4
40 import Ubuntu.Components 1.2
41
42 ListItem {
43 RowLayout {
44 Captions {
45 title.text: "Caption"
46 subtitle.text: "Subtitle text"
47 // attached properties of an Item type property
48 // can be changed only with assignment
49 Component.onCompleted: subtitle.Layout.alignment = Qt.AlignRight
50 }
51 Captions {
52 captionStyle: Ubuntu.SummaryCaptionStyle
53 title.text: "Text"
54 subtitle.text: "Text"
55 }
56 }
57 }
58 \endqml
59
60 Additional items can also be added to the layout after the two labels.
61 \qml
62 Captions {
63 title.text: "Caption"
64 subtitle.text: "Subtitle"
65 Label {
66 text: "third line"
67 fontSize: "xx-small"
68 }
69 }
70 \endqml
71 */
72ColumnLayout {
73 id: captions
74
75 /*!
76 \qmlproperty enumeration captionStyle
77 The property configures the arrangement and font sizes of the Labels in the
78 component. It can take the following values:
79 \list
80 \li \b Ubuntu.TitleCaptionStyle - (default) typical configuration for a left aligned
81 twin-label setup, where the text covers the remaining area on a list
82 layout.
83 \li \b Ubuntu.SummaryCaptionStyle - configuration for a right-aligned twin label setup,
84 with 6 grid units width.
85 \endlist
86 */
87 property int captionStyle: Ubuntu.TitleCaptionStyle
88
89 /*!
90 \qmlproperty Label title
91 \readonly
92 Label occupying the top area of the container.
93 */
94 property alias title: titleLabel
95
96 /*!
97 \qmlproperty Label subtitle
98 \readonly
99 Label occupying the bottom area of the container.
100 */
101 property alias subtitle: subtitleLabel
102
103 clip: true
104 spacing: units.gu(0.5)
105 Layout.fillWidth: (captionStyle == Ubuntu.TitleCaptionStyle)
106 Layout.alignment: Qt.AlignVCenter | ((captionStyle == Ubuntu.SummaryCaptionStyle) ? Qt.AlignRight : Qt.AlignLeft)
107 Layout.minimumWidth: 0
108 Layout.maximumWidth: (captionStyle == Ubuntu.SummaryCaptionStyle) ? units.gu(6) : parent.width
109 Layout.preferredWidth: (captionStyle == Ubuntu.SummaryCaptionStyle) ? Layout.maximumWidth : 0
110 Layout.minimumHeight: 0
111 Layout.maximumHeight: parent ? parent.height : childrenRect.height
112 Layout.preferredHeight: childrenRect.height
113
114 // handle visibility, do not override visible property!
115 // 'hide' column if title and subtitle is an empty string and
116 // there's no more children added
117 states: State {
118 name: "__q_invisible"
119 when: (title.text === "" && subtitle.text === "") && (captions.children.length == 2)
120 PropertyChanges {
121 target: captions
122 visible: false
123 }
124 }
125
126 Label {
127 id: titleLabel
128 anchors {
129 left: parent.left
130 right: parent.right
131 }
132 fontSize: (captionStyle == Ubuntu.SummaryCaptionStyle) ? "small" : "medium"
133 horizontalAlignment: (captionStyle == Ubuntu.SummaryCaptionStyle) ? Text.AlignRight : Text.AlignLeft
134 visible: text !== ""
135 elide: (captionStyle == Ubuntu.TitleCaptionStyle) ? Text.ElideRight : Text.ElideNone
136 }
137 Label {
138 id: subtitleLabel
139 anchors {
140 left: parent.left
141 right: parent.right
142 }
143 fontSize: "small"
144 horizontalAlignment: (captionStyle == Ubuntu.SummaryCaptionStyle) ? Text.AlignRight : Text.AlignLeft
145 visible: text !== ""
146 maximumLineCount: (captionStyle == Ubuntu.TitleCaptionStyle) ? 2 : 1
147 wrapMode: (captionStyle == Ubuntu.TitleCaptionStyle) ? Text.Wrap : Text.NoWrap
148 elide: (captionStyle == Ubuntu.TitleCaptionStyle) ? Text.ElideRight : Text.ElideNone
149 }
150}
0151
=== added file 'modules/Ubuntu/Components/1.2/CheckBox.qml'
--- modules/Ubuntu/Components/1.2/CheckBox.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/CheckBox.qml 2015-05-06 10:32:32 +0000
@@ -0,0 +1,53 @@
1/*
2 * Copyright 2012 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18
19/*!
20 \qmltype CheckBox
21 \inqmlmodule Ubuntu.Components 1.1
22 \ingroup ubuntu
23 \brief CheckBox is a component with two states, checked or unchecked. It can
24 be used to set boolean options. The behavior is the same as \l Switch, the
25 only difference is the graphical style.
26
27 \l {https://design.ubuntu.com/apps/building-blocks/selection}{See also the Design Guidelines on selection}.
28
29 Example:
30 \qml
31 Item {
32 CheckBox {
33 checked: true
34 }
35 }
36 \endqml
37*/
38AbstractButton {
39 id: checkBox
40
41 /*!
42 Specifies whether the checkbox is checked or not. By default the property
43 is set to false.
44 */
45 property bool checked: false
46
47 /*!
48 \internal
49 */
50 onTriggered: checked = !checked
51
52 style: Theme.createStyleComponent("CheckBoxStyle.qml", checkBox)
53}
054
=== added file 'modules/Ubuntu/Components/1.2/ComboButton.qml'
--- modules/Ubuntu/Components/1.2/ComboButton.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/ComboButton.qml 2015-05-06 10:32:32 +0000
@@ -0,0 +1,367 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components.Popups 1.0
19import Ubuntu.Components 1.2 as Toolkit
20
21/*!
22 \qmltype ComboButton
23 \inqmlmodule Ubuntu.Components 1.1
24 \ingroup ubuntu
25 \brief Ubuntu button providing a drop-down panel visualizing custom options.
26
27 The component is composed of three main blocks: \b {main button}, \b {dropdown}
28 and \b {combo list}.
29
30 The \a {main button} holds the main functionailty of the component, and it is
31 located at the left-top side of the expanded button. The \a clicked() signal
32 is triggered only when this button is pressed.
33
34 The \a {dropdown} is a button located on the right of the main button. Its
35 functionality is to drive the component's expanded state.
36
37 The \a {combo list} is a panel showing the content specified in \l comboList
38 property when expanded. The content is stretched horizontally to the component's
39 width, and its height is controlled by the \l expandedHeight property as follows:
40 \list
41 \li If the content height is smaller than the value of \l expandedHeight, the combo
42 list will be expanded only to the height of the content.
43 \qml
44 import QtQuick 2.4
45 import Ubuntu.Components 1.2
46 ComboButton {
47 text: "smaller content"
48 Rectangle {
49 height: units.gu(5) // smaller than the default expandedHeight
50 color: "blue"
51 }
52 }
53 \endqml
54 \li If the content height is greater than \l expandedHeight, the combo list will
55 expand till the height specified by the property and the content will be
56 scrolled; in case the combo list content is one single Flickable, ListView,
57 GridView or PathView, the content scrolling will be provided by the content
58 itself.
59 \qml
60 import QtQuick 2.4
61 import Ubuntu.Components 1.2
62 ComboButton {
63 text: "long scrolled content"
64 Column {
65 Repeater {
66 model: 5
67 spacing: units.gu(1)
68 Rectangle {
69 height: units.gu(5)
70 color: "blue"
71 }
72 }
73 }
74 }
75 \endqml
76 \li In case the content is a single Flickable, ListView, GridView or PathView,
77 the content will be filling the entire combo list area defined.
78 \qml
79 import QtQuick 2.4
80 import Ubuntu.Components 1.2
81 import Ubuntu.Components.ListItems 1.0
82 ComboButton {
83 text: "listview"
84 ListView {
85 model: 10
86 delegate: Standard {
87 text: "Item #" + modelData
88 }
89 }
90 }
91 \endqml
92 \li Vertical anchoring of combo list content to its parent is not possible
93 as the expansion calculation is done based on the combo list content height.
94 If the content wants to take the size of the entire combo list, it should
95 bind its height to the \l comboListHeight property.
96 \qml
97 import QtQuick 2.4
98 import Ubuntu.Components 1.2
99 ComboButton {
100 id: combo
101 text: "smaller content"
102 Rectangle {
103 height: combo.comboListHeight
104 color: "blue"
105 }
106 }
107 \endqml
108 \li In case the expansion needs to be the size of the combo list content, the \l
109 expandedHeight should be set to -1.
110 \qml
111 import QtQuick 2.4
112 import Ubuntu.Components 1.2
113 ComboButton {
114 text: "auto-sized content"
115 expandedHeight: -1
116 Column {
117 Repeater {
118 model: 5
119 spacing: units.gu(1)
120 Button {
121 text: "Button #" + modelData
122 }
123 }
124 }
125 }
126 \endqml
127 \endlist
128
129 The combo list can be expanded/collapsed either through the \l expanded property
130 or by clicking on the dropdown button. It is not collapsed when pressing the main
131 button or clicking on the combo list. In order to do an auto-collapsing button
132 you must reset the expanded property (set it to false) when the main button is
133 clicked or when a selection is taken from the combo list content. The following
134 example illustrates a possible implementation.
135
136 \qml
137 import QtQuick 2.4
138 import Ubuntu.Components 1.2
139
140 ComboButton {
141 id: combo
142 text: "Auto closing"
143 expanded: true
144 expandedHeight: units.gu(30)
145 onClicked: expanded = false
146 UbuntuListView {
147 width: parent.width
148 height: combo.comboListHeight
149 model: 20
150 delegate: Standard {
151 text: "Action #" + modelData
152 onClicked: {
153 combo.text = text;
154 combo.expanded = false;
155 }
156 }
157 }
158 }
159 \endqml
160
161 \section2 Styling
162 The style of the component is defined in \l ComboButtonStyle.
163 */
164Toolkit.Button {
165 id: combo
166
167 /*!
168 Specifies whether the combo list is expanded or not. The default falue is
169 false.
170 */
171 property bool expanded: false
172
173 /*!
174 The property holds the height of the component when collapsed. By default
175 the value is the implicit height of the component.
176 */
177 property real collapsedHeight: implicitHeight
178
179 /*!
180 The property holds the maximum height value the component should expand.
181 When setting the property, remember to take into account the \l collapsedHeight
182 value. The best practice is to use bind it with collapsedHeight.
183 \qml
184 ComboButton {
185 text: "altered expandedHeight"
186 expandedHeight: collapsedHeight + units.gu(25)
187 }
188 \endqml
189
190 A value of -1 will instruct the component to expand the combo list as
191 much as its content height is.
192
193 The default value is \l collapsedHeight + 19.5 GU, so at least 3 ListItems
194 can fit in the combo list.
195 \sa collapsedHeight
196 */
197 property real expandedHeight: collapsedHeight + units.gu(19.5)
198
199 /*!
200 The property holds the maximum combo list height allowed based on the
201 \l expandedHeight and \l collapsedHeight values. It is a convenience property
202 that can be used to size the combo list content.
203 \qml
204 import QtQuick 2.4
205 import Ubuntu.Components 1.2
206 import Ubuntu.Components.ListItems 0.1
207 ComboButton {
208 id: combo
209 text: "Full comboList size"
210 ListView {
211 anchors {
212 left: parent.left
213 right: parent.right
214 }
215 height: combo.comboListHeight
216 model: 20
217 delegate: Standard {
218 text: "Action #" + modelData
219 }
220 }
221 }
222 \endqml
223
224 \sa collapsedHeight, expandedHeight
225 */
226 readonly property real comboListHeight: (expandedHeight < 0) ?
227 comboListHolder.height :
228 (expandedHeight - collapsedHeight -
229 (combo.__styleInstance ? combo.__styleInstance.comboListMargin : 0))
230
231 /*!
232 \qmlproperty list<Item> comboList
233 \default
234 Property holding the list of items to be shown in the combo list. Being
235 a default property children items declared will land in the combo list.
236 \note The component is not responsible for layouting the content. It only
237 provides scrolling abilities for the case the content exceeds the defined
238 expanded height.
239 */
240 default property alias comboList: comboListHolder.data
241
242 /* ----------------- Color and font configurations ----------------- */
243 /*!
244 The property specifies the color of the dropdown button and the combo list
245 for both collapsed and expanded states. You can use \l expanded to define
246 different colors for expanded or collapsed states.
247 */
248 property color dropdownColor: __styleInstance ? __styleInstance.defaultDropdownColor : color
249
250
251 style: Theme.createStyleComponent("ComboButtonStyle.qml", combo)
252
253 Component.onCompleted: {
254 // update mouse area to report clicks only on the main button area
255 // area excluding dropDown button and combo list
256 // we must do separate bindings as __mouseArea is a read-only property
257 __mouseArea.anchors.fill = undefined;
258 __mouseArea.anchors.left = Qt.binding(function() {return combo.left;});
259 __mouseArea.anchors.top = Qt.binding(function() {return combo.top;});
260 __mouseArea.anchors.right = Qt.binding(function() {return combo.right;});
261 __mouseArea.anchors.rightMargin = Qt.binding(function() {return combo.__styleInstance.dropDownWidth + combo.__styleInstance.dropDownSeparatorWidth;});
262 __mouseArea.height = Qt.binding(function() {return collapsedHeight;});
263 // for autopilot, set the main button name
264 __mouseArea.objectName = "combobutton_mainbutton";
265
266 // bind a height calculation to avoid unwanted change
267 combo.height = Qt.binding(function() {return collapsedHeight + __styleInstance.comboListPanel.height});
268 }
269
270 // dropdown button
271 AbstractButton {
272 id: dropDown
273 objectName: "combobutton_dropdown"
274 anchors {
275 right: parent.right
276 top: parent.top
277 }
278 width: combo.__styleInstance ? combo.__styleInstance.dropDownWidth : 0
279 height: combo.collapsedHeight
280 // open dropdown when pressed, not when clicked
281 onClicked: {
282 // toggle expanded
283 combo.expanded = !combo.expanded;
284 }
285 }
286
287 // expansion list
288 Flickable {
289 id: comboHolder
290 objectName: "combobutton_contentflicker"
291 parent: combo.__styleInstance ? combo.__styleInstance.comboListHolder : combo
292 anchors.fill: parent
293 interactive: combo.expanded && !contentIsFlickable() && (combo.expandedHeight > 0)
294 flickableDirection: Flickable.VerticalFlick
295 contentHeight: comboListHolder.height
296
297 // consider PathView as Flickable in this case as well!
298 function contentIsFlickable() {
299 return (comboListHolder.children.length === 1) &&
300 comboListHolder.children[0].hasOwnProperty("flicking");
301 }
302
303 Item {
304 id: comboListHolder
305 objectName: "combobutton_combolist"
306 anchors {
307 left: parent.left
308 right: parent.right
309 }
310
311 // stretch children width to holder's width
312 // must do binding to height manually to avoid binding loops caused
313 // by the vertical stretching when the component is a single flickable
314 property bool stretch: (combo.expandedHeight > 0 && comboHolder.contentIsFlickable())
315 onStretchChanged: stretchChildren()
316 onChildrenChanged: stretchChildren()
317 function stretchChildren() {
318 for (var i in comboListHolder.children) {
319 var child = comboListHolder.children[i];
320 if (comboListHolder.stretch) {
321 child.anchors.left = undefined;
322 child.anchors.right = undefined;
323 child.anchors.fill = comboListHolder;
324 comboListHolder.height = Qt.binding(function() {
325 return combo.comboListHeight;
326 });
327 } else {
328 child.anchors.left = comboListHolder.left;
329 child.anchors.right = comboListHolder.right;
330 comboListHolder.height = Qt.binding(function() {
331 return comboListHolder.childrenRect.height;
332 });
333 }
334 }
335 }
336 }
337 }
338 Scrollbar {
339 flickableItem: comboHolder
340 }
341
342 /*
343 Drive the expansion height of the combo list holder
344 This is a common functionaity in all combo buttons, therefore we can have it
345 in the main component.
346 */
347 Binding {
348 target: combo.__styleInstance.comboListPanel
349 property: "height"
350 value: {
351 if (!expanded) {
352 return 0;
353 }
354 if (comboListHolder.stretch) {
355 return combo.comboListHeight + combo.__styleInstance.comboListMargin;
356 }
357
358 var h = comboListHolder.height;
359 var max = combo.comboListHeight + combo.__styleInstance.comboListMargin;
360 if (combo.expandedHeight < 0) {
361 return max;
362 }
363
364 return Toolkit.MathUtils.clamp(h, 0, max);
365 }
366 }
367}
0368
=== added file 'modules/Ubuntu/Components/1.2/CrossFadeImage10.qml'
--- modules/Ubuntu/Components/1.2/CrossFadeImage10.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/CrossFadeImage10.qml 2015-05-06 10:32:32 +0000
@@ -0,0 +1,173 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18// FIXME: When a module contains QML, C++ and JavaScript elements exported,
19// we need to use named imports otherwise namespace collision is reported
20// by the QML engine. As workaround, we use Ubuntu named import.
21// Bug to watch: https://bugreports.qt-project.org/browse/QTBUG-27645
22import Ubuntu.Components 1.2 as Ubuntu
23
24/*!
25 \internal
26 Documentation is in CrossFadeImage.qdoc
27*/
28Item {
29 id: crossFadeImage
30
31 property url source
32
33 property int fillMode : Image.PreserveAspectFit
34
35 property int fadeDuration: Ubuntu.UbuntuAnimation.FastDuration
36
37 // FIXME: Support resetting sourceSize
38 property size sourceSize: internals.loadingImage ? Qt.size(internals.loadingImage.sourceSize.width, internals.loadingImage.sourceSize.height) : Qt.size(0, 0)
39
40 readonly property bool running: nextImageFadeIn.running
41
42 readonly property int status: internals.loadingImage ? internals.loadingImage.status : Image.Null
43
44 Binding {
45 target: crossFadeImage
46 property: "sourceSize"
47 value: internals.loadingImage ? Qt.size(internals.loadingImage.sourceSize.width, internals.loadingImage.sourceSize.height) : Qt.size(0, 0)
48 when: internals.forcedSourceSize === undefined
49 }
50
51 /*!
52 \internal
53 */
54 onSourceSizeChanged: {
55 if (internals.loadingImage && (sourceSize != Qt.size(internals.loadingImage.sourceSize.width, internals.loadingImage.sourceSize.height))) {
56 internals.forcedSourceSize = sourceSize;
57 }
58 }
59
60 QtObject {
61 id: internals
62
63 /*! \internal
64 Source size specified by the setting crossFadeImage.sourceSize.
65 */
66 property size forcedSourceSize
67
68 /*! \internal
69 Defines the image currently being shown
70 */
71 property Image currentImage: image1
72
73 /*! \internal
74 Defines the image being changed to
75 */
76 property Image nextImage: image2
77
78 property Image loadingImage: currentImage
79
80 function swapImages() {
81 internals.currentImage.z = 0;
82 internals.nextImage.z = 1;
83 nextImageFadeIn.start();
84
85 var tmpImage = internals.currentImage;
86 internals.currentImage = internals.nextImage;
87 internals.nextImage = tmpImage;
88 }
89 }
90
91 Image {
92 id: image1
93 anchors.fill: parent
94 cache: false
95 asynchronous: true
96 fillMode: parent.fillMode
97 z: 1
98 Binding {
99 target: image1
100 property: "sourceSize"
101 value: internals.forcedSourceSize
102 when: internals.forcedSourceSize !== undefined
103 }
104 }
105
106 Image {
107 id: image2
108 anchors.fill: parent
109 cache: false
110 asynchronous: true
111 fillMode: parent.fillMode
112 z: 0
113 Binding {
114 target: image2
115 property: "sourceSize"
116 value: internals.forcedSourceSize
117 when: internals.forcedSourceSize !== undefined
118 }
119 }
120
121 /*!
122 \internal
123 Do the fading when the source is updated
124 */
125 onSourceChanged: {
126 // On creation, the souce handler is called before image pointers are set.
127 if (internals.currentImage === null) {
128 internals.currentImage = image1;
129 internals.nextImage = image2;
130 }
131
132 nextImageFadeIn.stop();
133
134 // Don't fade in initial picture, only fade changes
135 if (internals.currentImage.source == "") {
136 internals.currentImage.source = source;
137 internals.loadingImage = internals.currentImage;
138 } else {
139 nextImageFadeIn.stop();
140 internals.nextImage.opacity = 0.0;
141 internals.nextImage.source = source;
142 internals.loadingImage = internals.nextImage;
143
144 // If case the image is still in QML's cache, status will be "Ready" immediately
145 if (internals.nextImage.status === Image.Ready || internals.nextImage.source === "") {
146 internals.swapImages();
147 }
148 }
149 }
150
151 Connections {
152 target: internals.nextImage
153 onStatusChanged: {
154 if (internals.nextImage.status == Image.Ready) {
155 internals.swapImages();
156 }
157 }
158 }
159
160 UbuntuNumberAnimation {
161 id: nextImageFadeIn
162 target: internals.nextImage
163 property: "opacity"
164 to: 1.0
165 duration: crossFadeImage.fadeDuration
166
167 onRunningChanged: {
168 if (!running) {
169 internals.nextImage.source = "";
170 }
171 }
172 }
173}
0174
=== added file 'modules/Ubuntu/Components/1.2/CrossFadeImage11.qml'
--- modules/Ubuntu/Components/1.2/CrossFadeImage11.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/CrossFadeImage11.qml 2015-05-06 10:32:32 +0000
@@ -0,0 +1,192 @@
1/*
2 * Copyright (C) 2014 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18// FIXME: When a module contains QML, C++ and JavaScript elements exported,
19// we need to use named imports otherwise namespace collision is reported
20// by the QML engine. As workaround, we use Ubuntu named import.
21// Bug to watch: https://bugreports.qt-project.org/browse/QTBUG-27645
22import Ubuntu.Components 1.2 as Ubuntu
23
24/*!
25 \internal
26 Documentation is in CrossFadeImage.qdoc
27*/
28Item {
29 id: crossFadeImage
30
31 property url source
32
33 property int fillMode : Image.PreserveAspectFit
34
35 property int fadeDuration: Ubuntu.UbuntuAnimation.FastDuration
36
37 // FIXME: Support resetting sourceSize
38 property size sourceSize: internals.loadingImage ? Qt.size(internals.loadingImage.sourceSize.width, internals.loadingImage.sourceSize.height) : Qt.size(0, 0)
39
40 property string fadeStyle: "overlay"
41
42 readonly property bool running: nextImageFadeIn.running
43
44 readonly property int status: internals.loadingImage ? internals.loadingImage.status : Image.Null
45
46 Binding {
47 target: crossFadeImage
48 property: "sourceSize"
49 value: internals.loadingImage ? Qt.size(internals.loadingImage.sourceSize.width, internals.loadingImage.sourceSize.height) : Qt.size(0, 0)
50 when: internals.forcedSourceSize === undefined
51 }
52
53 /*!
54 \internal
55 */
56 onSourceSizeChanged: {
57 if (internals.loadingImage && (sourceSize != Qt.size(internals.loadingImage.sourceSize.width, internals.loadingImage.sourceSize.height))) {
58 internals.forcedSourceSize = sourceSize;
59 }
60 }
61
62 QtObject {
63 id: internals
64
65 /*! \internal
66 Source size specified by the setting crossFadeImage.sourceSize.
67 */
68 property size forcedSourceSize
69
70 /*! \internal
71 Defines the image currently being shown
72 */
73 property Image currentImage: image1
74
75 /*! \internal
76 Defines the image being changed to
77 */
78 property Image nextImage: image2
79
80 property Image loadingImage: currentImage
81
82 function swapImages() {
83 internals.currentImage.z = 0;
84 internals.nextImage.z = 1;
85 nextImageFadeIn.start();
86
87 var tmpImage = internals.currentImage;
88 internals.currentImage = internals.nextImage;
89 internals.nextImage = tmpImage;
90 }
91 }
92
93 QtObject {
94 // dummy object used to disable crossfade animation
95 id: fadeOutDummy
96 property real opacity
97 }
98
99 Image {
100 id: image1
101 anchors.fill: parent
102 cache: false
103 asynchronous: true
104 fillMode: parent.fillMode
105 z: 1
106 Binding {
107 target: image1
108 property: "sourceSize"
109 value: internals.forcedSourceSize
110 when: internals.forcedSourceSize !== undefined
111 }
112 }
113
114 Image {
115 id: image2
116 anchors.fill: parent
117 cache: false
118 asynchronous: true
119 fillMode: parent.fillMode
120 z: 0
121 Binding {
122 target: image2
123 property: "sourceSize"
124 value: internals.forcedSourceSize
125 when: internals.forcedSourceSize !== undefined
126 }
127 }
128
129 /*!
130 \internal
131 Do the fading when the source is updated
132 */
133 onSourceChanged: {
134 // On creation, the souce handler is called before image pointers are set.
135 if (internals.currentImage === null) {
136 internals.currentImage = image1;
137 internals.nextImage = image2;
138 }
139
140 nextImageFadeIn.stop();
141
142 // Don't fade in initial picture, only fade changes
143 if (internals.currentImage.source == "") {
144 internals.currentImage.source = source;
145 internals.loadingImage = internals.currentImage;
146 } else {
147 nextImageFadeIn.stop();
148 internals.nextImage.opacity = 0.0;
149 internals.nextImage.source = source;
150 internals.loadingImage = internals.nextImage;
151
152 // If case the image is still in QML's cache, status will be "Ready" immediately
153 if (internals.nextImage.status === Image.Ready || internals.nextImage.source === "") {
154 internals.swapImages();
155 }
156 }
157 }
158
159 Connections {
160 target: internals.nextImage
161 onStatusChanged: {
162 if (internals.nextImage.status == Image.Ready) {
163 internals.swapImages();
164 }
165 }
166 }
167
168 ParallelAnimation {
169 id: nextImageFadeIn
170
171 Ubuntu.UbuntuNumberAnimation {
172 id: currentImageFadeOut
173 target: fadeStyle == "cross" ? internals.currentImage : fadeOutDummy
174 property: "opacity"
175 to: 0.0
176 duration: crossFadeImage.fadeDuration
177 }
178
179 Ubuntu.UbuntuNumberAnimation {
180 target: internals.nextImage
181 property: "opacity"
182 to: 1.0
183 duration: crossFadeImage.fadeDuration
184 }
185
186 onRunningChanged: {
187 if (!running) {
188 internals.nextImage.source = "";
189 }
190 }
191 }
192}
0193
=== added file 'modules/Ubuntu/Components/1.2/DraggingArea.qml'
--- modules/Ubuntu/Components/1.2/DraggingArea.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/DraggingArea.qml 2015-05-06 10:32:32 +0000
@@ -0,0 +1,114 @@
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import "mathUtils.js" as MathLocal
19
20MouseArea {
21 id: draggingArea
22
23 property int orientation: Qt.Vertical
24 property bool dragging
25 property real dragVelocity: 0
26 property real dragValue: (orientation == Qt.Vertical ? (mouseY - __pressedPosition.y)
27 : (mouseX - __pressedPosition.x))
28 property real lateralPosition: orientation == Qt.Horizontal ? MathLocal.clamp(mouseY, 0, height) : MathLocal.clamp(mouseX, 0, width)
29 property point __pressedPosition: Qt.point(0, 0)
30 property var __dragEvents: []
31 property bool clickValidated: true
32 property bool zeroVelocityCounts: false
33
34
35 signal dragStart
36 signal dragEnd
37
38 onDragValueChanged: {
39 if (dragValue != 0 && pressed) {
40 dragging = true
41 }
42 }
43
44 onDraggingChanged: {
45 if (dragging) {
46 dragStart()
47 }
48 else {
49 dragEnd()
50 }
51 }
52
53 function updateSpeed() {
54 var totalSpeed = 0
55 for (var i=0; i<__dragEvents.length; i++) {
56 totalSpeed += __dragEvents[i][3]
57 }
58
59 if (zeroVelocityCounts || Math.abs(totalSpeed) > 0.001) {
60 dragVelocity = totalSpeed / __dragEvents.length * 1000
61 }
62 }
63
64 function cullOldDragEvents(currentTime) {
65 // cull events older than 50 ms but always keep the latest 2 events
66 for (var numberOfCulledEvents=0; numberOfCulledEvents<__dragEvents.length-2; numberOfCulledEvents++) {
67 // __dragEvents[numberOfCulledEvents][0] is the dragTime
68 if (currentTime - __dragEvents[numberOfCulledEvents][0] <= 50) break
69 }
70
71 __dragEvents.splice(0, numberOfCulledEvents)
72 }
73
74 function getEventSpeed(currentTime, event) {
75 if (__dragEvents.length != 0) {
76 var lastDrag = __dragEvents[__dragEvents.length-1]
77 var duration = Math.max(1, currentTime - lastDrag[0])
78 if (orientation == Qt.Vertical) {
79 return (event.y - lastDrag[2]) / duration
80 } else {
81 return (event.x - lastDrag[1]) / duration
82 }
83 } else {
84 return 0
85 }
86 }
87
88 function pushDragEvent(event) {
89 var currentTime = new Date().getTime()
90 __dragEvents.push([currentTime, event.x, event.y, getEventSpeed(currentTime, event)])
91 cullOldDragEvents(currentTime)
92 updateSpeed()
93 }
94
95 onPositionChanged: {
96 if (dragging) {
97 pushDragEvent(mouse)
98 }
99 if (!draggingArea.containsMouse)
100 clickValidated = false
101 }
102
103 onPressed: {
104 __pressedPosition = Qt.point(mouse.x, mouse.y)
105 __dragEvents = []
106 pushDragEvent(mouse)
107 clickValidated = true
108 }
109
110 onReleased: {
111 dragging = false
112 __pressedPosition = Qt.point(mouse.x, mouse.y)
113 }
114}
0115
=== added file 'modules/Ubuntu/Components/1.2/Header.qml'
--- modules/Ubuntu/Components/1.2/Header.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/Header.qml 2015-05-06 10:32:32 +0000
@@ -0,0 +1,39 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18
19/*!
20 \qmltype Header
21 \internal
22 \deprecated
23*/
24AppHeader {
25
26 /*!
27 \internal
28 We need this property so QML exposes this class as Header instead of
29 AppHeader. This way autopilot can select the deprecated header.
30 */
31 property string _for_autopilot
32
33 Component.onCompleted: {
34 print("WARNING: Header is an internal component of Ubuntu.Components and" +
35 "its API may change or be removed at any moment." +
36 "Please use MainView and Page instead."
37 );
38 }
39}
040
=== renamed file 'modules/Ubuntu/Components/Icon10.qml' => 'modules/Ubuntu/Components/1.2/Icon10.qml'
=== renamed file 'modules/Ubuntu/Components/Icon11.qml' => 'modules/Ubuntu/Components/1.2/Icon11.qml'
=== added file 'modules/Ubuntu/Components/1.2/InputHandler.qml'
--- modules/Ubuntu/Components/1.2/InputHandler.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/InputHandler.qml 2015-05-06 10:32:32 +0000
@@ -0,0 +1,518 @@
1/*
2 * Copyright 2014 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.2
19
20/*
21 This component is a unified text selection and scrolling handler for both
22 TextField and TextArea components.
23 */
24
25MultiPointTouchArea {
26 id: inputHandler
27 objectName: "input_handler"
28
29 // the root control
30 property Item main
31 // the input instance
32 property Item input
33 // the Flickable holding the input instance
34 property Flickable flickable
35
36 // item filling the visible text input area used to check handler visibility
37 property Item visibleArea: Item {
38 parent: flickable
39 anchors.fill: parent
40 }
41
42 // line size and spacing
43 property real lineSpacing: units.dp(3)
44 property real lineSize: input.font.pixelSize + lineSpacing
45 // input x/y distance from the frame
46 property point frameDistance: Qt.point(flickable.x, flickable.y)
47
48 // signal triggered when popup should be opened
49 signal pressAndHold(int pos, bool fromTouch)
50 signal tap(int pos)
51 property string oldText: ""
52 signal textModified()
53
54 function activateInput() {
55 if (!input.activeFocus) {
56 input.forceActiveFocus();
57 }
58 showInputPanel();
59 }
60
61 function showInputPanel() {
62 if (!Qt.inputMethod.visible) {
63 Qt.inputMethod.show();
64 }
65 textChanged = false;
66 }
67 function hideInputPanel() {
68 Qt.inputMethod.hide();
69 // emit accepted signal if changed
70 if (textChanged && input.hasOwnProperty("accepted")) {
71 input.accepted();
72 }
73 }
74
75 // internal properties/functions
76 readonly property bool singleLine: input.hasOwnProperty("validator")
77 property var flickableList: new Array()
78 property bool textChanged: false
79 property var popover
80 property bool suppressReleaseEvent: false
81 property int pressedPosition: -1
82 // move properties
83 property int moveStarts: -1
84 property int moveEnds: -1
85 // set scroller to the first Flickable that scrolls the input
86 // this can be the internal Flickable if the full autosize is disabled
87 // or one of the input's parent Flickable
88 readonly property bool scrollingDisabled: main && main.hasOwnProperty("autoSize") ?
89 (main.autoSize && (main.maximumLineCount <= 0)) : false
90 onScrollingDisabledChanged: if (state == "") flickable.interactive = !scrollingDisabled
91 readonly property Flickable grandScroller: firstFlickableParent(main)
92 readonly property Flickable scroller: (scrollingDisabled && grandScroller) ? grandScroller : flickable
93
94 // ensures the text cursorRectangle is always in the internal Flickable's visible area
95 function ensureVisible(rect)
96 {
97 if (flickable.moving || flickable.flicking)
98 return;
99 if (flickable.contentX >= rect.x)
100 flickable.contentX = rect.x;
101 else if (flickable.contentX + flickable.width <= rect.x + rect.width)
102 flickable.contentX = rect.x + rect.width - flickable.width;
103 if (flickable.contentY >= rect.y)
104 flickable.contentY = rect.y;
105 else if (flickable.contentY + flickable.height <= rect.y + rect.height)
106 flickable.contentY = rect.y + rect.height - flickable.height;
107 }
108 // returns the cursor position from x,y pair
109 function unadulteratedCursorPosition(x, y) {
110 return singleLine ? input.positionAt(x, TextInput.CursorOnCharacter) : input.positionAt(x, y, TextInput.CursorOnCharacter);
111 }
112 // returns the cursor position taking frame into account
113 function cursorPosition(x, y) {
114 var frameSpacing = main.__styleInstance.frameSpacing;
115 var cursorPosition = unadulteratedCursorPosition(x, y);
116 if (cursorPosition == 0)
117 cursorPosition = unadulteratedCursorPosition(x + frameSpacing, y + frameSpacing);
118 if (cursorPosition == text.length)
119 cursorPosition = unadulteratedCursorPosition(x - frameSpacing, y - frameSpacing);
120 return cursorPosition
121 }
122
123 // returns the mouse position
124 function mousePosition(mouse) {
125 return cursorPosition(mouse.x, mouse.y);
126 }
127 // checks whether the position is in the selected text
128 function positionInSelection(pos) {
129 return (input.selectionStart !== input.selectionEnd)
130 && (pos >= Math.min(input.selectionStart, input.selectionEnd))
131 && (pos <= Math.max(input.selectionStart, input.selectionEnd));
132 }
133
134 // check whether the mouse is inside a selected text area
135 function mouseInSelection(mouse) {
136 var pos = mousePosition(mouse);
137 return positionInSelection(pos);
138 }
139 // selects text
140 function selectText(mouse) {
141 state = "select";
142 moveEnds = mousePosition(mouse);
143 if (moveStarts < 0) {
144 moveStarts = moveEnds;
145 }
146 input.select(moveStarts, moveEnds);
147 }
148 // returns the first Flickable parent of a given item
149 function firstFlickableParent(item) {
150 var p = item ? item.parent : null;
151 while (p && !p.hasOwnProperty("flicking")) {
152 p = p.parent;
153 }
154 return p;
155 }
156 // focuses the input if not yet focused, and shows the context menu
157 function openContextMenu(mouse, noAutoselect, fromTouch) {
158 var pos = mousePosition(mouse);
159 if (!main.focus || !mouseInSelection(mouse)) {
160 activateInput();
161 input.cursorPosition = pressedPosition = mousePosition(mouse);
162 if (!noAutoselect) {
163 input.selectWord();
164 }
165 }
166 // open context menu at the cursor position
167 inputHandler.pressAndHold(input.cursorPosition, fromTouch);
168 // if opened with left press (touch falls into this criteria as well), we need to set state to inactive
169 // so the mouse moves won't result in selected text loss/change
170 if (mouse.button === Qt.LeftButton) {
171 state = "inactive";
172 }
173 }
174
175 // disables interactive Flickable parents, stops at the first non-interactive flickable.
176 function toggleFlickablesInteractive(turnOn) {
177 var p;
178 if (!turnOn) {
179 // handle the scroller separately
180 p = firstFlickableParent(scroller)
181 while (p) {
182 if (p.interactive) {
183 flickableList.push(p);
184 p.interactive = false;
185 } else {
186 break;
187 }
188 p = firstFlickableParent(p);
189 }
190 } else {
191 while (flickableList.length > 0) {
192 p = flickableList.pop();
193 p.interactive = true;
194 }
195 }
196 }
197
198 // moves the specified position, called by the cursor handler
199 // positioner = "currentPosition/selectionStart/selectionEnd"
200 function positionCaret(positioner, x, y) {
201 if (positioner === "cursorPosition") {
202 input[positioner] = cursorPosition(x, y);
203 } else {
204 var pos = cursorPosition(x, y);
205 if (positioner === "selectionStart" && (pos < input.selectionEnd)) {
206 input.select(pos, input.selectionEnd);
207 } else if (positioner === "selectionEnd" && (pos > input.selectionStart)) {
208 input.select(input.selectionStart, pos);
209 }
210 }
211 }
212
213 // moves the cursor one page forward with or without positioning the cursor
214 function movePage(forward) {
215 var cx = input.cursorRectangle.x;
216 var cy = input.cursorRectangle.y;
217 if (forward) {
218 if (singleLine) {
219 cx += visibleArea.width;
220 } else {
221 cy += visibleArea.height;
222 }
223 } else {
224 if (singleLine) {
225 cx -= visibleArea.width;
226 } else {
227 cy -= visibleArea.height;
228 }
229 }
230 input.cursorPosition = cursorPosition(cx, cy);
231 }
232
233 Component.onCompleted: {
234 state = (main.focus) ? "" : "inactive";
235 // FIXME: Qt5.3 related! mouseEnabled is a 5.3 related property which has a positive
236 // default value. That value messes up teh current understanding (5.2) of the
237 // MultiPointTouchArea functioning. We need to set it to false until 5.3 will be the
238 // default supported Qt version, when we can have a clean property value assignment
239 if (inputHandler.hasOwnProperty("mouseEnabled")) {
240 inputHandler.mouseEnabled = false;
241 }
242 }
243
244 // states
245 states: [
246 // override default state to turn on the saved Flickable interactive mode
247 State {
248 name: ""
249 StateChangeScript {
250 // restore interactive for all Flickable parents
251 script: toggleFlickablesInteractive(true);
252 }
253 },
254 State {
255 name: "inactive"
256 // we do not disable scroller here as in case the internal scrolling
257 // is disabled (scrollingDisabled = true) the outer scroller (grandScroller)
258 // would be blocked as well, which we don't want to
259 PropertyChanges {
260 target: flickable
261 interactive: false
262 }
263 },
264 State {
265 name: "scrolling"
266 StateChangeScript {
267 script: {
268 // stop scrolling all the parents
269 toggleFlickablesInteractive(false);
270 // stop touch timers
271 touchPoint.reset();
272 }
273 }
274 },
275 State {
276 name: "select"
277 // during select state all the flickables are blocked (interactive = false)
278 // we can use scroller here as we need to disable the outer scroller too!
279 PropertyChanges {
280 target: scroller
281 interactive: false
282 }
283 StateChangeScript {
284 script: {
285 // turn off interactive for all parent flickables
286 toggleFlickablesInteractive(false);
287 if (!positionInSelection(pressedPosition)) {
288 input.cursorPosition = pressedPosition;
289 }
290 }
291 }
292 }
293 ]
294
295 // brings the state back to default when the component looses focuse
296 Connections {
297 target: main
298 ignoreUnknownSignals: true
299 onFocusChanged: {
300 Qt.inputMethod.commit()
301 state = (main.focus) ? "" : "inactive";
302 }
303 }
304
305 // input specific signals
306 Connections {
307 target: input
308 onCursorRectangleChanged: ensureVisible(input.cursorRectangle)
309 onTextChanged: {
310 textChanged = true;
311 if (oldText != input.text) {
312 textModified()
313 oldText = text
314 }
315 }
316 // make sure we show the OSK
317 onActiveFocusChanged: showInputPanel()
318 }
319
320 // inner or outer Flickable controlling
321 Connections {
322 target: scroller
323 // turn scrolling state on
324 onFlickStarted: toggleScrollingState(true)
325 onMovementStarted: toggleScrollingState(true)
326 // reset to default state
327 onMovementEnded: toggleScrollingState(false)
328
329 function toggleScrollingState(turnOn) {
330 if (!main.focus) {
331 return;
332 }
333 inputHandler.state = (turnOn) ? "scrolling" : ""
334 }
335 }
336
337 // PageUp and PageDown handling
338 Keys.onPressed: {
339 if (event.key === Qt.Key_PageUp && event.modifiers === Qt.NoModifier) {
340 movePage(false);
341 } else if (event.key === Qt.Key_PageDown && event.modifiers === Qt.NoModifier) {
342 movePage(true);
343 }
344 }
345
346 // touch and mous handling
347 function handlePressed(event, touch) {
348 if (touch) {
349 // we do not have longTap or double tap, therefore we need to generate those
350 event.touch();
351 } else {
352 // consume event so it does not get forwarded to the input
353 event.accepted = true;
354 }
355 // remember pressed position as we need it when entering into selection state
356 pressedPosition = mousePosition(event);
357 }
358 function handleReleased(event, touch) {
359 if (touch) {
360 event.untouch();
361 }
362 if ((!main.focus && !main.activeFocusOnPress) || suppressReleaseEvent === true) {
363 suppressReleaseEvent = false;
364 return;
365 }
366
367 activateInput();
368 if (state === "" || touch) {
369 input.cursorPosition = mousePosition(event);
370 }
371 moveStarts = moveEnds = -1;
372 state = "";
373 // check if we get right-click from the frame or the area that has no text
374 if (event.button === Qt.RightButton) {
375 // open the popover
376 inputHandler.pressAndHold(input.cursorPosition, touch);
377 } else {
378 inputHandler.tap(input.cursorPosition);
379 }
380 }
381 function handleMove(event, touch ) {
382 // leave if not focus, not the left button or not in select state
383 if (!input.activeFocus || (!touch && event.button !== Qt.LeftButton) || !main.selectByMouse) {
384 return;
385 }
386 selectText(event);
387 }
388 function handleDblClick(event, touch) {
389 if (main.selectByMouse) {
390 openContextMenu(event, false, touch);
391 // turn selection state temporarily so the selection is not cleared on release
392 state = "selection";
393 suppressReleaseEvent = true;
394 }
395 }
396
397 // Mouse handling
398 Mouse.forwardTo: [main]
399 Mouse.onPressed: handlePressed(mouse, false)
400 Mouse.onReleased: handleReleased(mouse, false)
401 Mouse.onPositionChanged: handleMove(mouse, false)
402 Mouse.onDoubleClicked: handleDblClick(mouse, false)
403
404 // right button handling
405 MouseArea {
406 anchors.fill: parent
407 acceptedButtons: Qt.RightButton
408 // trigger pressAndHold
409 onReleased: openContextMenu(mouse, true, false)
410 }
411 Keys.onMenuPressed: inputHandler.pressAndHold(input.cursorPosition, false);
412
413 // touch handling
414 touchPoints: TouchPoint {
415 id: touchPoint
416 function touch() {
417 longTap.restart();
418 if (!doubleTap.running) {
419 doubleTap.restart();
420 } else if (doubleTap.tapCount > 0) {
421 doubleTap.running = false;
422 handleDblClick(touchPoint, true);
423 }
424 }
425 function untouch() {
426 longTap.running = false;
427 }
428 function reset() {
429 longTap.running = false;
430 doubleTap.running = false;
431 }
432 }
433 Timer {
434 id: longTap
435 // sync with QQuickMouseArea constant
436 interval: 800
437 onTriggered: {
438 // do not open context menu if the input is not focus
439 if (!main.focus) {
440 return;
441 }
442
443 // do not open context menu if this is scrolling
444 if (touchPoint.startY - touchPoint.y < -units.gu(2))
445 return;
446
447 openContextMenu(touchPoint, false, true);
448 suppressReleaseEvent = true;
449 }
450 }
451
452 property bool doubleTapInProgress: doubleTap.running
453 Timer {
454 id: doubleTap
455 property int tapCount: 0
456 interval: 400
457 onRunningChanged: {
458 tapCount = running;
459 }
460 }
461 onPressed: handlePressed(touchPoints[0], true)
462 onReleased: handleReleased(touchPoints[0], true)
463
464 property Item cursorPositionCursor: null
465 property Item selectionStartCursor: null
466 property Item selectionEndCursor: null
467
468 // cursors to use when text is selected
469 Connections {
470 target: input
471 onSelectedTextChanged: {
472 if (selectedText !== "") {
473 if (!selectionStartCursor) {
474 selectionStartCursor = input.cursorDelegate.createObject(
475 input, {
476 "positionProperty": "selectionStart",
477 "handler": inputHandler,
478 }
479 );
480 moveSelectionCursor(selectionStartCursor);
481 selectionEndCursor = input.cursorDelegate.createObject(
482 input, {
483 "positionProperty": "selectionEnd",
484 "handler": inputHandler,
485 }
486 );
487 moveSelectionCursor(selectionEndCursor);
488 }
489 } else {
490 if (selectionStartCursor) {
491 selectionStartCursor.destroy();
492 selectionStartCursor = null;
493 selectionEndCursor.destroy();
494 selectionEndCursor = null;
495 }
496 }
497 }
498 onSelectionStartChanged: moveSelectionCursor(selectionStartCursor, true);
499 onSelectionEndChanged: moveSelectionCursor(selectionEndCursor, true);
500
501 function moveSelectionCursor(cursor, updateProperty) {
502 if (!cursor) {
503 return;
504 }
505 // workaround for https://bugreports.qt-project.org/browse/QTBUG-38704
506 // selectedTextChanged signal is not emitted for TextEdit when selectByMouse is false
507 if (updateProperty && QuickUtils.className(input) === "QQuickTextEdit") {
508 input.selectedTextChanged();
509 }
510
511 var pos = input.positionToRectangle(input[cursor.positionProperty]);
512 cursor.x = pos.x;
513 cursor.y = pos.y;
514 cursor.height = pos.height;
515 ensureVisible(pos);
516 }
517 }
518}
0519
=== added file 'modules/Ubuntu/Components/1.2/Label.qml'
--- modules/Ubuntu/Components/1.2/Label.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/Label.qml 2015-05-06 10:32:32 +0000
@@ -0,0 +1,59 @@
1/*
2 * Copyright 2012 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18
19/*!
20 \qmltype Label
21 \inqmlmodule Ubuntu.Components 1.1
22 \ingroup ubuntu
23 \brief Text with Ubuntu styling.
24
25 Example:
26 \qml
27 Rectangle {
28 color: UbuntuColors.coolGrey
29 width: units.gu(30)
30 height: units.gu(30)
31
32 Label {
33 anchors.centerIn: parent
34 text: "Hello, world!"
35 fontSize: "large"
36 }
37 }
38 \endqml
39*/
40Text {
41 id: label
42
43 /*!
44 The size of the text. One of the following strings (from smallest to largest):
45 \list
46 \li "xx-small"
47 \li "x-small"
48 \li "small"
49 \li "medium"
50 \li "large"
51 \li "x-large"
52 \endlist
53 Default value is "medium".
54 */
55 property string fontSize: "medium"
56
57 font.pixelSize: FontUtils.sizeToPixels(fontSize)
58 color: Theme.palette.selected.backgroundText
59}
060
=== renamed file 'modules/Ubuntu/Components/MainView.qml' => 'modules/Ubuntu/Components/1.2/MainView.qml'
--- modules/Ubuntu/Components/MainView.qml 2015-04-28 06:32:00 +0000
+++ modules/Ubuntu/Components/1.2/MainView.qml 2015-05-06 10:32:32 +0000
@@ -136,7 +136,7 @@
136 flickable: internal.activePage ? internal.activePage.flickable : null136 flickable: internal.activePage ? internal.activePage.flickable : null
137 pageStack: internal.activePage ? internal.activePage.pageStack : null137 pageStack: internal.activePage ? internal.activePage.pageStack : null
138138
139 PageHeadConfiguration11 {139 PageHeadConfiguration {
140 id: headerConfig140 id: headerConfig
141 // for backwards compatibility with deprecated tools property141 // for backwards compatibility with deprecated tools property
142 actions: internal.activePage ?142 actions: internal.activePage ?
143143
=== added file 'modules/Ubuntu/Components/1.2/MainView12.qml'
--- modules/Ubuntu/Components/1.2/MainView12.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/MainView12.qml 2015-05-06 10:32:32 +0000
@@ -0,0 +1,163 @@
1/*
2 * Copyright 2012-2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.2 as Toolkit
19import Ubuntu.PerformanceMetrics 1.0
20import QtQuick.Window 2.2
21
22/*! \internal */
23// Documentation is in MainView.qdoc
24MainViewBase {
25 id: mainView
26
27 property alias automaticOrientation: canvas.automaticOrientation
28
29 /*!
30 \internal
31 Use default property to ensure children added do not draw over the header.
32 */
33 default property alias contentsItem: contents.data
34 OrientationHelper {
35 id: canvas
36
37 automaticOrientation: false
38 anchorToKeyboard: mainView.anchorToKeyboard
39
40 // clip the contents so that it does not overlap the header
41 Item {
42 id: contentsClipper
43 anchors {
44 left: parent.left
45 right: parent.right
46 top: headerItem.bottom
47 bottom: parent.bottom
48 }
49 // only clip when necessary
50 // ListView headers may be positioned at the top, independent from
51 // flickable.contentY, so do not clip depending on activePage.flickable.contentY.
52 clip: headerItem.bottomY > 0 && internal.activePage && internal.activePage.flickable
53
54 Item {
55 id: contents
56 anchors {
57 fill: parent
58
59 // compensate so that the actual y is always 0
60 topMargin: -parent.y
61 }
62 }
63 }
64
65 /*!
66 The header of the MainView. Can be used to obtain the height of the header
67 in \l Page to determine the area for the \l Page to fill.
68 */
69 AppHeader {
70 // This objectName is used in the MainView autopilot custom proxy object
71 // in order to select the application header.
72 objectName: "MainView_Header"
73 id: headerItem
74 property real bottomY: headerItem.y + headerItem.height
75 animate: true
76 dividerColor: Qt.darker(mainView.headerColor, 1.1)
77 panelColor: Qt.lighter(mainView.headerColor, 1.1)
78
79 title: internal.activePage ? internal.activePage.title : ""
80 flickable: internal.activePage ? internal.activePage.flickable : null
81 pageStack: internal.activePage ? internal.activePage.pageStack : null
82
83 contents: internal.activePage ?
84 internal.activePage.__customHeaderContents : null
85
86 PageHeadConfiguration {
87 id: defaultConfig
88 // Used when there is no active Page, or a Page 1.0 is used which
89 // does not have a PageHeadConfiguration.
90 }
91 config: internal.activePage && internal.activePage.hasOwnProperty("head") ?
92 internal.activePage.head : defaultConfig
93
94 // 'window' is defined by QML between startup and showing on the screen.
95 // There is no signal for when it becomes available and re-declaring it is not safe.
96 property bool windowActive: typeof window != 'undefined'
97 onWindowActiveChanged: {
98 window.title = headerItem.title
99 }
100
101 Connections {
102 target: headerItem
103 onTitleChanged: {
104 if (headerItem.windowActive)
105 window.title = headerItem.title
106 }
107 }
108
109 // Use of the deprecated toolbar is no longer supported in MainView 1.2.
110 useDeprecatedToolbar: false
111 }
112
113 Connections {
114 target: Qt.application
115 onActiveChanged: {
116 if (Qt.application.active) {
117 headerItem.animate = false;
118 headerItem.show();
119 headerItem.animate = true;
120 }
121 }
122 }
123 }
124
125 Object {
126 id: internal
127
128 // Even when using MainView 1.1, we still support Page 1.0.
129 // PageBase (=Page 1.0) is the superclass of Page 1.1.
130 property PageTreeNode activePage: isPage(mainView.activeLeafNode) ? mainView.activeLeafNode : null
131
132 function isPage(item) {
133 return item && item.hasOwnProperty("__isPageTreeNode") && item.__isPageTreeNode &&
134 item.hasOwnProperty("title") && item.hasOwnProperty("tools");
135 }
136 }
137
138 __propagated: QtObject {
139 /*!
140 \internal
141 The header that will be propagated to the children in the page tree node.
142 It is used by Tabs to bind header's tabsModel.
143 */
144 property AppHeader header: headerItem
145
146 /*!
147 \internal
148 The action manager that has the global context for the MainView's actions,
149 and to which a local context can be added for each Page that has actions.actions.
150 */
151 property var actionManager: mainView.actionManager
152
153 /*!
154 \internal
155 Used by PageStack. This property only exists in MainView 1.2 and later.
156 */
157 readonly property bool animateHeader: headerItem.__styleInstance &&
158 headerItem.__styleInstance.hasOwnProperty("animateIn") &&
159 headerItem.__styleInstance.hasOwnProperty("animateOut") &&
160 headerItem.__styleInstance.hasOwnProperty("animateInFinished") &&
161 headerItem.__styleInstance.hasOwnProperty("animateOutFinished")
162 }
163}
0164
=== added file 'modules/Ubuntu/Components/1.2/MainViewBase.qml'
--- modules/Ubuntu/Components/1.2/MainViewBase.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/MainViewBase.qml 2015-05-06 10:32:32 +0000
@@ -0,0 +1,83 @@
1/*
2 * Copyright 2012-2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components 1.2 as Toolkit
19import Ubuntu.PerformanceMetrics 1.0
20import QtQuick.Window 2.0
21
22/*! \internal */
23// Documentation is in MainView.qdoc
24PageTreeNode {
25 id: mainView
26 property string applicationName: ""
27 property bool anchorToKeyboard: false
28 property alias headerColor: background.headerColor
29 property alias backgroundColor: background.backgroundColor
30 property alias footerColor: background.footerColor
31
32 // FIXME: Make sure that the theming is only in the background, and the style
33 // should not occlude contents of the MainView. When making changes here, make
34 // sure that bug https://bugs.launchpad.net/manhattan/+bug/1124076 does not come back.
35 Toolkit.StyledItem {
36 id: background
37 anchors.fill: parent
38 style: Theme.createStyleComponent("MainViewStyle.qml", background)
39
40 property color headerColor: backgroundColor
41 property color backgroundColor: Theme.palette.normal.background
42 property color footerColor: backgroundColor
43
44 /*
45 As we don't know the order the property bindings and onXXXChanged signals are evaluated
46 we should rely only on one property when changing the theme to avoid intermediate
47 theme changes due to properties being evaluated separately.
48
49 Qt bug: https://bugreports.qt-project.org/browse/QTBUG-11712
50 */
51 property string theme: (ColorUtils.luminance(backgroundColor) >= 0.85) ?
52 "Ambiance" : "SuruDark"
53 onThemeChanged: {
54 // only change the theme if the current one is a system one.
55 if (theme !== "" && (Theme.name.search("Ubuntu.Components.Themes") >= 0)) {
56 Theme.name = "Ubuntu.Components.Themes.%1".arg(theme);
57 }
58 }
59 }
60
61 active: true
62 property alias actions: unityActionManager.actions
63 property alias actionManager: unityActionManager
64 Toolkit.ActionManager {
65 id: unityActionManager
66 onQuit: {
67 // FIXME Wire this up to the application lifecycle management API instead of quit().
68 Qt.quit()
69 }
70 }
71
72 onApplicationNameChanged: {
73 if (applicationName !== "") {
74 i18n.domain = applicationName;
75 UbuntuApplication.applicationName = applicationName
76 }
77 }
78
79 PerformanceOverlay {
80 id: performanceOverlay
81 active: false
82 }
83}
084
=== renamed file 'modules/Ubuntu/Components/Object.qml' => 'modules/Ubuntu/Components/1.2/Object.qml'
=== added file 'modules/Ubuntu/Components/1.2/OptionSelector.qml'
--- modules/Ubuntu/Components/1.2/OptionSelector.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/OptionSelector.qml 2015-05-06 10:32:32 +0000
@@ -0,0 +1,297 @@
1/*
2 * Copyright 2012 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18import Ubuntu.Components.ListItems 1.0 as ListItem
19import Ubuntu.Components 1.2 as Toolkit
20
21/*!
22 \qmltype OptionSelector
23 \inqmlmodule Ubuntu.Components 1.1
24 \ingroup ubuntu-components
25 \brief Component displaying either a single selected value or expanded multiple choice with an optional image and subtext when not expanded, when expanding it opens a
26 listing of all the possible values for selection with an additional option of always being expanded. If multiple choice is selected the list is expanded automatically.
27
28 Examples:
29 \qml
30 import Ubuntu.Components 1.2
31 Column {
32 spacing: units.gu(3)
33
34 OptionSelector {
35 text: i18n.tr("Label")
36 model: [i18n.tr("Value 1"),
37 i18n.tr("Value 2"),
38 i18n.tr("Value 3"),
39 i18n.tr("Value 4")]
40 }
41
42 OptionSelector {
43 text: i18n.tr("Label")
44 expanded: true
45 model: [i18n.tr("Value 1"),
46 i18n.tr("Value 2"),
47 i18n.tr("Value 3"),
48 i18n.tr("Value 4")]
49 }
50
51 OptionSelector {
52 objectName: "optionselector_multipleselection"
53 text: i18n.tr("Multiple Selection")
54 expanded: false
55 multiSelection: true
56 model: [i18n.tr("Value 1"),
57 i18n.tr("Value 2"),
58 i18n.tr("Value 3"),
59 i18n.tr("Value 4")]
60 }
61
62 OptionSelector {
63 text: i18n.tr("Label")
64 model: customModel
65 expanded: true
66 colourImage: true
67 delegate: selectorDelegate
68 }
69
70 Component {
71 id: selectorDelegate
72 OptionSelectorDelegate { text: name; subText: description; iconSource: image }
73 }
74
75 ListModel {
76 id: customModel
77 ListElement { name: "Name 1"; description: "Description 1"; image: "images.png" }
78 ListElement { name: "Name 2"; description: "Description 2"; image: "images.png" }
79 ListElement { name: "Name 3"; description: "Description 3"; image: "images.png" }
80 ListElement { name: "Name 4"; description: "Description 4"; image: "images.png" }
81 }
82
83 OptionSelector {
84 text: i18n.tr("Label")
85 model: [i18n.tr("Value 1"),
86 i18n.tr("Value 2"),
87 i18n.tr("Value 3"),
88 i18n.tr("Value 4"),
89 i18n.tr("Value 5"),
90 i18n.tr("Value 6"),
91 i18n.tr("Value 7"),
92 i18n.tr("Value 8")]
93 containerHeight: itemHeight * 4
94 }
95
96 OptionSelector {
97 text: i18n.tr("Label")
98 expanded: true
99 model: [i18n.tr("Value 1"),
100 i18n.tr("Value 2"),
101 i18n.tr("Value 3"),
102 i18n.tr("Value 4"),
103 i18n.tr("Value 5"),
104 i18n.tr("Value 6"),
105 i18n.tr("Value 7"),
106 i18n.tr("Value 8")]
107 containerHeight: itemHeight * 4
108 }
109 }
110 \endqml
111*/
112
113ListItem.Empty {
114 id: optionSelector
115
116 /*!
117 The list of values that will be shown under the label text. This is a model.
118 */
119 property var model
120
121 /*!
122 Specifies whether the list is always expanded.
123 */
124 property bool expanded: false
125
126 /*!
127 If the multiple choice selection is enabled the list is always expanded.
128 */
129 property bool multiSelection: false
130
131 /*!
132 Colours image according to the fieldText colour of the theme, otherwise source colour is maintained.
133 */
134 property bool colourImage: false
135
136 /*!
137 ListView delegate.
138 */
139 property Component delegate: Toolkit.OptionSelectorDelegate {}
140
141 /*!
142 Custom height for list container which allows scrolling inside the selector.
143 */
144 property real containerHeight: {
145 /*The reason for this slightly unconventional method of setting the container height
146 is due to the fact that if we set it to the selector height by default (which is
147 bound to the colum height) then we wouldn't be able to scroll to the end of the bottom
148 boundary. The text is also invisible if none is set so this is taken into account too.*/
149 var textHeight = text === "" ? 0 : label.height + column.spacing;
150 if (parent && parent.height < list.contentHeight) {
151 return parent.height - textHeight;
152 } else {
153 list.contentHeight;
154 }
155 }
156
157 /*!
158 \qmlproperty int selectedIndex
159 The index of the currently selected element in our list.
160 */
161 property alias selectedIndex: list.currentIndex
162
163 /*!
164 \qmlproperty bool currentlyExpanded
165 Is our list currently expanded?
166 */
167 property alias currentlyExpanded: listContainer.currentlyExpanded
168
169 /*!
170 \qmlproperty real itemHeight
171 Height of an individual list item.
172 */
173 readonly property alias itemHeight: list.itemHeight
174
175 /*!
176 Called when delegate is clicked.
177 */
178 signal delegateClicked(int index)
179
180 /*!
181 Called when the selector has finished expanding or collapsing.
182 */
183 signal expansionCompleted()
184
185 /*!
186 \internal
187 Trigger the action, passing the current index.
188 */
189 onDelegateClicked: {
190 trigger(index)
191 }
192
193 __height: column.height
194 showDivider: false
195
196 Column {
197 id: column
198
199 spacing: units.gu(2)
200 anchors {
201 left: parent.left
202 right: parent.right
203 }
204
205 Label {
206 id : label
207
208 text: optionSelector.text
209 visible: optionSelector.text !== "" ? true : false
210 }
211
212 Toolkit.StyledItem {
213 id: listContainer
214 objectName: "listContainer"
215 activeFocusOnPress: true
216
217 readonly property url chevron: __styleInstance.chevron
218 readonly property url tick: __styleInstance.tick
219 readonly property color themeColour: Theme.palette.selected.fieldText
220 readonly property alias colourImage: optionSelector.colourImage
221 property bool currentlyExpanded: expanded || multiSelection
222
223 anchors {
224 left: parent.left
225 right: parent.right
226 }
227 state: optionSelector.expanded ? "expanded" : "collapsed"
228 style: Theme.createStyleComponent("OptionSelectorStyle.qml", listContainer)
229 states: [ State {
230 name: "expanded"
231 when: listContainer.currentlyExpanded
232 PropertyChanges {
233 target: listContainer
234 height: list.contentHeight < containerHeight ? list.contentHeight : containerHeight
235 }
236 }, State {
237 name: "collapsed"
238 when: !listContainer.currentlyExpanded
239 PropertyChanges {
240 target: listContainer
241 height: list.itemHeight
242 }
243 }
244 ]
245
246 transitions: [ Transition {
247 SequentialAnimation {
248 Toolkit.UbuntuNumberAnimation {
249 properties: "height"
250 duration: Toolkit.UbuntuAnimation.BriskDuration
251 }
252 ScriptAction {
253 script: {
254 if (listContainer.currentlyExpanded) {
255 expansionCompleted();
256 } else {
257 list.positionViewAtIndex(selectedIndex, ListView.Beginning);
258 }
259 }
260 }
261 }
262 }
263 ]
264
265 ListView {
266 id: list
267
268 property int previousIndex: -1
269 readonly property alias expanded: optionSelector.expanded
270 readonly property alias multiSelection: optionSelector.multiSelection
271 readonly property alias container: listContainer
272 property real itemHeight
273 signal delegateClicked(int index)
274
275 onMovementStarted: optionSelector.requestFocus(Qt.MouseFocusReason)
276 onFlickStarted: optionSelector.requestFocus(Qt.MouseFocusReason)
277 Toolkit.Mouse.onClicked: optionSelector.requestFocus(Qt.MouseFocusReason)
278
279 onDelegateClicked: optionSelector.delegateClicked(index);
280 interactive: listContainer.height !== list.contentHeight && listContainer.currentlyExpanded ? true : false
281 clip: true
282 currentIndex: 0
283 model: optionSelector.model
284 anchors.fill: parent
285
286 delegate: optionSelector.delegate
287
288 Behavior on contentY {
289 Toolkit.UbuntuNumberAnimation {
290 properties: "contentY"
291 duration: Toolkit.UbuntuAnimation.BriskDuration
292 }
293 }
294 }
295 }
296 }
297}
0298
=== added file 'modules/Ubuntu/Components/1.2/OptionSelectorDelegate.qml'
--- modules/Ubuntu/Components/1.2/OptionSelectorDelegate.qml 1970-01-01 00:00:00 +0000
+++ modules/Ubuntu/Components/1.2/OptionSelectorDelegate.qml 2015-05-06 10:32:32 +0000
@@ -0,0 +1,365 @@
1/*
2 * Copyright 2012 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17/*!
18 \qmltype OptionSelectorDelegate
19 \inqmlmodule Ubuntu.Components 1.1
20 \ingroup ubuntu-components
21 \brief OptionSelector delegate which can display text, subtext and an image from a custom model.
22
23 Examples:
24 \qml
25 import Ubuntu.Components 1.2
26 Column {
27 width: 250
28 OptionSelector {
29 text: i18n.tr("Label")
30 model: customModel
31 delegate: OptionSelectorDelegate { text: name; subText: description; iconSource: image }
32 }
33 ListModel {
34 id: customModel
35 ListElement { name: "Name 1"; description: "Description 1"; image: "images.png" }
36 ListElement { name: "Name 2"; description: "Description 2"; image: "images.png" }
37 ListElement { name: "Name 3"; description: "Description 3"; image: "images.png" }
38 ListElement { name: "Name 4"; description: "Description 4"; image: "images.png" }
39 }
40 }
41 \endqml
42*/
43
44import QtQuick 2.4
45import Ubuntu.Components.ListItems 1.0 as ListItem
46import Ubuntu.Components 1.2 as Toolkit
47
48ListItem.Empty {
49 id: option
50
51 __height: units.gu(5)
52
53 /*!
54 Subtext which appears below the main text.
55 */
56 property string subText
57
58 /*!
59 \deprecated
60
61 \b{Use iconName or iconSource instead.}
62
63 Left icon url.
64 */
65 property url icon: iconSource
66 onIconChanged: if (icon != iconSource) {
67 console.warn("WARNING: OptionSelectorDelegate.icon is DEPRECATED. " +
68 "Use iconName and iconSource instead.")
69 }
70
71 /*!
72 Constrains the size of the image to nothing greater than that of the delegate. Changes fillMode to Image.PreserveAspectFit.
73 */
74 property bool constrainImage: false
75
76 /*!
77 Whether or not left image is coloured by our theme.
78 */
79 property bool colourImage: listView.container.colourImage
80
81 /*!
82 Colour of left image.
83 */
84 property color assetColour: listView.container.themeColour
85
86 /*!
87 OptionSelector's ListView.
88 */
89 readonly property ListView listView: ListView.view
90
91 /*!
92 Colourising fragment shader.
93 */
94 readonly property string fragColourShader:
95 "varying highp vec2 qt_TexCoord0;
96 uniform sampler2D source;
97 uniform lowp vec4 colour;
98 uniform lowp float qt_Opacity;
99
100 void main() {
101 lowp vec4 sourceColour = texture2D(source, qt_TexCoord0);
102 gl_FragColor = colour * sourceColour.a * qt_Opacity;
103 }"
104
105 showDivider: index !== listView.count - 1 ? 1 : 0
106 highlightWhenPressed: false
107 selected: ListView.isCurrentItem
108 anchors {
109 left: parent.left
110 right: parent.right
111 }
112 onClicked: {
113 if (listView.container.currentlyExpanded) {
114 listView.delegateClicked(index);
115
116 if (!listView.multiSelection) {
117 listView.previousIndex = listView.currentIndex;
118 listView.currentIndex = index;
119 } else {
120 selected = !selected;
121 }
122 }
123
124 if (!listView.expanded && !listView.multiSelection) {
125 listView.container.currentlyExpanded = !listView.container.currentlyExpanded;
126 }
127 }
128
129 Component.onCompleted: {
130 height = listView.itemHeight = childrenRect.height;
131 }
132
133 //Since we don't want to add states to our divider, we use the exposed alias provided in Empty to access it and alter it's opacity from here.
134 states: [ State {
135 name: "dividerExpanded"
136 when: listView.container.state === "expanded" && index === listView.currentIndex
137 PropertyChanges {
138 target: option.divider
139 opacity: 1
140 }
141 }, State {
142 name: "dividerCollapsed"
143 when: listView.container.state === "collapsed" && index === listView.currentIndex
144 PropertyChanges {
145 target: option.divider
146 opacity: 0
147 }
148 }
149 ]
150
151 //As with our states, we apply the transition with our divider as the target.
152 transitions: [ Transition {
153 from: "dividerExpanded"
154 to: "dividerCollapsed"
155 Toolkit.UbuntuNumberAnimation {
156 target: option.divider
157 properties: "opacity"
158 duration: Toolkit.UbuntuAnimation.SlowDuration
159 }
160 }
161 ]
162
163 resources: [
164 Connections {
165 target: listView.container
166 onCurrentlyExpandedChanged: {
167 imageExpansion.stop();
168 selectedImageCollapse.stop();
169 deselectedImageCollapse.stop();
170
171 if (listView.container.currentlyExpanded === true) {
172 if (!option.selected) {
173 optionExpansion.start();
174
175 //Ensure a source change. This solves a bug which happens occasionaly when source is switched correctly. Probably related to the image.source binding.
176 image.source = listView.container.tick
177 } else {
178 imageExpansion.start();
179 }
180 } else {
181 if (!option.selected) {
182 optionCollapse.start();
183 } else {
184 if (listView.previousIndex !== listView.currentIndex)
185 selectedImageCollapse.start();
186 else {
187 deselectedImageCollapse.start();
188 }
189 }
190 }
191 }
192 }, SequentialAnimation {
193 id: imageExpansion
194
195 PropertyAnimation {
196 target: image
197 properties: "opacity"
198 from : 1.0
199 to: 0.0
200 duration: Toolkit.UbuntuAnimation.FastDuration
201 }
202 PauseAnimation { duration: Toolkit.UbuntuAnimation.BriskDuration - Toolkit.UbuntuAnimation.FastDuration }
203 PropertyAction {
204 target: image
205 property: "source"
206 value: listView.container.tick
207 }
208 PropertyAnimation {
209 target: image
210 properties: "opacity"
211 from : 0.0
212 to: 1.0
213 duration: Toolkit.UbuntuAnimation.FastDuration
214 }
215 }, PropertyAnimation {
216 id: optionExpansion
217
218 target: option
219 properties: "opacity"
220 from : 0.0
221 to: 1.0
222 duration: Toolkit.UbuntuAnimation.SlowDuration
223 }, SequentialAnimation {
224 id: deselectedImageCollapse
225
226 PauseAnimation { duration: Toolkit.UbuntuAnimation.BriskDuration }
227 PropertyAnimation {
228 target: image
229 properties: "opacity"
230 from : 1.0
231 to: 0.0
232 duration: Toolkit.UbuntuAnimation.FastDuration
233 }
234 PauseAnimation { duration: Toolkit.UbuntuAnimation.FastDuration }
235 PropertyAction {
236 target: image
237 property: "source"
238 value: listView.container.chevron
239 }
240 PropertyAnimation {
241 target: image
242 properties: "opacity"
243 from : 0.0
244 to: 1.0
245 duration: Toolkit.UbuntuAnimation.FastDuration
246 }
247 }, SequentialAnimation {
248 id: selectedImageCollapse
249
250 PropertyAnimation {
251 target: image
252 properties: "opacity"
253 from : 0.0
254 to: 1.0
255 duration: Toolkit.UbuntuAnimation.FastDuration
256 }
257 PauseAnimation { duration: Toolkit.UbuntuAnimation.BriskDuration - Toolkit.UbuntuAnimation.FastDuration }
258 PropertyAnimation {
259 target: image
260 properties: "opacity"
261 from : 1.0
262 to: 0.0
263 duration: Toolkit.UbuntuAnimation.FastDuration
264 }
265 PauseAnimation { duration: Toolkit.UbuntuAnimation.FastDuration }
266 PropertyAction {
267 target: image
268 property: "source"
269 value: listView.container.chevron
270 }
271 PropertyAnimation {
272 target: image
273 properties: "opacity"
274 from : 0.0
275 to: 1.0
276 duration: Toolkit.UbuntuAnimation.FastDuration
277 }
278 }, PropertyAnimation {
279 id: optionCollapse
280 target: option
281 properties: "opacity"
282 from : 1.0
283 to: 0.0
284 duration: Toolkit.UbuntuAnimation.SlowDuration
285 }
286 ]
287
288 Row {
289 spacing: units.gu(1)
290
291 anchors {
292 left: parent.left
293 leftMargin: units.gu(2)
294 verticalCenter: parent.verticalCenter
295 }
296
297 Image {
298 id: leftIcon
299 objectName: "icon"
300
301 height: constrainImage ? option.height : sourceSize.height
302 source: option.iconSource
303 fillMode: constrainImage ? Image.PreserveAspectFit : Image.Stretch
304
305 ShaderEffect {
306 property color colour: assetColour
307 property Image source: parent
308
309 width: source.width
310 height: source.height
311 visible: colourImage
312
313 fragmentShader: fragColourShader
314 }
315 }
316
317 Column {
318 anchors {
319 verticalCenter: parent.verticalCenter
320 }
321 Label {
322 text: option.text === "" ? modelData : option.text
323 }
324 Label {
325 text: option.subText
326 visible: option.subText !== "" ? true : false
327 fontSize: "small"
328 }
329 }
330 }
331
332 Image {
333 id: image
334
335 width: units.gu(2)
336 height: units.gu(2)
337 source: listView.expanded || listView.multiSelection ? listView.container.tick : listView.container.chevron
338 opacity: option.selected ? 1.0 : 0.0
339 anchors {
340 right: parent.right
341 rightMargin: units.gu(2)
342 verticalCenter: parent.verticalCenter
343 }
344
345 //Our behaviour is only enabled for our expanded list due to flickering bugs in relation to all this other animations running on the expanding version.
346 Behavior on opacity {
347 enabled: listView.expanded
348
349 Toolkit.UbuntuNumberAnimation {
350 properties: "opacity"
351 duration: Toolkit.UbuntuAnimation.FastDuration
352 }
353 }
354
355 ShaderEffect {
356 property color colour: assetColour
357 property Image source: parent
358
359 width: source.width
360 height: source.height
361
362 fragmentShader: fragColourShader
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches