Merge lp:~osomon/webbrowser-app/new-ui-rtm into lp:webbrowser-app

Proposed by Olivier Tilloy
Status: Merged
Approved by: Bill Filler
Approved revision: 747
Merged at revision: 644
Proposed branch: lp:~osomon/webbrowser-app/new-ui-rtm
Merge into: lp:webbrowser-app
Diff against target: 7330 lines (+2633/-2545)
115 files modified
debian/control (+0/-1)
debian/webbrowser-app.install (+0/-1)
doc/WebView.qdoc (+1/-1)
po/webbrowser-app.pot (+83/-66)
src/Ubuntu/Components/Extras/Browser/ItemSelector01.qml (+4/-4)
src/Ubuntu/Components/Extras/Browser/UbuntuWebView01.qml (+3/-3)
src/Ubuntu/Components/Extras/Browser/UserAgent01.qml (+2/-2)
src/Ubuntu/Web/ItemSelector02.qml (+4/-4)
src/Ubuntu/Web/Selection.qml (+1/-1)
src/Ubuntu/Web/SelectionHandle.qml (+1/-1)
src/Ubuntu/Web/UbuntuWebView02.qml (+2/-2)
src/app/AlertDialog.qml (+3/-3)
src/app/AuthenticationDialog.qml (+3/-3)
src/app/BeforeUnloadDialog.qml (+2/-2)
src/app/BrowserView.qml (+10/-15)
src/app/CMakeLists.txt (+0/-3)
src/app/CertificateVerificationDialog.qml (+3/-3)
src/app/ChromeBase.qml (+69/-0)
src/app/ChromeButton.qml (+38/-0)
src/app/ConfirmDialog.qml (+4/-4)
src/app/ContentDownloadDialog.qml (+2/-2)
src/app/ContentPickerDialog.qml (+4/-2)
src/app/ContentShareDialog.qml (+2/-2)
src/app/Downloader.qml (+2/-2)
src/app/EmbeddedProgressBar.qml (+0/-58)
src/app/ErrorSheet.qml (+2/-4)
src/app/Favicon.qml (+33/-0)
src/app/FilePickerDialog.qml (+2/-1)
src/app/GeolocationPermissionRequest.qml (+2/-2)
src/app/KeyboardRectangle.qml (+2/-2)
src/app/PanelLoader.qml (+0/-175)
src/app/PermissionRequest.qml (+3/-3)
src/app/PromptDialog.qml (+3/-3)
src/app/ScrollTracker.qml (+66/-0)
src/app/Share.qml (+7/-3)
src/app/ThinProgressBar.qml (+35/-0)
src/app/WebViewImpl.qml (+3/-7)
src/app/actions/Back.qml (+2/-2)
src/app/actions/Bookmark.qml (+2/-2)
src/app/actions/BookmarkLink.qml (+2/-2)
src/app/actions/ClearHistory.qml (+2/-2)
src/app/actions/Copy.qml (+2/-2)
src/app/actions/CopyImage.qml (+2/-2)
src/app/actions/CopyLink.qml (+2/-2)
src/app/actions/Forward.qml (+2/-2)
src/app/actions/GoTo.qml (+2/-2)
src/app/actions/NewTab.qml (+2/-2)
src/app/actions/OpenImageInNewTab.qml (+2/-2)
src/app/actions/OpenLinkInNewTab.qml (+2/-2)
src/app/actions/Reload.qml (+2/-2)
src/app/actions/SaveImage.qml (+1/-1)
src/app/actions/ShareLink.qml (+1/-1)
src/app/webbrowser/ActivityView.qml (+0/-67)
src/app/webbrowser/AddressBar.qml (+112/-42)
src/app/webbrowser/BookmarksList.qml (+1/-1)
src/app/webbrowser/BookmarksView.qml (+0/-64)
src/app/webbrowser/Browser.qml (+242/-149)
src/app/webbrowser/Chrome.qml (+236/-154)
src/app/webbrowser/ExpandedHistoryView.qml (+118/-0)
src/app/webbrowser/Favicon.qml (+0/-25)
src/app/webbrowser/HistorySectionDelegate.qml (+63/-0)
src/app/webbrowser/HistoryView.qml (+143/-0)
src/app/webbrowser/NewTabView.qml (+31/-9)
src/app/webbrowser/PageDelegate.qml (+0/-160)
src/app/webbrowser/Suggestions.qml (+6/-5)
src/app/webbrowser/TabPreview.qml (+186/-0)
src/app/webbrowser/TabsList.qml (+0/-119)
src/app/webbrowser/TabsView.qml (+120/-0)
src/app/webbrowser/TimelineView.qml (+0/-333)
src/app/webbrowser/Toolbar.qml (+31/-0)
src/app/webbrowser/ToolbarAction.qml (+61/-0)
src/app/webbrowser/UrlDelegate.qml (+53/-41)
src/app/webbrowser/history-domain-model.cpp (+16/-0)
src/app/webbrowser/history-domain-model.h (+9/-0)
src/app/webbrowser/history-domainlist-model.cpp (+10/-1)
src/app/webbrowser/history-domainlist-model.h (+3/-0)
src/app/webbrowser/history-model.cpp (+6/-0)
src/app/webbrowser/history-model.h (+2/-1)
src/app/webbrowser/tabs-model.cpp (+21/-30)
src/app/webbrowser/tabs-model.h (+2/-7)
src/app/webbrowser/webbrowser-app.cpp (+1/-3)
src/app/webbrowser/webbrowser-app.qml (+2/-3)
src/app/webcontainer/AccountItemView.qml (+3/-3)
src/app/webcontainer/AccountsLoginPage.qml (+3/-3)
src/app/webcontainer/AccountsPage.qml (+1/-1)
src/app/webcontainer/AccountsView.qml (+3/-3)
src/app/webcontainer/Chrome.qml (+101/-0)
src/app/webcontainer/WebApp.qml (+96/-38)
src/app/webcontainer/WebViewImplOxide.qml (+2/-3)
src/app/webcontainer/WebViewImplWebkit.qml (+3/-7)
src/app/webcontainer/WebappContainerWebview.qml (+2/-4)
src/app/webcontainer/webapp-container.cpp (+3/-3)
src/app/webcontainer/webapp-container.qml (+3/-4)
tests/autopilot/webapp_container/tests/__init__.py (+2/-2)
tests/autopilot/webapp_container/tests/test_app_launch.py (+3/-3)
tests/autopilot/webapp_container/tests/test_chrome_setup.py (+11/-14)
tests/autopilot/webbrowser_app/emulators/browser.py (+94/-74)
tests/autopilot/webbrowser_app/tests/__init__.py (+25/-40)
tests/autopilot/webbrowser_app/tests/http_server.py (+0/-10)
tests/autopilot/webbrowser_app/tests/test_activity.py (+0/-33)
tests/autopilot/webbrowser_app/tests/test_addressbar_action_button.py (+4/-5)
tests/autopilot/webbrowser_app/tests/test_addressbar_bookmark.py (+107/-0)
tests/autopilot/webbrowser_app/tests/test_addressbar_selection.py (+10/-19)
tests/autopilot/webbrowser_app/tests/test_addressbar_states.py (+15/-14)
tests/autopilot/webbrowser_app/tests/test_backforward.py (+8/-15)
tests/autopilot/webbrowser_app/tests/test_chromeless.py (+0/-34)
tests/autopilot/webbrowser_app/tests/test_content_pick.py (+18/-145)
tests/autopilot/webbrowser_app/tests/test_geolocation.py (+2/-4)
tests/autopilot/webbrowser_app/tests/test_history.py (+23/-36)
tests/autopilot/webbrowser_app/tests/test_progressbar.py (+0/-105)
tests/autopilot/webbrowser_app/tests/test_tabs.py (+127/-142)
tests/autopilot/webbrowser_app/tests/test_toolbar.py (+0/-29)
tests/unittests/qml/CMakeLists.txt (+7/-0)
tests/unittests/qml/tst_Chrome.qml (+0/-40)
tests/unittests/tabs-model/tst_TabsModelTests.cpp (+53/-85)
To merge this branch: bzr merge lp:~osomon/webbrowser-app/new-ui-rtm
Reviewer Review Type Date Requested Status
Bill Filler (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+228278@code.launchpad.net

Commit message

New UI and UX, phase 1:
 - chrome in the header, with auto-hide/auto-reveal behaviour
 - new history view (with an option to clear the entire history), invoked from the drawer menu
 - new tabs view, invoked from the drawer menu
 - bookmarking from the address bar
 - tabs always ordered by recency (last viewed first)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
lp:~osomon/webbrowser-app/new-ui-rtm updated
727. By Olivier Tilloy

Add placeholder text in the address bar.

728. By Olivier Tilloy

If only one tab is currently open, ensure it fills the tabs view.

729. By Olivier Tilloy

Tweak chrome buttons’ height and spacing to match visual spec.

730. By Olivier Tilloy

Make the toolbars white and fully opaque.

731. By Olivier Tilloy

Do not allow sharing an empty URL.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
lp:~osomon/webbrowser-app/new-ui-rtm updated
732. By Olivier Tilloy

Auto-hide the chrome in the webapp container, just like in the browser.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
lp:~osomon/webbrowser-app/new-ui-rtm updated
733. By Olivier Tilloy

Simpler expression for ChromeBase.y depending on the state.

734. By Olivier Tilloy

Update all imports of the UITK to the latest version of the corresponding module available.

According to Florian, some components have duplicated code across different versions, and importing a new version also imports the old one. This should probably be fixed in the UITK, but it doesn’t hurt to refresh our import statements anyway.

735. By Olivier Tilloy

Elide the label of the ToolbarAction if needed.

736. By Olivier Tilloy

Un-hardcode a bunch of colors.

737. By Olivier Tilloy

Fix a bunch of harmless warnings when in chromeless mode (in that case the ScrollTracker is useless anyway).

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
lp:~osomon/webbrowser-app/new-ui-rtm updated
738. By Olivier Tilloy

Add missing share icon.

739. By Olivier Tilloy

Also display a symbolic icon when the address bar is unfocused.

740. By Olivier Tilloy

Do not reset the contents of the address bar if there was no previous valid URL.

741. By Olivier Tilloy

Do not allow overshooting in the tabs view.

742. By Olivier Tilloy

Instantiate the scroll tracker on demand.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
lp:~osomon/webbrowser-app/new-ui-rtm updated
743. By Olivier Tilloy

Add a drop shadow to the toolbars.

744. By Olivier Tilloy

Update outline colors to match visual spec.

745. By Olivier Tilloy

Do not show the divider for the last suggestion in the list.

746. By Olivier Tilloy

Updated translation template.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
lp:~osomon/webbrowser-app/new-ui-rtm updated
747. By Olivier Tilloy

Fix the history view section headers that were off by a day in timezones sufficiently far apart from UTC.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

tested, working well

review: Approve
Revision history for this message
Andrea Cimitan (cimi) wrote :

When you scroll down and the top bar disappears, you can see a white box at the bottom of the page until the top bar disappears...

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/control'
2--- debian/control 2014-07-23 07:59:28 +0000
3+++ debian/control 2014-07-30 17:01:24 +0000
4@@ -131,7 +131,6 @@
5 libqt5test5,
6 python3-autopilot,
7 ubuntu-ui-toolkit-autopilot,
8- unity8-autopilot,
9 webbrowser-app (>= ${binary:Version}),
10 Description: Ubuntu web browser autopilot tests
11 A lightweight web browser tailored for Ubuntu, based on the Oxide browser
12
13=== modified file 'debian/webbrowser-app.install'
14--- debian/webbrowser-app.install 2014-05-23 07:02:25 +0000
15+++ debian/webbrowser-app.install 2014-07-30 17:01:24 +0000
16@@ -3,7 +3,6 @@
17 usr/share/webbrowser-app/*.js
18 usr/share/webbrowser-app/screenshot.png
19 usr/share/webbrowser-app/actions/*.qml
20-usr/share/webbrowser-app/assets/*.png
21 usr/share/webbrowser-app/webbrowser/
22 usr/share/applications/webbrowser-app.desktop
23 usr/share/icons/hicolor/scalable/apps/webbrowser-app.svg
24
25=== modified file 'doc/WebView.qdoc'
26--- doc/WebView.qdoc 2014-07-04 11:01:31 +0000
27+++ doc/WebView.qdoc 2014-07-30 17:01:24 +0000
28@@ -176,7 +176,7 @@
29
30 Example of user-defined actions:
31 \code
32- import Ubuntu.Components 0.1
33+ import Ubuntu.Components 1.1
34 import Ubuntu.Web 0.2
35
36 WebView {
37
38=== modified file 'po/webbrowser-app.pot'
39--- po/webbrowser-app.pot 2014-07-04 13:06:45 +0000
40+++ po/webbrowser-app.pot 2014-07-30 17:01:24 +0000
41@@ -8,7 +8,7 @@
42 msgstr ""
43 "Project-Id-Version: webbrowser-app\n"
44 "Report-Msgid-Bugs-To: \n"
45-"POT-Creation-Date: 2014-07-04 10:06-0300\n"
46+"POT-Creation-Date: 2014-07-30 12:43+0200\n"
47 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
48 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
49 "Language-Team: LANGUAGE <LL@li.org>\n"
50@@ -16,6 +16,7 @@
51 "MIME-Version: 1.0\n"
52 "Content-Type: text/plain; charset=UTF-8\n"
53 "Content-Transfer-Encoding: 8bit\n"
54+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
55
56 #: src/app/AlertDialog.qml:24
57 msgid "JavaScript Alert"
58@@ -81,42 +82,30 @@
59 msgid "Back to safety"
60 msgstr ""
61
62-#: src/app/Chrome.qml:76 src/app/actions/Back.qml:23
63-msgid "Back"
64-msgstr ""
65-
66-#: src/app/Chrome.qml:95 src/app/actions/Forward.qml:23
67-msgid "Forward"
68-msgstr ""
69-
70-#: src/app/Chrome.qml:158 src/app/webbrowser/ActivityView.qml:36
71-msgid "Activity"
72-msgstr ""
73-
74 #: src/app/ConfirmDialog.qml:24
75 msgid "JavaScript Confirmation"
76 msgstr ""
77
78-#: src/app/ErrorSheet.qml:38
79+#: src/app/ErrorSheet.qml:36
80 msgid "Network Error"
81 msgstr ""
82
83 #. TRANSLATORS: %1 refers to the URL of the current page
84-#: src/app/ErrorSheet.qml:44
85+#: src/app/ErrorSheet.qml:42
86 #, qt-format
87 msgid "It appears you are having trouble viewing: %1."
88 msgstr ""
89
90-#: src/app/ErrorSheet.qml:50
91+#: src/app/ErrorSheet.qml:48
92 msgid ""
93 "Ubuntu suggests you check your network settings and try refreshing the page."
94 msgstr ""
95
96-#: src/app/ErrorSheet.qml:55
97+#: src/app/ErrorSheet.qml:53
98 msgid "Refresh page"
99 msgstr ""
100
101-#: src/app/FilePickerDialog.qml:27
102+#: src/app/FilePickerDialog.qml:28
103 msgid "Please choose a file"
104 msgstr ""
105
106@@ -126,7 +115,7 @@
107 msgstr ""
108
109 #: src/app/GeolocationPermissionRequest.qml:29
110-#: src/app/webcontainer/WebViewImplWebkit.qml:69
111+#: src/app/webcontainer/WebViewImplWebkit.qml:65
112 msgid "This page wants to know your device’s location."
113 msgstr ""
114
115@@ -154,6 +143,10 @@
116 msgid "The website %1:%2 requires authentication."
117 msgstr ""
118
119+#: src/app/actions/Back.qml:23
120+msgid "Back"
121+msgstr ""
122+
123 #. TRANSLATORS: This is a free-form list of keywords associated to the 'Back' action.
124 #. Keywords may actually be sentences, and must be separated by semi-colons.
125 #: src/app/actions/Back.qml:26
126@@ -196,6 +189,10 @@
127 msgid "Copy link"
128 msgstr ""
129
130+#: src/app/actions/Forward.qml:23
131+msgid "Forward"
132+msgstr ""
133+
134 #. TRANSLATORS: This is a free-form list of keywords associated to the 'Forward' action.
135 #. Keywords may actually be sentences, and must be separated by semi-colons.
136 #: src/app/actions/Forward.qml:26
137@@ -248,63 +245,83 @@
138 msgid "Share…"
139 msgstr ""
140
141-#: src/app/webbrowser/ActivityView.qml:54
142-#: src/app/webbrowser/NewTabView.qml:123
143+#: src/app/webbrowser/AddressBar.qml:148
144+msgid "search or enter an address"
145+msgstr ""
146+
147+#: src/app/webbrowser/Browser.qml:148
148+msgid "Share"
149+msgstr ""
150+
151+#: src/app/webbrowser/Browser.qml:162
152+msgid "History"
153+msgstr ""
154+
155+#: src/app/webbrowser/Browser.qml:168
156+msgid "Open tabs"
157+msgstr ""
158+
159+#: src/app/webbrowser/Browser.qml:174 src/app/webbrowser/TabsView.qml:54
160+msgid "New tab"
161+msgstr ""
162+
163+#: src/app/webbrowser/ExpandedHistoryView.qml:99
164+#, qt-format
165+msgid "%1 page"
166+msgid_plural "%1 pages"
167+msgstr[0] ""
168+msgstr[1] ""
169+
170+#: src/app/webbrowser/ExpandedHistoryView.qml:113
171+msgid "Less"
172+msgstr ""
173+
174+#: src/app/webbrowser/HistorySectionDelegate.qml:43
175+msgid "Last Visited"
176+msgstr ""
177+
178+#: src/app/webbrowser/HistorySectionDelegate.qml:45
179+msgid "Yesterday"
180+msgstr ""
181+
182+#: src/app/webbrowser/HistoryView.qml:95 src/app/webbrowser/TabsView.qml:95
183+msgid "Done"
184+msgstr ""
185+
186+#: src/app/webbrowser/HistoryView.qml:109
187+msgid "Clear"
188+msgstr ""
189+
190+#: src/app/webbrowser/HistoryView.qml:123
191+msgid "Delete all history?"
192+msgstr ""
193+
194+#: src/app/webbrowser/HistoryView.qml:126
195+msgid "Yes"
196+msgstr ""
197+
198+#: src/app/webbrowser/HistoryView.qml:135
199+msgid "No"
200+msgstr ""
201+
202+#: src/app/webbrowser/NewTabView.qml:122
203 msgid "Bookmarks"
204 msgstr ""
205
206-#: src/app/webbrowser/NewTabView.qml:125
207+#: src/app/webbrowser/NewTabView.qml:124
208 msgid "Top sites"
209 msgstr ""
210
211-#: src/app/webbrowser/NewTabView.qml:142
212+#: src/app/webbrowser/NewTabView.qml:141
213 msgid "see less"
214 msgstr ""
215
216-#: src/app/webbrowser/NewTabView.qml:142
217+#: src/app/webbrowser/NewTabView.qml:141
218 msgid "see more"
219 msgstr ""
220
221-#. TRANSLATORS: %1 refers to the number of open tabs
222-#: src/app/webbrowser/TabsList.qml:37
223-#, qt-format
224-msgid "Currently viewing (%1)"
225-msgstr ""
226-
227-#: src/app/webbrowser/TabsList.qml:69
228-msgid "+"
229-msgstr ""
230-
231-#: src/app/webbrowser/TimelineView.qml:87
232-msgid "Today"
233-msgstr ""
234-
235-#: src/app/webbrowser/TimelineView.qml:89
236-msgid "Yesterday"
237-msgstr ""
238-
239-#: src/app/webbrowser/TimelineView.qml:91
240-msgid "Last 7 Days"
241-msgstr ""
242-
243-#: src/app/webbrowser/TimelineView.qml:93
244-msgid "This Month"
245-msgstr ""
246-
247-#: src/app/webbrowser/TimelineView.qml:95
248-msgid "This Year"
249-msgstr ""
250-
251-#: src/app/webbrowser/TimelineView.qml:97
252-msgid "Older"
253-msgstr ""
254-
255-#: src/app/webbrowser/TimelineView.qml:287
256-msgid "(local files)"
257-msgstr ""
258-
259-#: src/app/webbrowser/TimelineView.qml:289
260-msgid "(other)"
261+#: src/app/webbrowser/TabsView.qml:110
262+msgid "Add"
263 msgstr ""
264
265 #: src/app/webbrowser/webbrowser-app.desktop.in:3
266@@ -320,13 +337,13 @@
267 msgstr ""
268
269 #. TRANSLATORS: %1 refers to the current page’s title
270-#: src/app/webbrowser/webbrowser-app.qml:36
271+#: src/app/webbrowser/webbrowser-app.qml:35
272 #: src/app/webcontainer/webapp-container.qml:54
273 #, qt-format
274 msgid "%1 - Ubuntu Web Browser"
275 msgstr ""
276
277-#: src/app/webbrowser/webbrowser-app.qml:38
278+#: src/app/webbrowser/webbrowser-app.qml:37
279 #: src/app/webcontainer/webapp-container.qml:56
280 msgid "Ubuntu Web Browser"
281 msgstr ""
282
283=== modified file 'src/Ubuntu/Components/Extras/Browser/ItemSelector01.qml'
284--- src/Ubuntu/Components/Extras/Browser/ItemSelector01.qml 2014-03-12 14:39:34 +0000
285+++ src/Ubuntu/Components/Extras/Browser/ItemSelector01.qml 2014-07-30 17:01:24 +0000
286@@ -1,5 +1,5 @@
287 /*
288- * Copyright 2013 Canonical Ltd.
289+ * Copyright 2013-2014 Canonical Ltd.
290 *
291 * This file is part of webbrowser-app.
292 *
293@@ -17,9 +17,9 @@
294 */
295
296 import QtQuick 2.0
297-import Ubuntu.Components 0.1
298-import Ubuntu.Components.ListItems 0.1 as ListItem
299-import Ubuntu.Components.Popups 0.1
300+import Ubuntu.Components 1.1
301+import Ubuntu.Components.ListItems 1.0 as ListItem
302+import Ubuntu.Components.Popups 1.0
303
304 Popover {
305 id: itemSelector
306
307=== modified file 'src/Ubuntu/Components/Extras/Browser/UbuntuWebView01.qml'
308--- src/Ubuntu/Components/Extras/Browser/UbuntuWebView01.qml 2014-06-05 11:49:42 +0000
309+++ src/Ubuntu/Components/Extras/Browser/UbuntuWebView01.qml 2014-07-30 17:01:24 +0000
310@@ -1,5 +1,5 @@
311 /*
312- * Copyright 2013 Canonical Ltd.
313+ * Copyright 2013-2014 Canonical Ltd.
314 *
315 * This file is part of webbrowser-app.
316 *
317@@ -19,9 +19,9 @@
318 import QtQuick 2.0
319 import QtWebKit 3.1
320 import QtWebKit.experimental 1.0
321-import Ubuntu.Components 0.1
322+import Ubuntu.Components 1.1
323 import Ubuntu.Components.Extras.Browser 0.1
324-import Ubuntu.Components.Popups 0.1
325+import Ubuntu.Components.Popups 1.0
326
327 /*!
328 \qmltype MainView
329
330=== modified file 'src/Ubuntu/Components/Extras/Browser/UserAgent01.qml'
331--- src/Ubuntu/Components/Extras/Browser/UserAgent01.qml 2014-03-12 14:39:34 +0000
332+++ src/Ubuntu/Components/Extras/Browser/UserAgent01.qml 2014-07-30 17:01:24 +0000
333@@ -1,5 +1,5 @@
334 /*
335- * Copyright 2013 Canonical Ltd.
336+ * Copyright 2013-2014 Canonical Ltd.
337 *
338 * This file is part of webbrowser-app.
339 *
340@@ -18,7 +18,7 @@
341
342 import QtQuick 2.0
343 import QtQuick.Window 2.0
344-import Ubuntu.Components 0.1
345+import Ubuntu.Components 1.1
346 import "ua-overrides.js" as Overrides
347
348 /*
349
350=== modified file 'src/Ubuntu/Web/ItemSelector02.qml'
351--- src/Ubuntu/Web/ItemSelector02.qml 2014-05-29 15:30:11 +0000
352+++ src/Ubuntu/Web/ItemSelector02.qml 2014-07-30 17:01:24 +0000
353@@ -1,5 +1,5 @@
354 /*
355- * Copyright 2013 Canonical Ltd.
356+ * Copyright 2013-2014 Canonical Ltd.
357 *
358 * This file is part of webbrowser-app.
359 *
360@@ -17,9 +17,9 @@
361 */
362
363 import QtQuick 2.0
364-import Ubuntu.Components 0.1
365-import Ubuntu.Components.ListItems 0.1 as ListItem
366-import Ubuntu.Components.Popups 0.1
367+import Ubuntu.Components 1.1
368+import Ubuntu.Components.ListItems 1.0 as ListItem
369+import Ubuntu.Components.Popups 1.0
370
371 Popover {
372 id: itemSelector
373
374=== modified file 'src/Ubuntu/Web/Selection.qml'
375--- src/Ubuntu/Web/Selection.qml 2014-06-25 20:22:39 +0000
376+++ src/Ubuntu/Web/Selection.qml 2014-07-30 17:01:24 +0000
377@@ -17,7 +17,7 @@
378 */
379
380 import QtQuick 2.0
381-import Ubuntu.Components 0.1
382+import Ubuntu.Components 1.1
383
384 Item {
385 id: __container
386
387=== modified file 'src/Ubuntu/Web/SelectionHandle.qml'
388--- src/Ubuntu/Web/SelectionHandle.qml 2014-06-19 07:40:21 +0000
389+++ src/Ubuntu/Web/SelectionHandle.qml 2014-07-30 17:01:24 +0000
390@@ -17,7 +17,7 @@
391 */
392
393 import QtQuick 2.0
394-import Ubuntu.Components 0.1
395+import Ubuntu.Components 1.1
396
397 Image {
398 property int axis
399
400=== modified file 'src/Ubuntu/Web/UbuntuWebView02.qml'
401--- src/Ubuntu/Web/UbuntuWebView02.qml 2014-06-25 20:22:39 +0000
402+++ src/Ubuntu/Web/UbuntuWebView02.qml 2014-07-30 17:01:24 +0000
403@@ -19,8 +19,8 @@
404 import QtQuick 2.0
405 import QtQuick.Window 2.0
406 import com.canonical.Oxide 1.0 as Oxide
407-import Ubuntu.Components 0.1
408-import Ubuntu.Components.Popups 0.1
409+import Ubuntu.Components 1.1
410+import Ubuntu.Components.Popups 1.0
411 import "." // QTBUG-34418
412
413 Oxide.WebView {
414
415=== modified file 'src/app/AlertDialog.qml'
416--- src/app/AlertDialog.qml 2014-03-26 10:00:18 +0000
417+++ src/app/AlertDialog.qml 2014-07-30 17:01:24 +0000
418@@ -1,5 +1,5 @@
419 /*
420- * Copyright 2013 Canonical Ltd.
421+ * Copyright 2013-2014 Canonical Ltd.
422 *
423 * This file is part of webbrowser-app.
424 *
425@@ -17,8 +17,8 @@
426 */
427
428 import QtQuick 2.0
429-import Ubuntu.Components 0.1
430-import Ubuntu.Components.Popups 0.1 as Popups
431+import Ubuntu.Components 1.1
432+import Ubuntu.Components.Popups 1.0 as Popups
433
434 Popups.Dialog {
435 title: i18n.tr("JavaScript Alert")
436
437=== modified file 'src/app/AuthenticationDialog.qml'
438--- src/app/AuthenticationDialog.qml 2013-09-20 15:36:43 +0000
439+++ src/app/AuthenticationDialog.qml 2014-07-30 17:01:24 +0000
440@@ -1,5 +1,5 @@
441 /*
442- * Copyright 2013 Canonical Ltd.
443+ * Copyright 2013-2014 Canonical Ltd.
444 *
445 * This file is part of webbrowser-app.
446 *
447@@ -17,8 +17,8 @@
448 */
449
450 import QtQuick 2.0
451-import Ubuntu.Components 0.1
452-import Ubuntu.Components.Popups 0.1 as Popups
453+import Ubuntu.Components 1.1
454+import Ubuntu.Components.Popups 1.0 as Popups
455
456 Popups.Dialog {
457 title: i18n.tr("Authentication required.")
458
459=== modified file 'src/app/BeforeUnloadDialog.qml'
460--- src/app/BeforeUnloadDialog.qml 2014-03-26 10:00:18 +0000
461+++ src/app/BeforeUnloadDialog.qml 2014-07-30 17:01:24 +0000
462@@ -17,8 +17,8 @@
463 */
464
465 import QtQuick 2.0
466-import Ubuntu.Components 0.1
467-import Ubuntu.Components.Popups 0.1 as Popups
468+import Ubuntu.Components 1.1
469+import Ubuntu.Components.Popups 1.0 as Popups
470
471 Popups.Dialog {
472 title: i18n.tr("Confirm Navigation")
473
474=== modified file 'src/app/BrowserView.qml'
475--- src/app/BrowserView.qml 2013-11-08 17:42:09 +0000
476+++ src/app/BrowserView.qml 2014-07-30 17:01:24 +0000
477@@ -1,5 +1,5 @@
478 /*
479- * Copyright 2013 Canonical Ltd.
480+ * Copyright 2013-2014 Canonical Ltd.
481 *
482 * This file is part of webbrowser-app.
483 *
484@@ -17,32 +17,27 @@
485 */
486
487 import QtQuick 2.0
488-import Ubuntu.Components 0.1
489+import Ubuntu.Components 1.1
490+import Ubuntu.Unity.Action 1.1 as UnityActions
491
492-MainView {
493- property bool chromeless: false
494+OrientationHelper {
495 property bool developerExtrasEnabled: false
496
497 property var currentWebview: null
498 property string title: currentWebview ? currentWebview.title : ""
499
500- property bool backForwardButtonsVisible: true
501- property bool activityButtonVisible: true
502- property bool addressBarVisible: true
503-
504 property var webbrowserWindow: null
505
506 property var osk: _osk
507
508- automaticOrientation: true
509-
510- // XXX: not using this property yet since the MainView doesn’t provide
511- // a way to know when the keyboard animation has finished (needed for
512- // autopilot tests). See the KeyboardRectangle component.
513- //anchorToKeyboard: true
514-
515 focus: true
516
517+ property QtObject actionManager: UnityActions.ActionManager {
518+ id: unityActionManager
519+ onQuit: Qt.quit()
520+ }
521+ property alias actions: unityActionManager.actions
522+
523 KeyboardRectangle {
524 id: _osk
525 }
526
527=== modified file 'src/app/CMakeLists.txt'
528--- src/app/CMakeLists.txt 2014-05-23 07:02:25 +0000
529+++ src/app/CMakeLists.txt 2014-07-30 17:01:24 +0000
530@@ -25,8 +25,5 @@
531 install(DIRECTORY actions DESTINATION ${CMAKE_INSTALL_DATADIR}/webbrowser-app
532 FILES_MATCHING PATTERN *.qml)
533
534-install(DIRECTORY assets DESTINATION ${CMAKE_INSTALL_DATADIR}/webbrowser-app
535- FILES_MATCHING PATTERN *.png)
536-
537 add_subdirectory(webbrowser)
538 add_subdirectory(webcontainer)
539
540=== modified file 'src/app/CertificateVerificationDialog.qml'
541--- src/app/CertificateVerificationDialog.qml 2013-09-23 09:49:03 +0000
542+++ src/app/CertificateVerificationDialog.qml 2014-07-30 17:01:24 +0000
543@@ -1,5 +1,5 @@
544 /*
545- * Copyright 2013 Canonical Ltd.
546+ * Copyright 2013-2014 Canonical Ltd.
547 *
548 * This file is part of webbrowser-app.
549 *
550@@ -17,8 +17,8 @@
551 */
552
553 import QtQuick 2.0
554-import Ubuntu.Components 0.1
555-import Ubuntu.Components.Popups 0.1 as Popups
556+import Ubuntu.Components 1.1
557+import Ubuntu.Components.Popups 1.0 as Popups
558
559 Popups.Dialog {
560 title: i18n.tr("This connection is untrusted")
561
562=== added file 'src/app/ChromeBase.qml'
563--- src/app/ChromeBase.qml 1970-01-01 00:00:00 +0000
564+++ src/app/ChromeBase.qml 2014-07-30 17:01:24 +0000
565@@ -0,0 +1,69 @@
566+/*
567+ * Copyright 2014 Canonical Ltd.
568+ *
569+ * This file is part of webbrowser-app.
570+ *
571+ * webbrowser-app is free software; you can redistribute it and/or modify
572+ * it under the terms of the GNU General Public License as published by
573+ * the Free Software Foundation; version 3.
574+ *
575+ * webbrowser-app is distributed in the hope that it will be useful,
576+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
577+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
578+ * GNU General Public License for more details.
579+ *
580+ * You should have received a copy of the GNU General Public License
581+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
582+ */
583+
584+import QtQuick 2.2
585+import Ubuntu.Components 1.1
586+
587+FocusScope {
588+ id: chrome
589+
590+ readonly property real visibleHeight: y + height
591+ property var webview
592+
593+ states: [
594+ State {
595+ name: "shown"
596+ },
597+ State {
598+ name: "hidden"
599+ }
600+ ]
601+ state: "shown"
602+
603+ y: (state == "shown") ? 0 : -height
604+ Behavior on y {
605+ SmoothedAnimation {
606+ duration: UbuntuAnimation.BriskDuration
607+ }
608+ }
609+
610+ Rectangle {
611+ anchors.fill: parent
612+ color: Theme.palette.normal.background
613+
614+ Rectangle {
615+ anchors {
616+ left: parent.left
617+ right: parent.right
618+ bottom: parent.bottom
619+ }
620+ height: units.dp(1)
621+ color: "#dedede"
622+ }
623+ }
624+
625+ ThinProgressBar {
626+ webview: chrome.webview
627+
628+ anchors {
629+ left: parent.left
630+ right: parent.right
631+ bottom: parent.bottom
632+ }
633+ }
634+}
635
636=== added file 'src/app/ChromeButton.qml'
637--- src/app/ChromeButton.qml 1970-01-01 00:00:00 +0000
638+++ src/app/ChromeButton.qml 2014-07-30 17:01:24 +0000
639@@ -0,0 +1,38 @@
640+/*
641+ * Copyright 2014 Canonical Ltd.
642+ *
643+ * This file is part of webbrowser-app.
644+ *
645+ * webbrowser-app is free software; you can redistribute it and/or modify
646+ * it under the terms of the GNU General Public License as published by
647+ * the Free Software Foundation; version 3.
648+ *
649+ * webbrowser-app is distributed in the hope that it will be useful,
650+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
651+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
652+ * GNU General Public License for more details.
653+ *
654+ * You should have received a copy of the GNU General Public License
655+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
656+ */
657+
658+import QtQuick 2.0
659+import Ubuntu.Components 1.1
660+
661+AbstractButton {
662+ property real iconSize: width
663+ property alias iconName: icon.name
664+
665+ Icon {
666+ id: icon
667+ anchors.centerIn: parent
668+ width: parent.iconSize
669+ height: width
670+ }
671+
672+ opacity: enabled ? 1.0 : 0.3
673+
674+ Behavior on width {
675+ UbuntuNumberAnimation {}
676+ }
677+}
678
679=== modified file 'src/app/ConfirmDialog.qml'
680--- src/app/ConfirmDialog.qml 2013-09-20 22:38:38 +0000
681+++ src/app/ConfirmDialog.qml 2014-07-30 17:01:24 +0000
682@@ -1,5 +1,5 @@
683 /*
684- * Copyright 2013 Canonical Ltd.
685+ * Copyright 2013-2014 Canonical Ltd.
686 *
687 * This file is part of webbrowser-app.
688 *
689@@ -17,8 +17,8 @@
690 */
691
692 import QtQuick 2.0
693-import Ubuntu.Components 0.1
694-import Ubuntu.Components.Popups 0.1 as Popups
695+import Ubuntu.Components 1.1
696+import Ubuntu.Components.Popups 1.0 as Popups
697
698 Popups.Dialog {
699 title: i18n.tr("JavaScript Confirmation")
700@@ -35,4 +35,4 @@
701 }
702
703 Component.onCompleted: show()
704-}
705\ No newline at end of file
706+}
707
708=== modified file 'src/app/ContentDownloadDialog.qml'
709--- src/app/ContentDownloadDialog.qml 2014-07-09 12:01:07 +0000
710+++ src/app/ContentDownloadDialog.qml 2014-07-30 17:01:24 +0000
711@@ -17,8 +17,8 @@
712 */
713
714 import QtQuick 2.0
715-import Ubuntu.Components 0.1
716-import Ubuntu.Components.Popups 0.1
717+import Ubuntu.Components 1.1
718+import Ubuntu.Components.Popups 1.0
719 import Ubuntu.Content 0.1
720
721 PopupBase {
722
723=== modified file 'src/app/ContentPickerDialog.qml'
724--- src/app/ContentPickerDialog.qml 2014-06-20 15:49:20 +0000
725+++ src/app/ContentPickerDialog.qml 2014-07-30 17:01:24 +0000
726@@ -17,14 +17,16 @@
727 */
728
729 import QtQuick 2.0
730-import Ubuntu.Components 0.1
731-import Ubuntu.Components.Popups 0.1 as Popups
732+import Ubuntu.Components 1.1
733+import Ubuntu.Components.Popups 1.0 as Popups
734 import Ubuntu.Content 0.1
735 import "MimeTypeMapper.js" as MimeTypeMapper
736
737 Component {
738 Popups.PopupBase {
739 id: picker
740+ objectName: "contentPickerDialog"
741+
742 property var activeTransfer
743 property var selectedItems
744
745
746=== modified file 'src/app/ContentShareDialog.qml'
747--- src/app/ContentShareDialog.qml 2014-07-09 12:01:07 +0000
748+++ src/app/ContentShareDialog.qml 2014-07-30 17:01:24 +0000
749@@ -17,8 +17,8 @@
750 */
751
752 import QtQuick 2.0
753-import Ubuntu.Components 0.1
754-import Ubuntu.Components.Popups 0.1
755+import Ubuntu.Components 1.1
756+import Ubuntu.Components.Popups 1.0
757 import Ubuntu.Content 0.1
758
759 PopupBase {
760
761=== modified file 'src/app/Downloader.qml'
762--- src/app/Downloader.qml 2014-07-09 12:44:08 +0000
763+++ src/app/Downloader.qml 2014-07-30 17:01:24 +0000
764@@ -17,8 +17,8 @@
765 */
766
767 import QtQuick 2.0
768-import Ubuntu.Components 0.1
769-import Ubuntu.Components.Popups 0.1
770+import Ubuntu.Components 1.1
771+import Ubuntu.Components.Popups 1.0
772 import Ubuntu.DownloadManager 0.1
773 import Ubuntu.Content 0.1
774 import "MimeTypeMapper.js" as MimeTypeMapper
775
776=== removed file 'src/app/EmbeddedProgressBar.qml'
777--- src/app/EmbeddedProgressBar.qml 2013-07-18 12:04:50 +0000
778+++ src/app/EmbeddedProgressBar.qml 1970-01-01 00:00:00 +0000
779@@ -1,58 +0,0 @@
780-/*
781- * Copyright 2013 Canonical Ltd.
782- *
783- * This file is part of webbrowser-app.
784- *
785- * webbrowser-app is free software; you can redistribute it and/or modify
786- * it under the terms of the GNU General Public License as published by
787- * the Free Software Foundation; version 3.
788- *
789- * webbrowser-app is distributed in the hope that it will be useful,
790- * but WITHOUT ANY WARRANTY; without even the implied warranty of
791- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
792- * GNU General Public License for more details.
793- *
794- * You should have received a copy of the GNU General Public License
795- * along with this program. If not, see <http://www.gnu.org/licenses/>.
796- */
797-
798-import QtQuick 2.0
799-
800-ShaderEffect {
801- property real minimumValue
802- property real maximumValue
803- property real value
804-
805- property alias source: __source.sourceItem
806-
807- property color bgColor
808- property color fgColor
809-
810- anchors.fill: source
811-
812- cullMode: ShaderEffect.BackFaceCulling
813-
814- property var _source: ShaderEffectSource {
815- id: __source
816- hideSource: true
817- }
818- property real _progress: value / (maximumValue - minimumValue)
819-
820- fragmentShader: "
821- varying highp vec2 qt_TexCoord0;
822- uniform sampler2D _source;
823- uniform highp vec4 bgColor;
824- uniform highp vec4 fgColor;
825- uniform lowp float qt_Opacity;
826- uniform lowp float _progress;
827- void main() {
828- highp vec4 color = texture2D(_source, qt_TexCoord0);
829- if (qt_TexCoord0.x <= _progress) {
830- highp float luminance = dot(vec3(0.2126, 0.7152, 0.0722), color.rgb);
831- gl_FragColor = mix(fgColor, bgColor, luminance) * color.a * qt_Opacity;
832- } else {
833- gl_FragColor = color * qt_Opacity;
834- }
835- }
836- "
837-}
838
839=== modified file 'src/app/ErrorSheet.qml'
840--- src/app/ErrorSheet.qml 2013-07-18 12:04:50 +0000
841+++ src/app/ErrorSheet.qml 2014-07-30 17:01:24 +0000
842@@ -1,5 +1,5 @@
843 /*
844- * Copyright 2013 Canonical Ltd.
845+ * Copyright 2013-2014 Canonical Ltd.
846 *
847 * This file is part of webbrowser-app.
848 *
849@@ -17,15 +17,13 @@
850 */
851
852 import QtQuick 2.0
853-import Ubuntu.Components 0.1
854+import Ubuntu.Components 1.1
855
856 Rectangle {
857 property string url
858
859 signal refreshClicked()
860
861- color: "white"
862-
863 Column {
864 anchors.fill: parent
865 anchors.margins: units.gu(4)
866
867=== added file 'src/app/Favicon.qml'
868--- src/app/Favicon.qml 1970-01-01 00:00:00 +0000
869+++ src/app/Favicon.qml 2014-07-30 17:01:24 +0000
870@@ -0,0 +1,33 @@
871+/*
872+ * Copyright 2014 Canonical Ltd.
873+ *
874+ * This file is part of webbrowser-app.
875+ *
876+ * webbrowser-app is free software; you can redistribute it and/or modify
877+ * it under the terms of the GNU General Public License as published by
878+ * the Free Software Foundation; version 3.
879+ *
880+ * webbrowser-app is distributed in the hope that it will be useful,
881+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
882+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
883+ * GNU General Public License for more details.
884+ *
885+ * You should have received a copy of the GNU General Public License
886+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
887+ */
888+
889+import QtQuick 2.0
890+import Ubuntu.Components 1.1
891+
892+Image {
893+ property bool fallbackIcon: true
894+
895+ width: units.dp(16)
896+ height: units.dp(16)
897+
898+ Icon {
899+ anchors.fill: parent
900+ name: "stock_website"
901+ visible: parent.fallbackIcon && (parent.status !== Image.Ready)
902+ }
903+}
904
905=== modified file 'src/app/FilePickerDialog.qml'
906--- src/app/FilePickerDialog.qml 2014-04-11 11:29:00 +0000
907+++ src/app/FilePickerDialog.qml 2014-07-30 17:01:24 +0000
908@@ -18,7 +18,8 @@
909
910 import QtQuick 2.0
911 import QtQuick.Dialogs 1.0
912-import Ubuntu.Components.Popups 0.1 as Popups
913+import Ubuntu.Components 1.1
914+import Ubuntu.Components.Popups 1.0 as Popups
915
916 Component {
917 Popups.Dialog {
918
919=== modified file 'src/app/GeolocationPermissionRequest.qml'
920--- src/app/GeolocationPermissionRequest.qml 2014-06-18 08:31:43 +0000
921+++ src/app/GeolocationPermissionRequest.qml 2014-07-30 17:01:24 +0000
922@@ -17,8 +17,8 @@
923 */
924
925 import QtQuick 2.0
926-import Ubuntu.Components 0.1
927-import Ubuntu.Components.Popups 0.1
928+import Ubuntu.Components 1.1
929+import Ubuntu.Components.Popups 1.0
930
931 Dialog {
932 id: dialog
933
934=== modified file 'src/app/KeyboardRectangle.qml'
935--- src/app/KeyboardRectangle.qml 2013-07-25 17:27:29 +0000
936+++ src/app/KeyboardRectangle.qml 2014-07-30 17:01:24 +0000
937@@ -1,5 +1,5 @@
938 /*
939- * Copyright 2013 Canonical Ltd.
940+ * Copyright 2013-2014 Canonical Ltd.
941 *
942 * This file is part of webbrowser-app.
943 *
944@@ -21,7 +21,7 @@
945 // until the shell/WM takes care of that on behalf of the applications.
946
947 import QtQuick 2.0
948-import Ubuntu.Components 0.1
949+import Ubuntu.Components 1.1
950
951 Item {
952 id: keyboardRect
953
954=== removed file 'src/app/PanelLoader.qml'
955--- src/app/PanelLoader.qml 2014-07-24 10:32:35 +0000
956+++ src/app/PanelLoader.qml 1970-01-01 00:00:00 +0000
957@@ -1,175 +0,0 @@
958-/*
959- * Copyright 2013-2014 Canonical Ltd.
960- *
961- * This file is part of webbrowser-app.
962- *
963- * webbrowser-app is free software; you can redistribute it and/or modify
964- * it under the terms of the GNU General Public License as published by
965- * the Free Software Foundation; version 3.
966- *
967- * webbrowser-app is distributed in the hope that it will be useful,
968- * but WITHOUT ANY WARRANTY; without even the implied warranty of
969- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
970- * GNU General Public License for more details.
971- *
972- * You should have received a copy of the GNU General Public License
973- * along with this program. If not, see <http://www.gnu.org/licenses/>.
974- */
975-
976-import QtQuick 2.0
977-import Ubuntu.Components 0.1
978-
979-Loader {
980- id: chromePanel
981-
982- property var currentWebview
983- property var panel: item ? item : null
984- property Item chrome: item ? item.contents[0] : null
985-
986- property bool chromeless: false
987- property bool opened: panel ? panel.opened : false
988-
989- property bool backForwardButtonsVisible: true
990- property bool activityButtonVisible: true
991- property bool addressBarVisible: true
992-
993- property string searchUrl
994- onSearchUrlChanged: internal.setSearchUrl()
995- onChromeChanged: internal.setSearchUrl()
996-
997- signal urlValidated
998- signal toggleActivityViewClicked
999-
1000- QtObject {
1001- id: internal
1002- function setSearchUrl() {
1003- if (chromePanel.chrome !== null) {
1004- chromePanel.chrome.searchUrl = chromePanel.searchUrl
1005- }
1006- }
1007- }
1008-
1009- function open() {
1010- if (panel) {
1011- panel.open()
1012- }
1013- }
1014-
1015- function close() {
1016- if (panel) {
1017- panel.close()
1018- }
1019- }
1020-
1021- state: panel ? panel.state : ""
1022-
1023- sourceComponent: chromePanel.chromeless ? undefined : panelComponent
1024-
1025- Component {
1026- id: panelComponent
1027-
1028- Panel {
1029- // Close the Panel when user clicks on the app contents.
1030- // FIXME : This is deprecated in Panel and should be detected
1031- // by the app.
1032- __closeOnContentsClicks: true
1033- anchors {
1034- left: parent ? parent.left : undefined
1035- right: parent ? parent.right : undefined
1036- bottom: parent ? parent.bottom : undefined
1037- }
1038- height: units.gu(8)
1039-
1040- locked: chromePanel.currentWebview ? chromePanel.currentWebview.fullscreen : false
1041- Component.onCompleted: open()
1042- onOpenedChanged: {
1043- if (!opened) {
1044- Qt.inputMethod.hide()
1045- }
1046- }
1047-
1048- Chrome {
1049- id: chrome
1050-
1051- anchors.fill: parent
1052- title: currentWebview.title
1053-
1054- Connections {
1055- target: chromePanel
1056- onCurrentWebviewChanged: {
1057- if (currentWebview !== undefined) {
1058- chrome.url = currentWebview.url
1059- }
1060- }
1061- }
1062- Connections {
1063- target: chromePanel.currentWebview
1064- onUrlChanged: {
1065- // ensure that the URL actually changes so that the
1066- // address bar is updated in case the user has entered a
1067- // new address that redirects to where she previously was
1068- // (https://bugs.launchpad.net/webbrowser-app/+bug/1306615)
1069- chrome.url = ""
1070- chrome.url = currentWebview.url
1071- }
1072- }
1073-
1074- loading: currentWebview ? currentWebview.loading
1075- // workaround for https://bugs.launchpad.net/oxide/+bug/1290821
1076- && !currentWebview.lastLoadStopped
1077- : false
1078- loadProgress: currentWebview ? currentWebview.loadProgress : 0
1079-
1080- canGoBack: currentWebview ? currentWebview.canGoBack : false
1081- onGoBackClicked: currentWebview.goBack()
1082-
1083- canGoForward: currentWebview ? currentWebview.canGoForward : false
1084- onGoForwardClicked: currentWebview.goForward()
1085-
1086- onUrlValidated: {
1087- currentWebview.url = url
1088- chromePanel.urlValidated()
1089- }
1090-
1091- backForwardButtonsVisible: chromePanel.backForwardButtonsVisible
1092- activityButtonVisible: chromePanel.activityButtonVisible
1093- addressBarVisible: chromePanel.addressBarVisible
1094-
1095- property bool stopped: false
1096- onLoadingChanged: {
1097- if (loading) {
1098- if (panel) {
1099- panel.open()
1100- }
1101- } else if (stopped) {
1102- stopped = false
1103- } else if (!addressBar.activeFocus) {
1104- if (panel) {
1105- panel.close()
1106- }
1107- if (currentWebview) {
1108- currentWebview.forceActiveFocus()
1109- }
1110- }
1111- }
1112-
1113- onRequestReload: currentWebview.reload()
1114- onRequestStop: {
1115- stopped = true
1116- currentWebview.stop()
1117- }
1118-
1119- onToggleTabsClicked: toggleActivityViewClicked()
1120- }
1121- }
1122- }
1123-
1124- Connections {
1125- target: chromePanel.currentWebview
1126- onFullscreenChanged: {
1127- if (chromePanel.currentWebview.fullscreen) {
1128- chromePanel.close()
1129- }
1130- }
1131- }
1132-}
1133
1134=== modified file 'src/app/PermissionRequest.qml'
1135--- src/app/PermissionRequest.qml 2013-08-30 15:07:14 +0000
1136+++ src/app/PermissionRequest.qml 2014-07-30 17:01:24 +0000
1137@@ -1,5 +1,5 @@
1138 /*
1139- * Copyright 2013 Canonical Ltd.
1140+ * Copyright 2013-2014 Canonical Ltd.
1141 *
1142 * This file is part of webbrowser-app.
1143 *
1144@@ -17,8 +17,8 @@
1145 */
1146
1147 import QtQuick 2.0
1148-import Ubuntu.Components 0.1
1149-import Ubuntu.Components.Popups 0.1
1150+import Ubuntu.Components 1.1
1151+import Ubuntu.Components.Popups 1.0
1152
1153 Dialog {
1154 id: dialog
1155
1156=== modified file 'src/app/PromptDialog.qml'
1157--- src/app/PromptDialog.qml 2014-03-26 10:00:18 +0000
1158+++ src/app/PromptDialog.qml 2014-07-30 17:01:24 +0000
1159@@ -1,5 +1,5 @@
1160 /*
1161- * Copyright 2013 Canonical Ltd.
1162+ * Copyright 2013-2014 Canonical Ltd.
1163 *
1164 * This file is part of webbrowser-app.
1165 *
1166@@ -17,8 +17,8 @@
1167 */
1168
1169 import QtQuick 2.0
1170-import Ubuntu.Components 0.1
1171-import Ubuntu.Components.Popups 0.1 as Popups
1172+import Ubuntu.Components 1.1
1173+import Ubuntu.Components.Popups 1.0 as Popups
1174
1175 Popups.Dialog {
1176 title: i18n.tr("JavaScript Prompt")
1177
1178=== added file 'src/app/ScrollTracker.qml'
1179--- src/app/ScrollTracker.qml 1970-01-01 00:00:00 +0000
1180+++ src/app/ScrollTracker.qml 2014-07-30 17:01:24 +0000
1181@@ -0,0 +1,66 @@
1182+/*
1183+ * Copyright 2014 Canonical Ltd.
1184+ *
1185+ * This file is part of webbrowser-app.
1186+ *
1187+ * webbrowser-app is free software; you can redistribute it and/or modify
1188+ * it under the terms of the GNU General Public License as published by
1189+ * the Free Software Foundation; version 3.
1190+ *
1191+ * webbrowser-app is distributed in the hope that it will be useful,
1192+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1193+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1194+ * GNU General Public License for more details.
1195+ *
1196+ * You should have received a copy of the GNU General Public License
1197+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1198+ */
1199+
1200+import QtQuick 2.0
1201+
1202+Item {
1203+ id: scrollTracker
1204+
1205+ property var webview
1206+ property var header
1207+
1208+ readonly property bool nearTop: webview ? webview.contentY < (internal.headerHeight / internal.contentRatio) : false
1209+ readonly property bool nearBottom: webview ? (webview.contentY + internal.viewportHeight + internal.headerHeight / internal.contentRatio) > internal.contentHeight : false
1210+
1211+ property bool active: true
1212+
1213+ signal scrolledUp()
1214+ signal scrolledDown()
1215+
1216+ enabled: false
1217+ visible: false
1218+
1219+ QtObject {
1220+ id: internal
1221+
1222+ readonly property real headerHeight: scrollTracker.header ? scrollTracker.header.height : 0
1223+ readonly property real headerVisibleHeight: scrollTracker.header ? scrollTracker.header.visibleHeight : 0
1224+
1225+ readonly property real contentHeight: scrollTracker.webview ? scrollTracker.webview.contentHeight + headerVisibleHeight : 0.0
1226+ readonly property real viewportHeight: scrollTracker.webview ? scrollTracker.webview.viewportHeight + headerVisibleHeight : 0.0
1227+ readonly property real maxContentY: scrollTracker.webview ? scrollTracker.webview.contentHeight - scrollTracker.webview.viewportHeight : 0.0
1228+
1229+ readonly property real contentRatio: scrollTracker.webview ? scrollTracker.webview.viewportHeight / scrollTracker.webview.contentHeight : 1.0
1230+
1231+ readonly property real currentScrollFraction: (maxContentY == 0.0) ? 0.0 : (scrollTracker.webview.contentY / maxContentY)
1232+ property real previousScrollFraction: 0.0
1233+ }
1234+
1235+ Connections {
1236+ target: scrollTracker.active ? scrollTracker.webview : null
1237+ onContentYChanged: {
1238+ var old = internal.previousScrollFraction
1239+ internal.previousScrollFraction = internal.currentScrollFraction
1240+ if (internal.currentScrollFraction < old) {
1241+ scrollTracker.scrolledUp()
1242+ } else if (internal.currentScrollFraction > old) {
1243+ scrollTracker.scrolledDown()
1244+ }
1245+ }
1246+ }
1247+}
1248
1249=== modified file 'src/app/Share.qml'
1250--- src/app/Share.qml 2014-07-09 12:44:08 +0000
1251+++ src/app/Share.qml 2014-07-30 17:01:24 +0000
1252@@ -17,17 +17,21 @@
1253 */
1254
1255 import QtQuick 2.0
1256-import Ubuntu.Components 0.1
1257-import Ubuntu.Components.Popups 0.1
1258+import Ubuntu.Components 1.1
1259+import Ubuntu.Components.Popups 1.0
1260 import Ubuntu.DownloadManager 0.1
1261 import Ubuntu.Content 0.1
1262
1263 Item {
1264 id: shareItem
1265
1266+ signal done()
1267+
1268 Component {
1269 id: shareDialog
1270- ContentShareDialog { }
1271+ ContentShareDialog {
1272+ Component.onDestruction: shareItem.done()
1273+ }
1274 }
1275
1276 Component {
1277
1278=== added file 'src/app/ThinProgressBar.qml'
1279--- src/app/ThinProgressBar.qml 1970-01-01 00:00:00 +0000
1280+++ src/app/ThinProgressBar.qml 2014-07-30 17:01:24 +0000
1281@@ -0,0 +1,35 @@
1282+/*
1283+ * Copyright 2014 Canonical Ltd.
1284+ *
1285+ * This file is part of webbrowser-app.
1286+ *
1287+ * webbrowser-app is free software; you can redistribute it and/or modify
1288+ * it under the terms of the GNU General Public License as published by
1289+ * the Free Software Foundation; version 3.
1290+ *
1291+ * webbrowser-app is distributed in the hope that it will be useful,
1292+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1293+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1294+ * GNU General Public License for more details.
1295+ *
1296+ * You should have received a copy of the GNU General Public License
1297+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
1298+ */
1299+
1300+import QtQuick 2.0
1301+import Ubuntu.Components 1.1
1302+
1303+ProgressBar {
1304+ property var webview
1305+
1306+ height: units.dp(3)
1307+
1308+ showProgressPercentage: false
1309+ value: webview ? webview.loadProgress / 100 : 0.0
1310+ visible: webview ? webview.loading
1311+ // Workaround for https://bugs.launchpad.net/oxide/+bug/1290821.
1312+ // Note: this also works with a QtWebKit webview by chance,
1313+ // because !undefined evaluates to true.
1314+ && !webview.lastLoadStopped
1315+ : false
1316+}
1317
1318=== modified file 'src/app/WebViewImpl.qml'
1319--- src/app/WebViewImpl.qml 2014-07-01 12:21:19 +0000
1320+++ src/app/WebViewImpl.qml 2014-07-30 17:01:24 +0000
1321@@ -1,5 +1,5 @@
1322 /*
1323- * Copyright 2013 Canonical Ltd.
1324+ * Copyright 2013-2014 Canonical Ltd.
1325 *
1326 * This file is part of webbrowser-app.
1327 *
1328@@ -17,8 +17,8 @@
1329 */
1330
1331 import QtQuick 2.0
1332-import Ubuntu.Components 0.1
1333-import Ubuntu.Components.Popups 0.1
1334+import Ubuntu.Components 1.1
1335+import Ubuntu.Components.Popups 1.0
1336 import Ubuntu.Web 0.2
1337 import "actions" as Actions
1338
1339@@ -26,7 +26,6 @@
1340 id: webview
1341
1342 property var currentWebview: webview
1343- property var toolbar: null
1344
1345 /*experimental.certificateVerificationDialog: CertificateVerificationDialog {}
1346 experimental.authenticationDialog: AuthenticationDialog {}
1347@@ -68,9 +67,6 @@
1348 }
1349
1350 onGeolocationPermissionRequested: {
1351- if (webview.toolbar) {
1352- webview.toolbar.close()
1353- }
1354 PopupUtils.open(Qt.resolvedUrl("GeolocationPermissionRequest.qml"),
1355 webview.currentWebview, {"request": request})
1356 // TODO: we might want to store the answer to avoid requesting
1357
1358=== modified file 'src/app/actions/Back.qml'
1359--- src/app/actions/Back.qml 2013-11-07 14:29:29 +0000
1360+++ src/app/actions/Back.qml 2014-07-30 17:01:24 +0000
1361@@ -1,5 +1,5 @@
1362 /*
1363- * Copyright 2013 Canonical Ltd.
1364+ * Copyright 2013-2014 Canonical Ltd.
1365 *
1366 * This file is part of webbrowser-app.
1367 *
1368@@ -16,7 +16,7 @@
1369 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1370 */
1371
1372-import Ubuntu.Components 0.1
1373+import Ubuntu.Components 1.1
1374 import Ubuntu.Unity.Action 1.0 as UnityActions
1375
1376 UnityActions.Action {
1377
1378=== modified file 'src/app/actions/Bookmark.qml'
1379--- src/app/actions/Bookmark.qml 2013-11-07 14:29:29 +0000
1380+++ src/app/actions/Bookmark.qml 2014-07-30 17:01:24 +0000
1381@@ -1,5 +1,5 @@
1382 /*
1383- * Copyright 2013 Canonical Ltd.
1384+ * Copyright 2013-2014 Canonical Ltd.
1385 *
1386 * This file is part of webbrowser-app.
1387 *
1388@@ -16,7 +16,7 @@
1389 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1390 */
1391
1392-import Ubuntu.Components 0.1
1393+import Ubuntu.Components 1.1
1394 import Ubuntu.Unity.Action 1.0 as UnityActions
1395
1396 UnityActions.Action {
1397
1398=== modified file 'src/app/actions/BookmarkLink.qml'
1399--- src/app/actions/BookmarkLink.qml 2013-11-07 14:29:29 +0000
1400+++ src/app/actions/BookmarkLink.qml 2014-07-30 17:01:24 +0000
1401@@ -1,5 +1,5 @@
1402 /*
1403- * Copyright 2013 Canonical Ltd.
1404+ * Copyright 2013-2014 Canonical Ltd.
1405 *
1406 * This file is part of webbrowser-app.
1407 *
1408@@ -16,7 +16,7 @@
1409 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1410 */
1411
1412-import Ubuntu.Components 0.1
1413+import Ubuntu.Components 1.1
1414
1415 Action {
1416 text: i18n.tr("Bookmark link")
1417
1418=== modified file 'src/app/actions/ClearHistory.qml'
1419--- src/app/actions/ClearHistory.qml 2013-11-07 14:29:29 +0000
1420+++ src/app/actions/ClearHistory.qml 2014-07-30 17:01:24 +0000
1421@@ -1,5 +1,5 @@
1422 /*
1423- * Copyright 2013 Canonical Ltd.
1424+ * Copyright 2013-2014 Canonical Ltd.
1425 *
1426 * This file is part of webbrowser-app.
1427 *
1428@@ -16,7 +16,7 @@
1429 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1430 */
1431
1432-import Ubuntu.Components 0.1
1433+import Ubuntu.Components 1.1
1434 import Ubuntu.Unity.Action 1.0 as UnityActions
1435
1436 UnityActions.Action {
1437
1438=== modified file 'src/app/actions/Copy.qml'
1439--- src/app/actions/Copy.qml 2013-11-07 14:29:29 +0000
1440+++ src/app/actions/Copy.qml 2014-07-30 17:01:24 +0000
1441@@ -1,5 +1,5 @@
1442 /*
1443- * Copyright 2013 Canonical Ltd.
1444+ * Copyright 2013-2014 Canonical Ltd.
1445 *
1446 * This file is part of webbrowser-app.
1447 *
1448@@ -16,7 +16,7 @@
1449 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1450 */
1451
1452-import Ubuntu.Components 0.1
1453+import Ubuntu.Components 1.1
1454
1455 Action {
1456 text: i18n.tr("Copy")
1457
1458=== modified file 'src/app/actions/CopyImage.qml'
1459--- src/app/actions/CopyImage.qml 2013-11-07 14:29:29 +0000
1460+++ src/app/actions/CopyImage.qml 2014-07-30 17:01:24 +0000
1461@@ -1,5 +1,5 @@
1462 /*
1463- * Copyright 2013 Canonical Ltd.
1464+ * Copyright 2013-2014 Canonical Ltd.
1465 *
1466 * This file is part of webbrowser-app.
1467 *
1468@@ -16,7 +16,7 @@
1469 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1470 */
1471
1472-import Ubuntu.Components 0.1
1473+import Ubuntu.Components 1.1
1474
1475 Action {
1476 text: i18n.tr("Copy image")
1477
1478=== modified file 'src/app/actions/CopyLink.qml'
1479--- src/app/actions/CopyLink.qml 2013-11-07 14:29:29 +0000
1480+++ src/app/actions/CopyLink.qml 2014-07-30 17:01:24 +0000
1481@@ -1,5 +1,5 @@
1482 /*
1483- * Copyright 2013 Canonical Ltd.
1484+ * Copyright 2013-2014 Canonical Ltd.
1485 *
1486 * This file is part of webbrowser-app.
1487 *
1488@@ -16,7 +16,7 @@
1489 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1490 */
1491
1492-import Ubuntu.Components 0.1
1493+import Ubuntu.Components 1.1
1494
1495 Action {
1496 text: i18n.tr("Copy link")
1497
1498=== modified file 'src/app/actions/Forward.qml'
1499--- src/app/actions/Forward.qml 2013-11-07 14:29:29 +0000
1500+++ src/app/actions/Forward.qml 2014-07-30 17:01:24 +0000
1501@@ -1,5 +1,5 @@
1502 /*
1503- * Copyright 2013 Canonical Ltd.
1504+ * Copyright 2013-2014 Canonical Ltd.
1505 *
1506 * This file is part of webbrowser-app.
1507 *
1508@@ -16,7 +16,7 @@
1509 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1510 */
1511
1512-import Ubuntu.Components 0.1
1513+import Ubuntu.Components 1.1
1514 import Ubuntu.Unity.Action 1.0 as UnityActions
1515
1516 UnityActions.Action {
1517
1518=== modified file 'src/app/actions/GoTo.qml'
1519--- src/app/actions/GoTo.qml 2013-11-07 14:29:29 +0000
1520+++ src/app/actions/GoTo.qml 2014-07-30 17:01:24 +0000
1521@@ -1,5 +1,5 @@
1522 /*
1523- * Copyright 2013 Canonical Ltd.
1524+ * Copyright 2013-2014 Canonical Ltd.
1525 *
1526 * This file is part of webbrowser-app.
1527 *
1528@@ -16,7 +16,7 @@
1529 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1530 */
1531
1532-import Ubuntu.Components 0.1
1533+import Ubuntu.Components 1.1
1534 import Ubuntu.Unity.Action 1.0 as UnityActions
1535
1536 UnityActions.Action {
1537
1538=== modified file 'src/app/actions/NewTab.qml'
1539--- src/app/actions/NewTab.qml 2013-11-07 14:29:29 +0000
1540+++ src/app/actions/NewTab.qml 2014-07-30 17:01:24 +0000
1541@@ -1,5 +1,5 @@
1542 /*
1543- * Copyright 2013 Canonical Ltd.
1544+ * Copyright 2013-2014 Canonical Ltd.
1545 *
1546 * This file is part of webbrowser-app.
1547 *
1548@@ -16,7 +16,7 @@
1549 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1550 */
1551
1552-import Ubuntu.Components 0.1
1553+import Ubuntu.Components 1.1
1554 import Ubuntu.Unity.Action 1.0 as UnityActions
1555
1556 UnityActions.Action {
1557
1558=== modified file 'src/app/actions/OpenImageInNewTab.qml'
1559--- src/app/actions/OpenImageInNewTab.qml 2013-11-07 14:29:29 +0000
1560+++ src/app/actions/OpenImageInNewTab.qml 2014-07-30 17:01:24 +0000
1561@@ -1,5 +1,5 @@
1562 /*
1563- * Copyright 2013 Canonical Ltd.
1564+ * Copyright 2013-2014 Canonical Ltd.
1565 *
1566 * This file is part of webbrowser-app.
1567 *
1568@@ -16,7 +16,7 @@
1569 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1570 */
1571
1572-import Ubuntu.Components 0.1
1573+import Ubuntu.Components 1.1
1574
1575 Action {
1576 text: i18n.tr("Open image in new tab")
1577
1578=== modified file 'src/app/actions/OpenLinkInNewTab.qml'
1579--- src/app/actions/OpenLinkInNewTab.qml 2013-11-07 14:29:29 +0000
1580+++ src/app/actions/OpenLinkInNewTab.qml 2014-07-30 17:01:24 +0000
1581@@ -1,5 +1,5 @@
1582 /*
1583- * Copyright 2013 Canonical Ltd.
1584+ * Copyright 2013-2014 Canonical Ltd.
1585 *
1586 * This file is part of webbrowser-app.
1587 *
1588@@ -16,7 +16,7 @@
1589 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1590 */
1591
1592-import Ubuntu.Components 0.1
1593+import Ubuntu.Components 1.1
1594
1595 Action {
1596 text: i18n.tr("Open link in new tab")
1597
1598=== modified file 'src/app/actions/Reload.qml'
1599--- src/app/actions/Reload.qml 2013-11-07 14:29:29 +0000
1600+++ src/app/actions/Reload.qml 2014-07-30 17:01:24 +0000
1601@@ -1,5 +1,5 @@
1602 /*
1603- * Copyright 2013 Canonical Ltd.
1604+ * Copyright 2013-2014 Canonical Ltd.
1605 *
1606 * This file is part of webbrowser-app.
1607 *
1608@@ -16,7 +16,7 @@
1609 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1610 */
1611
1612-import Ubuntu.Components 0.1
1613+import Ubuntu.Components 1.1
1614 import Ubuntu.Unity.Action 1.0 as UnityActions
1615
1616 UnityActions.Action {
1617
1618=== modified file 'src/app/actions/SaveImage.qml'
1619--- src/app/actions/SaveImage.qml 2014-05-07 09:32:43 +0000
1620+++ src/app/actions/SaveImage.qml 2014-07-30 17:01:24 +0000
1621@@ -16,7 +16,7 @@
1622 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1623 */
1624
1625-import Ubuntu.Components 0.1
1626+import Ubuntu.Components 1.1
1627
1628 Action {
1629 text: i18n.tr("Save image")
1630
1631=== modified file 'src/app/actions/ShareLink.qml'
1632--- src/app/actions/ShareLink.qml 2014-06-25 16:15:36 +0000
1633+++ src/app/actions/ShareLink.qml 2014-07-30 17:01:24 +0000
1634@@ -16,7 +16,7 @@
1635 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1636 */
1637
1638-import Ubuntu.Components 0.1
1639+import Ubuntu.Components 1.1
1640
1641 Action {
1642 text: i18n.tr("Share…")
1643
1644=== removed directory 'src/app/assets'
1645=== removed file 'src/app/assets/browser-tabs@30.png'
1646Binary files src/app/assets/browser-tabs@30.png 2013-07-18 12:04:50 +0000 and src/app/assets/browser-tabs@30.png 1970-01-01 00:00:00 +0000 differ
1647=== removed file 'src/app/assets/cancel@30.png'
1648Binary files src/app/assets/cancel@30.png 2013-07-18 12:04:50 +0000 and src/app/assets/cancel@30.png 1970-01-01 00:00:00 +0000 differ
1649=== removed file 'src/app/assets/go-next@30.png'
1650Binary files src/app/assets/go-next@30.png 2013-07-18 12:04:50 +0000 and src/app/assets/go-next@30.png 1970-01-01 00:00:00 +0000 differ
1651=== removed file 'src/app/assets/go-previous@30.png'
1652Binary files src/app/assets/go-previous@30.png 2013-07-18 12:04:50 +0000 and src/app/assets/go-previous@30.png 1970-01-01 00:00:00 +0000 differ
1653=== removed file 'src/app/assets/go-to@30.png'
1654Binary files src/app/assets/go-to@30.png 2013-07-18 12:04:50 +0000 and src/app/assets/go-to@30.png 1970-01-01 00:00:00 +0000 differ
1655=== removed file 'src/app/assets/reload@30.png'
1656Binary files src/app/assets/reload@30.png 2013-07-18 12:04:50 +0000 and src/app/assets/reload@30.png 1970-01-01 00:00:00 +0000 differ
1657=== removed file 'src/app/assets/search@30.png'
1658Binary files src/app/assets/search@30.png 2013-07-18 12:04:50 +0000 and src/app/assets/search@30.png 1970-01-01 00:00:00 +0000 differ
1659=== removed file 'src/app/assets/toolbar_dropshadow.png'
1660Binary files src/app/assets/toolbar_dropshadow.png 2013-07-18 12:04:50 +0000 and src/app/assets/toolbar_dropshadow.png 1970-01-01 00:00:00 +0000 differ
1661=== removed file 'src/app/assets/toolbar_dropshadow@20.png'
1662Binary files src/app/assets/toolbar_dropshadow@20.png 2013-07-18 12:04:50 +0000 and src/app/assets/toolbar_dropshadow@20.png 1970-01-01 00:00:00 +0000 differ
1663=== removed file 'src/app/webbrowser/ActivityView.qml'
1664--- src/app/webbrowser/ActivityView.qml 2014-03-12 22:45:12 +0000
1665+++ src/app/webbrowser/ActivityView.qml 1970-01-01 00:00:00 +0000
1666@@ -1,67 +0,0 @@
1667-/*
1668- * Copyright 2013 Canonical Ltd.
1669- *
1670- * This file is part of webbrowser-app.
1671- *
1672- * webbrowser-app is free software; you can redistribute it and/or modify
1673- * it under the terms of the GNU General Public License as published by
1674- * the Free Software Foundation; version 3.
1675- *
1676- * webbrowser-app is distributed in the hope that it will be useful,
1677- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1678- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1679- * GNU General Public License for more details.
1680- *
1681- * You should have received a copy of the GNU General Public License
1682- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1683- */
1684-
1685-import QtQuick 2.0
1686-import Ubuntu.Components 0.1
1687-
1688-Tabs {
1689- id: activityView
1690-
1691- property alias tabsModel: timelineView.tabsModel
1692- property alias historyModel: timelineView.historyModel
1693- property QtObject bookmarksModel
1694-
1695- signal historyEntryRequested(url url)
1696- signal newTabRequested()
1697- signal switchToTabRequested(int index)
1698- signal closeTabRequested(int index)
1699- signal bookmarkRequested(url url)
1700-
1701- Tab {
1702- title: i18n.tr("Activity")
1703- page: Page {
1704- TimelineView {
1705- id: timelineView
1706-
1707- bookmarksModel: activityView.bookmarksModel
1708-
1709- anchors.fill: parent
1710-
1711- onNewTabRequested: activityView.newTabRequested()
1712- onSwitchToTabRequested: activityView.switchToTabRequested(index)
1713- onCloseTabRequested: activityView.closeTabRequested(index)
1714- onHistoryEntryClicked: activityView.historyEntryRequested(url)
1715- }
1716- }
1717- }
1718-
1719- Tab {
1720- title: i18n.tr("Bookmarks")
1721- page: Page {
1722- BookmarksView {
1723- id: bookmarksView
1724-
1725- bookmarksModel: activityView.bookmarksModel
1726-
1727- anchors.fill: parent
1728-
1729- onBookmarkClicked: activityView.bookmarkRequested(url)
1730- }
1731- }
1732- }
1733-}
1734
1735=== renamed file 'src/app/AddressBar.qml' => 'src/app/webbrowser/AddressBar.qml'
1736--- src/app/AddressBar.qml 2014-06-30 11:01:27 +0000
1737+++ src/app/webbrowser/AddressBar.qml 2014-07-30 17:01:24 +0000
1738@@ -17,12 +17,15 @@
1739 */
1740
1741 import QtQuick 2.0
1742-import Ubuntu.Components 0.1
1743+import Ubuntu.Components 1.1
1744+import ".."
1745
1746 FocusScope {
1747 id: addressbar
1748
1749+ property alias icon: favicon.source
1750 property alias text: textField.text
1751+ property bool bookmarked: false
1752 property url requestedUrl
1753 property url actualUrl
1754 signal validated()
1755@@ -37,7 +40,7 @@
1756 states: [
1757 State {
1758 name: "loading"
1759- when: addressBar.loading
1760+ when: addressbar.loading
1761 },
1762 State {
1763 name: "editing"
1764@@ -50,54 +53,113 @@
1765
1766 anchors.fill: parent
1767
1768- primaryItem: MouseArea {
1769- id: __actionButton
1770- objectName: "actionButton"
1771- width: __searchIcon.width + units.gu(1)
1772- height: __searchIcon.height + units.gu(2)
1773- enabled: textField.text.trim().length > 0
1774- Image {
1775- id: __searchIcon
1776- anchors {
1777- right: parent.right
1778- verticalCenter: parent.verticalCenter
1779- }
1780- opacity: __actionButton.enabled ? 1.0 : 0.2
1781- source: {
1782- switch (addressbar.state) {
1783- case "loading":
1784- return "assets/cancel.png"
1785- case "editing":
1786- if (looksLikeAUrl(text.trim())) {
1787- return "assets/go-to.png"
1788- } else {
1789- return "assets/search.png"
1790+ primaryItem: Item {
1791+ height: textField.height
1792+ width: height
1793+
1794+ Favicon {
1795+ id: favicon
1796+ anchors.centerIn: parent
1797+ visible: (addressbar.state == "") && addressbar.actualUrl.toString()
1798+ }
1799+
1800+ MouseArea {
1801+ id: actionButton
1802+ objectName: "actionButton"
1803+ anchors.fill: parent
1804+ enabled: addressbar.text
1805+ opacity: enabled ? 1.0 : 0.3
1806+
1807+ Icon {
1808+ id: actionIcon
1809+ height: parent.height - units.gu(2)
1810+ width: height
1811+ anchors.centerIn: parent
1812+ name: {
1813+ switch (addressbar.state) {
1814+ case "loading":
1815+ return "stop"
1816+ case "editing":
1817+ if (addressbar.text && (addressbar.text == addressbar.actualUrl)) {
1818+ return "reload"
1819+ } else if (looksLikeAUrl(addressbar.text.trim())) {
1820+ return "stock_website"
1821+ } else {
1822+ return "search"
1823+ }
1824+ default:
1825+ if (!favicon.visible) {
1826+ if (looksLikeAUrl(addressbar.text.trim())) {
1827+ return "stock_website"
1828+ } else {
1829+ return "search"
1830+ }
1831+ } else {
1832+ return ""
1833+ }
1834 }
1835+ }
1836+ }
1837+
1838+ onClicked: {
1839+ switch (actionIcon.name) {
1840+ case "":
1841+ break;
1842+ case "stop":
1843+ addressbar.requestStop()
1844+ break
1845+ case "reload":
1846+ addressbar.requestReload()
1847+ break
1848 default:
1849- return "assets/reload.png"
1850+ textField.accepted()
1851 }
1852 }
1853 }
1854- onClicked: {
1855- switch (addressbar.state) {
1856- case "loading":
1857- addressbar.requestStop()
1858- break
1859- case "editing":
1860- textField.accepted()
1861- break
1862- default:
1863- addressbar.requestReload()
1864- }
1865- }
1866- }
1867-
1868+ }
1869+
1870+ secondaryItem: Item {
1871+ objectName: "bookmarkToggle"
1872+
1873+ height: textField.height
1874+ width: visible ? height : 0
1875+
1876+ visible: (addressbar.state == "") && addressbar.actualUrl.toString()
1877+
1878+ Icon {
1879+ height: parent.height - units.gu(2)
1880+ width: height
1881+ anchors.centerIn: parent
1882+
1883+ name: addressbar.bookmarked ? "starred" : "non-starred"
1884+ color: addressbar.bookmarked ? UbuntuColors.orange : keyColor
1885+ }
1886+
1887+ MouseArea {
1888+ id: bookmarkButton
1889+ anchors.fill: parent
1890+ onClicked: addressbar.bookmarked = !addressbar.bookmarked
1891+ }
1892+ }
1893+
1894+ font.pixelSize: FontUtils.sizeToPixels("small")
1895 inputMethodHints: Qt.ImhNoPredictiveText | Qt.ImhUrlCharactersOnly
1896
1897+ placeholderText: i18n.tr("search or enter an address")
1898+
1899+ // Work around the "fix" for http://pad.lv/1089370 which
1900+ // unsets focus on the TextField when it becomes invisible
1901+ // (to ensure the OSK is hidden).
1902 focus: true
1903+ onVisibleChanged: {
1904+ if (visible) {
1905+ focus = true
1906+ }
1907+ }
1908+
1909 highlighted: true
1910
1911- onAccepted: if (__actionButton.enabled) parent.validate()
1912+ onAccepted: if (addressbar.state != "") parent.validate()
1913
1914 function ensureSchemeVisibleWhenUnfocused() {
1915 // Ensure the beginning of the URL is always visible when unfocused.
1916@@ -108,14 +170,22 @@
1917 cursorPosition = 0
1918 }
1919 }
1920- onActiveFocusChanged: ensureSchemeVisibleWhenUnfocused()
1921+ onActiveFocusChanged: {
1922+ if (!activeFocus) {
1923+ if (addressbar.actualUrl.toString()) {
1924+ text = addressbar.actualUrl
1925+ }
1926+ }
1927+ ensureSchemeVisibleWhenUnfocused()
1928+ }
1929 onTextChanged: ensureSchemeVisibleWhenUnfocused()
1930
1931 // Make sure that all the text is selected at the first click
1932 MouseArea {
1933 anchors {
1934 fill: parent
1935- leftMargin: __actionButton.width
1936+ leftMargin: actionButton.width
1937+ rightMargin: bookmarkButton.width
1938 }
1939 visible: !textField.activeFocus
1940 onClicked: {
1941
1942=== modified file 'src/app/webbrowser/BookmarksList.qml'
1943--- src/app/webbrowser/BookmarksList.qml 2014-07-04 12:45:59 +0000
1944+++ src/app/webbrowser/BookmarksList.qml 2014-07-30 17:01:24 +0000
1945@@ -17,7 +17,7 @@
1946 */
1947
1948 import QtQuick 2.0
1949-import Ubuntu.Components 0.1
1950+import Ubuntu.Components 1.1
1951
1952 Column {
1953 id: bookmarksList
1954
1955=== removed file 'src/app/webbrowser/BookmarksView.qml'
1956--- src/app/webbrowser/BookmarksView.qml 2014-07-09 10:43:58 +0000
1957+++ src/app/webbrowser/BookmarksView.qml 1970-01-01 00:00:00 +0000
1958@@ -1,64 +0,0 @@
1959-/*
1960- * Copyright 2013 Canonical Ltd.
1961- *
1962- * This file is part of webbrowser-app.
1963- *
1964- * webbrowser-app is free software; you can redistribute it and/or modify
1965- * it under the terms of the GNU General Public License as published by
1966- * the Free Software Foundation; version 3.
1967- *
1968- * webbrowser-app is distributed in the hope that it will be useful,
1969- * but WITHOUT ANY WARRANTY; without even the implied warranty of
1970- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1971- * GNU General Public License for more details.
1972- *
1973- * You should have received a copy of the GNU General Public License
1974- * along with this program. If not, see <http://www.gnu.org/licenses/>.
1975- */
1976-
1977-import QtQuick 2.0
1978-import Ubuntu.Components 0.1
1979-
1980-Item {
1981- id: bookmarksView
1982-
1983- property QtObject bookmarksModel
1984-
1985- signal bookmarkClicked(url url)
1986-
1987- Rectangle {
1988- anchors.fill: parent
1989- color: "#EEEEEE"
1990- }
1991-
1992- GridView {
1993- anchors {
1994- fill: parent
1995- margins: units.gu(2)
1996- }
1997- clip: true
1998- boundsBehavior: Flickable.StopAtBounds
1999-
2000- model: bookmarksModel
2001-
2002- cellWidth: units.gu(14)
2003- cellHeight: units.gu(18)
2004-
2005- delegate: PageDelegate {
2006- width: units.gu(12)
2007- height: units.gu(12)
2008-
2009- url: model.url
2010- label: model.title ? model.title : model.url
2011- icon: model.icon
2012-
2013- //property url thumbnailSource: "image://webthumbnail/" + model.url
2014- //thumbnail: WebThumbnailer.thumbnailExists(model.url) ? thumbnailSource : ""
2015-
2016- canBookmark: true
2017- bookmarksModel: bookmarksView.bookmarksModel
2018-
2019- onClicked: bookmarkClicked(model.url)
2020- }
2021- }
2022-}
2023
2024=== modified file 'src/app/webbrowser/Browser.qml'
2025--- src/app/webbrowser/Browser.qml 2014-07-09 16:36:42 +0000
2026+++ src/app/webbrowser/Browser.qml 2014-07-30 17:01:24 +0000
2027@@ -1,5 +1,5 @@
2028 /*
2029- * Copyright 2013 Canonical Ltd.
2030+ * Copyright 2013-2014 Canonical Ltd.
2031 *
2032 * This file is part of webbrowser-app.
2033 *
2034@@ -17,7 +17,8 @@
2035 */
2036
2037 import QtQuick 2.0
2038-import Ubuntu.Components 0.1
2039+import com.canonical.Oxide 1.0 as Oxide
2040+import Ubuntu.Components 1.1
2041 import webbrowserapp.private 0.1
2042 import "../actions" as Actions
2043 import ".."
2044@@ -25,7 +26,6 @@
2045 BrowserView {
2046 id: browser
2047
2048- property alias currentIndex: tabsModel.currentIndex
2049 currentWebview: tabsModel.currentWebview
2050
2051 property QtObject searchEngine
2052@@ -58,22 +58,47 @@
2053 }
2054 ]
2055
2056- Page {
2057- // Work around http://pad.lv/1305834 by forcing the page title to be
2058- // reset to an empty string when the activity view is being hidden.
2059- title: activityViewVisible ? " " : ""
2060+ Item {
2061+ id: previewsContainer
2062+
2063+ width: webviewContainer.width
2064+ height: webviewContainer.height
2065+ y: webviewContainer.y
2066+
2067+ Component {
2068+ id: previewComponent
2069+
2070+ ShaderEffectSource {
2071+ id: preview
2072+
2073+ width: parent.width
2074+ height: parent.height
2075+
2076+ onSourceItemChanged: {
2077+ if (!sourceItem) {
2078+ this.destroy()
2079+ }
2080+ }
2081+
2082+ live: mainView.visible && (browser.currentWebview === sourceItem)
2083+ }
2084+ }
2085+ }
2086+
2087+ Item {
2088+ id: mainView
2089+
2090 anchors.fill: parent
2091- visible: !activityViewVisible
2092- active: visible
2093+ visible: !historyViewContainer.visible && !tabsViewContainer.visible
2094
2095 Item {
2096 id: webviewContainer
2097 anchors {
2098 left: parent.left
2099 right: parent.right
2100- top: parent.top
2101+ top: chrome.bottom
2102 }
2103- height: parent.height - osk.height
2104+ height: parent.height - chrome.visibleHeight - osk.height
2105 }
2106
2107 ErrorSheet {
2108@@ -82,119 +107,189 @@
2109 url: currentWebview ? currentWebview.url : ""
2110 onRefreshClicked: currentWebview.reload()
2111 }
2112- }
2113-
2114- PageStack {
2115- id: stack
2116- active: depth > 0
2117- }
2118-
2119- QtObject {
2120- id: internal
2121-
2122- function onHistoryEntryRequested(url) {
2123- currentWebview.url = url
2124- toggleActivityView()
2125- }
2126-
2127- function onNewTabRequested() {
2128- toggleActivityView()
2129- openUrlInNewTab("", true)
2130- }
2131-
2132- function onSwitchToTabRequested(index) {
2133- switchToTab(index)
2134- toggleActivityView()
2135- }
2136-
2137- function onCloseTabRequested(index) {
2138- closeTab(index)
2139- if (tabsModel.count === 0) {
2140- onNewTabRequested()
2141- }
2142- }
2143-
2144- function onBookmarkRequested(url) {
2145- currentWebview.url = url
2146- toggleActivityView()
2147- }
2148-
2149- function onNewTabUrlRequested(url) {
2150- currentWebview.url = url
2151- currentWebview.forceActiveFocus()
2152- }
2153- }
2154-
2155- readonly property bool activityViewVisible: stack.depth > 0
2156-
2157- function showActivityView() {
2158- stack.push(Qt.resolvedUrl("ActivityView.qml"),
2159- {tabsModel: tabsModel,
2160- historyModel: _historyModel,
2161- bookmarksModel: _bookmarksModel})
2162- var view = stack.currentPage
2163- view.onHistoryEntryRequested.connect(internal.onHistoryEntryRequested)
2164- view.onNewTabRequested.connect(internal.onNewTabRequested)
2165- view.onSwitchToTabRequested.connect(internal.onSwitchToTabRequested)
2166- view.onCloseTabRequested.connect(internal.onCloseTabRequested)
2167- view.onBookmarkRequested.connect(internal.onBookmarkRequested)
2168- if (currentWebview) {
2169- currentWebview.forceActiveFocus()
2170- }
2171- panel.close()
2172- }
2173-
2174- function hideActivityView() {
2175- stack.pop()
2176- }
2177-
2178- function toggleActivityView() {
2179- if (activityViewVisible) {
2180- hideActivityView()
2181- } else {
2182- showActivityView()
2183- }
2184- }
2185-
2186- PanelLoader {
2187- id: panel
2188-
2189- currentWebview: browser.currentWebview
2190- chromeless: browser.chromeless
2191- searchUrl: browser.searchEngine ? browser.searchEngine.template : ""
2192-
2193- anchors {
2194- left: parent.left
2195- right: parent.right
2196- bottom: panel.opened ? osk.top : parent.bottom
2197- }
2198-
2199- onUrlValidated: {
2200- if (activityViewVisible) {
2201- hideActivityView()
2202- }
2203- }
2204-
2205- onToggleActivityViewClicked: toggleActivityView()
2206- }
2207-
2208- Suggestions {
2209- opacity: (panel.chrome && (panel.state == "spread") &&
2210- panel.chrome.addressBar.activeFocus && (count > 0)) ? 1.0 : 0.0
2211- Behavior on opacity {
2212- UbuntuNumberAnimation {}
2213- }
2214- enabled: opacity > 0
2215- anchors {
2216- bottom: panel.top
2217- horizontalCenter: parent.horizontalCenter
2218- }
2219- width: panel.width - units.gu(5)
2220- height: Math.min(contentHeight, panel.y - units.gu(2))
2221- model: historyMatches
2222- onSelected: {
2223- currentWebview.url = url
2224- currentWebview.forceActiveFocus()
2225+
2226+ Chrome {
2227+ id: chrome
2228+
2229+ webview: browser.currentWebview
2230+ searchUrl: browser.searchEngine ? browser.searchEngine.template : ""
2231+
2232+ function isCurrentUrlBookmarked() {
2233+ return (webview ? _bookmarksModel.contains(webview.url) : false)
2234+ }
2235+ bookmarked: isCurrentUrlBookmarked()
2236+ onBookmarkedChanged: {
2237+ if (bookmarked && !isCurrentUrlBookmarked()) {
2238+ _bookmarksModel.add(webview.url, webview.title, webview.icon)
2239+ } else if (!bookmarked && isCurrentUrlBookmarked()) {
2240+ _bookmarksModel.remove(webview.url)
2241+ }
2242+ }
2243+ onWebviewChanged: bookmarked = isCurrentUrlBookmarked()
2244+ Connections {
2245+ target: chrome.webview
2246+ onUrlChanged: chrome.bookmarked = chrome.isCurrentUrlBookmarked()
2247+ }
2248+ Connections {
2249+ target: _bookmarksModel
2250+ onAdded: if (!chrome.bookmarked && (url === chrome.webview.url)) chrome.bookmarked = true
2251+ onRemoved: if (chrome.bookmarked && (url === chrome.webview.url)) chrome.bookmarked = false
2252+ }
2253+
2254+ anchors {
2255+ left: parent.left
2256+ right: parent.right
2257+ }
2258+ height: units.gu(6)
2259+
2260+ drawerActions: [
2261+ Action {
2262+ objectName: "share"
2263+ text: i18n.tr("Share")
2264+ iconName: "share"
2265+ enabled: (formFactor == "mobile") && browser.currentWebview.url.toString()
2266+ onTriggered: {
2267+ var component = Qt.createComponent("../Share.qml")
2268+ if (component.status == Component.Ready) {
2269+ var share = component.createObject(browser)
2270+ share.onDone.connect(share.destroy)
2271+ share.shareLink(browser.currentWebview.url, browser.currentWebview.title)
2272+ }
2273+ }
2274+ },
2275+ Action {
2276+ objectName: "history"
2277+ text: i18n.tr("History")
2278+ iconName: "history"
2279+ onTriggered: historyViewComponent.createObject(historyViewContainer)
2280+ },
2281+ Action {
2282+ objectName: "tabs"
2283+ text: i18n.tr("Open tabs")
2284+ iconName: "browser-tabs"
2285+ onTriggered: tabsViewComponent.createObject(tabsViewContainer)
2286+ },
2287+ Action {
2288+ objectName: "newtab"
2289+ text: i18n.tr("New tab")
2290+ iconName: "tab-new"
2291+ onTriggered: browser.openUrlInNewTab("", true)
2292+ }
2293+ ]
2294+
2295+ Connections {
2296+ target: browser.currentWebview
2297+ onLoadingChanged: {
2298+ if (browser.currentWebview.loading) {
2299+ chrome.state = "shown"
2300+ } else if (browser.currentWebview.fullscreen) {
2301+ chrome.state = "hidden"
2302+ }
2303+ }
2304+ onFullscreenChanged: {
2305+ if (browser.currentWebview.fullscreen) {
2306+ chrome.state = "hidden"
2307+ } else {
2308+ chrome.state = "shown"
2309+ }
2310+ }
2311+ }
2312+ }
2313+
2314+ ScrollTracker {
2315+ webview: browser.currentWebview
2316+ header: chrome
2317+
2318+ active: !browser.currentWebview.fullscreen
2319+ onScrolledUp: chrome.state = "shown"
2320+ onScrolledDown: {
2321+ if (nearBottom) {
2322+ chrome.state = "shown"
2323+ } else if (!nearTop) {
2324+ chrome.state = "hidden"
2325+ }
2326+ }
2327+ }
2328+
2329+ Suggestions {
2330+ opacity: ((chrome.state == "shown") && chrome.activeFocus && (count > 0) && !chrome.drawerOpen) ? 1.0 : 0.0
2331+ Behavior on opacity {
2332+ UbuntuNumberAnimation {}
2333+ }
2334+ enabled: opacity > 0
2335+ anchors {
2336+ top: chrome.bottom
2337+ horizontalCenter: parent.horizontalCenter
2338+ }
2339+ width: chrome.width - units.gu(5)
2340+ height: enabled ? Math.min(contentHeight, webviewContainer.height - units.gu(2)) : 0
2341+ model: historyMatches
2342+ onSelected: {
2343+ browser.currentWebview.url = url
2344+ browser.currentWebview.forceActiveFocus()
2345+ }
2346+ }
2347+ }
2348+
2349+ Item {
2350+ id: tabsViewContainer
2351+
2352+ visible: children.length > 0
2353+ anchors.fill: parent
2354+
2355+ Component {
2356+ id: tabsViewComponent
2357+
2358+ TabsView {
2359+ anchors.fill: parent
2360+ model: tabsModel
2361+ onNewTabRequested: browser.openUrlInNewTab("", true)
2362+ onDone: this.destroy()
2363+ }
2364+ }
2365+ }
2366+
2367+ Item {
2368+ id: historyViewContainer
2369+
2370+ visible: children.length > 0
2371+ anchors.fill: parent
2372+
2373+ Component {
2374+ id: historyViewComponent
2375+
2376+ HistoryView {
2377+ anchors.fill: parent
2378+ visible: historyViewContainer.children.length == 1
2379+
2380+ Timer {
2381+ // Set the model asynchronously to ensure
2382+ // the view is displayed as early as possible.
2383+ running: true
2384+ interval: 1
2385+ onTriggered: historyModel = _historyModel
2386+ }
2387+
2388+ onSeeMoreEntriesClicked: {
2389+ var view = expandedHistoryViewComponent.createObject(historyViewContainer, {model: model})
2390+ view.onHistoryEntryClicked.connect(destroy)
2391+ }
2392+ onDone: destroy()
2393+ }
2394+ }
2395+
2396+ Component {
2397+ id: expandedHistoryViewComponent
2398+
2399+ ExpandedHistoryView {
2400+ anchors.fill: parent
2401+
2402+ onHistoryEntryClicked: {
2403+ currentWebview.url = url
2404+ done()
2405+ }
2406+ onDone: destroy()
2407+ }
2408 }
2409 }
2410
2411@@ -206,7 +301,7 @@
2412 HistoryMatchesModel {
2413 id: historyMatches
2414 sourceModel: _historyModel
2415- query: panel.chrome ? panel.chrome.addressBar.text : ""
2416+ query: chrome.text
2417 }
2418
2419 TabsModel {
2420@@ -223,7 +318,8 @@
2421
2422 WebViewImpl {
2423 currentWebview: browser.currentWebview
2424- toolbar: panel.panel
2425+
2426+ property var preview
2427
2428 anchors.fill: parent
2429
2430@@ -264,7 +360,8 @@
2431
2432 onNewViewRequested: {
2433 var webview = webviewComponent.createObject(webviewContainer, {"request": request})
2434- addTab(webview, true, false)
2435+ var setCurrent = (request.disposition == Oxide.NewViewRequest.DispositionNewForegroundTab)
2436+ internal.addTab(webview, setCurrent, false)
2437 }
2438
2439 onLoadingChanged: {
2440@@ -287,8 +384,14 @@
2441
2442 historyModel: _historyModel
2443 bookmarksModel: _bookmarksModel
2444- onBookmarkClicked: internal.onNewTabUrlRequested(url)
2445- onHistoryEntryClicked: internal.onNewTabUrlRequested(url)
2446+ onBookmarkClicked: {
2447+ currentWebview.url = url
2448+ currentWebview.forceActiveFocus()
2449+ }
2450+ onHistoryEntryClicked: {
2451+ currentWebview.url = url
2452+ currentWebview.forceActiveFocus()
2453+ }
2454 }
2455 }
2456 }
2457@@ -300,34 +403,24 @@
2458 source: formFactor == "desktop" ? "" : "../Downloader.qml"
2459 }
2460
2461- function addTab(webview, setCurrent, focusAddressBar) {
2462- var index = tabsModel.add(webview)
2463- if (setCurrent) {
2464- tabsModel.currentIndex = index
2465- if (!chromeless) {
2466+ QtObject {
2467+ id: internal
2468+
2469+ function addTab(webview, setCurrent, focusAddressBar) {
2470+ var index = tabsModel.add(webview)
2471+ if (setCurrent) {
2472+ tabsModel.setCurrent(index)
2473 if (focusAddressBar) {
2474- panel.chrome.addressBar.forceActiveFocus()
2475+ chrome.forceActiveFocus()
2476 Qt.inputMethod.show() // work around http://pad.lv/1316057
2477- panel.open()
2478 }
2479 }
2480+ webview.preview = previewComponent.createObject(previewsContainer, {sourceItem: webview})
2481 }
2482 }
2483
2484 function openUrlInNewTab(url, setCurrent) {
2485 var webview = webviewComponent.createObject(webviewContainer, {"url": url})
2486- addTab(webview, setCurrent, !url.toString())
2487- }
2488-
2489- function closeTab(index) {
2490- var webview = tabsModel.remove(index)
2491- if (webview) {
2492- webview.destroy()
2493- }
2494- }
2495-
2496- function switchToTab(index) {
2497- tabsModel.currentIndex = index
2498- currentWebview.forceActiveFocus()
2499+ internal.addTab(webview, setCurrent, !url.toString() && (formFactor == "desktop"))
2500 }
2501 }
2502
2503=== renamed file 'src/app/Chrome.qml' => 'src/app/webbrowser/Chrome.qml'
2504--- src/app/Chrome.qml 2014-06-30 10:40:59 +0000
2505+++ src/app/webbrowser/Chrome.qml 2014-07-30 17:01:24 +0000
2506@@ -17,167 +17,249 @@
2507 */
2508
2509 import QtQuick 2.0
2510-import Ubuntu.Components 0.1
2511-import Ubuntu.Components.Popups 0.1
2512-import "actions" as Actions
2513+import Ubuntu.Components 1.1
2514+import ".."
2515
2516-Item {
2517+ChromeBase {
2518 id: chrome
2519
2520- property alias url: addressBar.actualUrl
2521- signal urlValidated(url url)
2522- property alias addressBar: addressBar
2523- property alias searchUrl: addressBar.searchUrl
2524- property string title
2525- property alias loading: addressBar.loading
2526- property alias loadProgress: progressBar.value
2527- property alias canGoBack: backButton.enabled
2528- signal goBackClicked()
2529- property alias canGoForward: forwardButton.enabled
2530-
2531- property bool backForwardButtonsVisible: true
2532- property bool activityButtonVisible: true
2533- property bool addressBarVisible: true
2534-
2535- signal goForwardClicked()
2536- signal requestReload()
2537- signal requestStop()
2538- signal toggleTabsClicked()
2539+ property alias searchUrl: addressbar.searchUrl
2540+ readonly property string text: addressbar.text
2541+ property alias bookmarked: addressbar.bookmarked
2542+ property list<Action> drawerActions
2543+ readonly property bool drawerOpen: internal.openDrawer
2544+
2545+ signal validated()
2546+
2547+ FocusScope {
2548+ anchors {
2549+ fill: parent
2550+ margins: units.gu(1)
2551+ }
2552+
2553+ focus: true
2554+
2555+ ChromeButton {
2556+ id: backButton
2557+ objectName: "backButton"
2558+
2559+ iconName: "previous"
2560+ iconSize: 0.6 * height
2561+
2562+ height: parent.height
2563+ width: height
2564+
2565+ anchors {
2566+ left: parent.left
2567+ verticalCenter: parent.verticalCenter
2568+ }
2569+
2570+ enabled: chrome.webview ? chrome.webview.canGoBack : false
2571+ onTriggered: chrome.webview.goBack()
2572+ }
2573+
2574+ ChromeButton {
2575+ id: forwardButton
2576+ objectName: "forwardButton"
2577+
2578+ iconName: "next"
2579+ iconSize: 0.6 * height
2580+
2581+ height: parent.height
2582+ visible: enabled
2583+ width: visible ? height : 0
2584+
2585+ anchors {
2586+ left: backButton.right
2587+ verticalCenter: parent.verticalCenter
2588+ }
2589+
2590+ enabled: chrome.webview ? chrome.webview.canGoForward : false
2591+ onTriggered: chrome.webview.goForward()
2592+ }
2593+
2594+ AddressBar {
2595+ id: addressbar
2596+
2597+ focus: true
2598+
2599+ anchors {
2600+ left: forwardButton.right
2601+ leftMargin: units.gu(1)
2602+ right: drawerButton.left
2603+ rightMargin: units.gu(1)
2604+ verticalCenter: parent.verticalCenter
2605+ }
2606+
2607+ icon: chrome.webview ? chrome.webview.icon : ""
2608+
2609+ loading: chrome.webview ?
2610+ chrome.webview.loading
2611+ // Workaround for https://bugs.launchpad.net/oxide/+bug/1290821.
2612+ && !chrome.webview.lastLoadStopped
2613+ : false
2614+
2615+ onValidated: {
2616+ chrome.webview.url = requestedUrl
2617+ chrome.webview.forceActiveFocus()
2618+ }
2619+ onRequestReload: chrome.webview.reload()
2620+ onRequestStop: chrome.webview.stop()
2621+
2622+ Connections {
2623+ target: chrome.webview
2624+ onUrlChanged: {
2625+ // ensure that the URL actually changes so that the
2626+ // address bar is updated in case the user has entered a
2627+ // new address that redirects to where she previously was
2628+ // (https://bugs.launchpad.net/webbrowser-app/+bug/1306615)
2629+ addressbar.actualUrl = ""
2630+ addressbar.actualUrl = chrome.webview.url
2631+ }
2632+ }
2633+ }
2634+
2635+ ChromeButton {
2636+ id: drawerButton
2637+ objectName: "drawerButton"
2638+
2639+ iconName: "contextual-menu"
2640+ iconSize: 0.75 * height
2641+
2642+ height: parent.height
2643+ width: height
2644+
2645+ anchors {
2646+ right: parent.right
2647+ verticalCenter: parent.verticalCenter
2648+ }
2649+
2650+ onTriggered: {
2651+ internal.openDrawer = drawerComponent.createObject(chrome)
2652+ internal.openDrawer.opened = true
2653+ }
2654+ }
2655+ }
2656
2657 QtObject {
2658 id: internal
2659- // Arbitrary threshold for narrow screens.
2660- readonly property bool isNarrow: width < units.gu(55)
2661- }
2662-
2663- Rectangle {
2664- anchors.fill: parent
2665- color: "white"
2666- opacity: 0.95
2667- }
2668-
2669- ToolbarButton {
2670- id: backButton
2671- objectName: "backButton"
2672- anchors {
2673- left: parent.left
2674- leftMargin: units.gu(2)
2675- verticalCenter: parent.verticalCenter
2676- }
2677- // On narrow screens, hide the button to maximize the
2678- // address bar’s real estate when it has active focus.
2679- width: (internal.isNarrow && addressBar.activeFocus) ? 0 : units.gu(5)
2680- Behavior on width {
2681- UbuntuNumberAnimation {}
2682- }
2683- height: units.gu(5)
2684- clip: true
2685- iconSource: "assets/go-previous.png"
2686- text: i18n.tr("Back")
2687- onTriggered: chrome.goBackClicked()
2688- visible: backForwardButtonsVisible
2689- }
2690-
2691- ToolbarButton {
2692- id: forwardButton
2693- objectName: "forwardButton"
2694- anchors {
2695- left: backButton.right
2696- leftMargin: visible ? units.gu(1) : 0
2697- verticalCenter: parent.verticalCenter
2698- }
2699- // On narrow screen, hide the button to maximize
2700- // the address bar’s real estate.
2701- visible: !internal.isNarrow && backForwardButtonsVisible
2702- width: visible ? units.gu(5) : 0
2703- height: units.gu(5)
2704- iconSource: "assets/go-next.png"
2705- text: i18n.tr("Forward")
2706- onTriggered: chrome.goForwardClicked()
2707+ property var openDrawer: null
2708+ }
2709+
2710+ onWebviewChanged: {
2711+ if (webview) {
2712+ addressbar.actualUrl = webview.url
2713+ }
2714 }
2715
2716 Component {
2717- id: addressBarPopover
2718- ActionSelectionPopover {
2719- actions: ActionList {
2720- Actions.ShareLink {
2721- onTriggered: shareLoader.item.shareLink(chrome.url, chrome.title)
2722- }
2723- }
2724- }
2725- }
2726-
2727- Item {
2728- id: addressBarPopOverPositioner
2729- anchors.bottom: addressBar.top
2730- anchors.horizontalCenter: addressBar.horizontalCenter
2731- visible: false
2732- }
2733-
2734- Loader {
2735- id: shareLoader
2736- source: formFactor == "desktop" ? "" : "Share.qml"
2737- }
2738-
2739- AddressBar {
2740- id: addressBar
2741- objectName: "addressBar"
2742-
2743- anchors {
2744- left: forwardButton.right
2745- leftMargin: units.gu(1)
2746- right: activityButton.left
2747- rightMargin: units.gu(1)
2748- verticalCenter: parent.verticalCenter
2749- }
2750-
2751- onValidated: chrome.urlValidated(requestedUrl)
2752- onRequestReload: chrome.requestReload()
2753- onRequestStop: chrome.requestStop()
2754- onPressAndHold: {
2755- if (chrome.url && shareLoader.status == Loader.Ready) {
2756- PopupUtils.open(addressBarPopover, addressBarPopOverPositioner)
2757- }
2758- }
2759- visible: addressBarVisible
2760- }
2761-
2762- ToolbarButton {
2763- id: activityButton
2764- objectName: "activityButton"
2765-
2766- anchors {
2767- verticalCenter: parent.verticalCenter
2768- right: parent.right
2769- rightMargin: units.gu(2)
2770- }
2771- width: units.gu(5)
2772- height: width
2773-
2774- iconSource: "assets/browser-tabs.png"
2775- text: i18n.tr("Activity")
2776-
2777- onTriggered: chrome.toggleTabsClicked()
2778- visible: activityButtonVisible
2779- }
2780-
2781- EmbeddedProgressBar {
2782- id: progressBar
2783- visible: chrome.loading && addressBarVisible
2784- source: visible ? addressBar : null
2785- minimumValue: 0
2786- maximumValue: 100
2787- bgColor: UbuntuColors.orange
2788- fgColor: "white"
2789- }
2790-
2791- Image {
2792- anchors.bottom: parent.top
2793- anchors.left: parent.left
2794- anchors.right: parent.right
2795- fillMode: Image.TileHorizontally
2796- source: "assets/toolbar_dropshadow.png"
2797- }
2798-
2799- onUrlValidated: chrome.forceActiveFocus()
2800+ id: drawerComponent
2801+
2802+ Item {
2803+ id: drawer
2804+ objectName: "drawer"
2805+
2806+ property bool opened: false
2807+ property bool closing: false
2808+ onOpenedChanged: {
2809+ if (!opened) {
2810+ closing = true
2811+ }
2812+ }
2813+
2814+ anchors {
2815+ top: parent.bottom
2816+ right: parent.right
2817+ }
2818+ width: units.gu(20)
2819+ height: actionsColumn.height
2820+ clip: actionsColumn.y != 0
2821+
2822+ InverseMouseArea {
2823+ enabled: drawer.opened
2824+ onPressed: drawer.opened = false
2825+ }
2826+
2827+ Rectangle {
2828+ anchors.fill: actionsColumn
2829+ color: Theme.palette.normal.background
2830+
2831+ Rectangle {
2832+ anchors {
2833+ top: parent.top
2834+ bottom: parent.bottom
2835+ left: parent.left
2836+ }
2837+ width: units.dp(1)
2838+ color: "#dedede"
2839+ }
2840+
2841+ Rectangle {
2842+ anchors {
2843+ left: parent.left
2844+ right: parent.right
2845+ bottom: parent.bottom
2846+ }
2847+ height: units.dp(1)
2848+ color: "#dedede"
2849+ }
2850+ }
2851+
2852+ Column {
2853+ id: actionsColumn
2854+
2855+ anchors {
2856+ left: parent.left
2857+ right: parent.right
2858+ }
2859+
2860+ y: drawer.opened ? 0 : -height
2861+ Behavior on y { UbuntuNumberAnimation {} }
2862+ onYChanged: {
2863+ if (drawer.closing && (y == -height)) {
2864+ drawer.destroy()
2865+ }
2866+ }
2867+
2868+ Repeater {
2869+ model: chrome.drawerActions
2870+ delegate: AbstractButton {
2871+ objectName: action.objectName
2872+ anchors {
2873+ left: parent.left
2874+ right: parent.right
2875+ }
2876+ height: units.gu(6)
2877+ visible: action.enabled
2878+
2879+ action: modelData
2880+ onClicked: drawer.opened = false
2881+
2882+ Icon {
2883+ id: actionIcon
2884+ anchors {
2885+ left: parent.left
2886+ leftMargin: units.gu(2)
2887+ verticalCenter: parent.verticalCenter
2888+ }
2889+ width: units.gu(2)
2890+ height: width
2891+
2892+ name: model.iconName
2893+ }
2894+
2895+ Label {
2896+ anchors {
2897+ left: actionIcon.right
2898+ leftMargin: units.gu(2)
2899+ verticalCenter: parent.verticalCenter
2900+ }
2901+ text: model.text
2902+ fontSize: "small"
2903+ }
2904+ }
2905+ }
2906+ }
2907+ }
2908+ }
2909 }
2910
2911=== added file 'src/app/webbrowser/ExpandedHistoryView.qml'
2912--- src/app/webbrowser/ExpandedHistoryView.qml 1970-01-01 00:00:00 +0000
2913+++ src/app/webbrowser/ExpandedHistoryView.qml 2014-07-30 17:01:24 +0000
2914@@ -0,0 +1,118 @@
2915+/*
2916+ * Copyright 2014 Canonical Ltd.
2917+ *
2918+ * This file is part of webbrowser-app.
2919+ *
2920+ * webbrowser-app is free software; you can redistribute it and/or modify
2921+ * it under the terms of the GNU General Public License as published by
2922+ * the Free Software Foundation; version 3.
2923+ *
2924+ * webbrowser-app is distributed in the hope that it will be useful,
2925+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2926+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2927+ * GNU General Public License for more details.
2928+ *
2929+ * You should have received a copy of the GNU General Public License
2930+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
2931+ */
2932+
2933+import QtQuick 2.0
2934+import Ubuntu.Components 1.1
2935+import Ubuntu.Components.ListItems 1.0 as ListItem
2936+import ".."
2937+
2938+Item {
2939+ id: expandedHistoryView
2940+
2941+ property alias model: entriesListView.model
2942+
2943+ signal historyEntryClicked(url url)
2944+ signal done()
2945+
2946+ Rectangle {
2947+ anchors.fill: parent
2948+ }
2949+
2950+ ListView {
2951+ id: entriesListView
2952+
2953+ anchors {
2954+ top: header.bottom
2955+ bottom: parent.bottom
2956+ left: parent.left
2957+ right: parent.right
2958+ margins: units.gu(2)
2959+ }
2960+
2961+ spacing: units.gu(2)
2962+
2963+ section.property: "lastVisitDate"
2964+ section.delegate: HistorySectionDelegate {
2965+ width: parent.width
2966+ }
2967+
2968+ delegate: UrlDelegate {
2969+ id: entriesDelegate
2970+ width: parent.width
2971+ height: units.gu(3)
2972+
2973+ url: model.url
2974+ title: model.title
2975+ icon: model.icon
2976+
2977+ onClicked: historyEntryClicked(model.url)
2978+ }
2979+ }
2980+
2981+ Rectangle {
2982+ id: header
2983+
2984+ anchors {
2985+ top: parent.top
2986+ left: parent.left
2987+ right: parent.right
2988+ }
2989+ height: units.gu(7)
2990+
2991+ color: Theme.palette.normal.background
2992+
2993+ Rectangle {
2994+ anchors {
2995+ left: parent.left
2996+ right: parent.right
2997+ bottom: parent.bottom
2998+ }
2999+ height: units.dp(1)
3000+ color: "#dedede"
3001+ }
3002+
3003+ UrlDelegate {
3004+ anchors {
3005+ left: parent.left
3006+ leftMargin: units.gu(2)
3007+ right: doneButton.left
3008+ rightMargin: units.gu(1)
3009+ verticalCenter: parent.verticalCenter
3010+ }
3011+ icon: expandedHistoryView.model.lastVisitedIcon
3012+ title: expandedHistoryView.model.domain
3013+ url: i18n.tr("%1 page", "%1 pages", entriesListView.count).arg(entriesListView.count)
3014+ }
3015+
3016+ Button {
3017+ id: doneButton
3018+
3019+ color: parent.color
3020+
3021+ anchors {
3022+ right: parent.right
3023+ rightMargin: units.gu(2)
3024+ verticalCenter: parent.verticalCenter
3025+ }
3026+
3027+ text: i18n.tr("Less")
3028+
3029+ onClicked: expandedHistoryView.done()
3030+ }
3031+ }
3032+}
3033
3034=== removed file 'src/app/webbrowser/Favicon.qml'
3035--- src/app/webbrowser/Favicon.qml 2014-07-11 16:17:11 +0000
3036+++ src/app/webbrowser/Favicon.qml 1970-01-01 00:00:00 +0000
3037@@ -1,25 +0,0 @@
3038-/*
3039- * Copyright 2014 Canonical Ltd.
3040- *
3041- * This file is part of webbrowser-app.
3042- *
3043- * webbrowser-app is free software; you can redistribute it and/or modify
3044- * it under the terms of the GNU General Public License as published by
3045- * the Free Software Foundation; version 3.
3046- *
3047- * webbrowser-app is distributed in the hope that it will be useful,
3048- * but WITHOUT ANY WARRANTY; without even the implied warranty of
3049- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3050- * GNU General Public License for more details.
3051- *
3052- * You should have received a copy of the GNU General Public License
3053- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3054- */
3055-
3056-import QtQuick 2.0
3057-import Ubuntu.Components 0.1
3058-
3059-Image {
3060- width: units.dp(16)
3061- height: units.dp(16)
3062-}
3063
3064=== added file 'src/app/webbrowser/HistorySectionDelegate.qml'
3065--- src/app/webbrowser/HistorySectionDelegate.qml 1970-01-01 00:00:00 +0000
3066+++ src/app/webbrowser/HistorySectionDelegate.qml 2014-07-30 17:01:24 +0000
3067@@ -0,0 +1,63 @@
3068+/*
3069+ * Copyright 2014 Canonical Ltd.
3070+ *
3071+ * This file is part of webbrowser-app.
3072+ *
3073+ * webbrowser-app is free software; you can redistribute it and/or modify
3074+ * it under the terms of the GNU General Public License as published by
3075+ * the Free Software Foundation; version 3.
3076+ *
3077+ * webbrowser-app is distributed in the hope that it will be useful,
3078+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3079+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3080+ * GNU General Public License for more details.
3081+ *
3082+ * You should have received a copy of the GNU General Public License
3083+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3084+ */
3085+
3086+import QtQuick 2.0
3087+import Ubuntu.Components 1.1
3088+import Ubuntu.Components.ListItems 1.0 as ListItem
3089+
3090+Item {
3091+ height: units.gu(5)
3092+
3093+ Label {
3094+ anchors {
3095+ left: parent.left
3096+ right: parent.right
3097+ top: parent.top
3098+ }
3099+ height: units.gu(2)
3100+
3101+ text: {
3102+ var today = new Date()
3103+ var yesterday = new Date()
3104+ yesterday.setDate(yesterday.getDate() - 1)
3105+ var sectionDate = new Date(section)
3106+ if ((sectionDate.getUTCFullYear() == today.getFullYear()) &&
3107+ (sectionDate.getUTCMonth() == today.getMonth())) {
3108+ var dayDifference = sectionDate.getUTCDate() - today.getDate()
3109+ if (dayDifference == 0) {
3110+ return i18n.tr("Last Visited")
3111+ } else if (dayDifference == -1) {
3112+ return i18n.tr("Yesterday")
3113+ }
3114+ }
3115+ return Qt.formatDate(sectionDate, Qt.DefaultLocaleLongDate)
3116+ }
3117+
3118+ fontSize: "small"
3119+ color: "#5d5d5d"
3120+ }
3121+
3122+ ListItem.ThinDivider {
3123+ anchors {
3124+ left: parent.left
3125+ right: parent.right
3126+ bottom: parent.bottom
3127+ bottomMargin: units.gu(2)
3128+ }
3129+ }
3130+}
3131
3132=== added file 'src/app/webbrowser/HistoryView.qml'
3133--- src/app/webbrowser/HistoryView.qml 1970-01-01 00:00:00 +0000
3134+++ src/app/webbrowser/HistoryView.qml 2014-07-30 17:01:24 +0000
3135@@ -0,0 +1,143 @@
3136+/*
3137+ * Copyright 2014 Canonical Ltd.
3138+ *
3139+ * This file is part of webbrowser-app.
3140+ *
3141+ * webbrowser-app is free software; you can redistribute it and/or modify
3142+ * it under the terms of the GNU General Public License as published by
3143+ * the Free Software Foundation; version 3.
3144+ *
3145+ * webbrowser-app is distributed in the hope that it will be useful,
3146+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3147+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3148+ * GNU General Public License for more details.
3149+ *
3150+ * You should have received a copy of the GNU General Public License
3151+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3152+ */
3153+
3154+import QtQuick 2.0
3155+import Ubuntu.Components 1.1
3156+import Ubuntu.Components.ListItems 1.0 as ListItem
3157+import Ubuntu.Components.Popups 1.0
3158+import webbrowserapp.private 0.1
3159+
3160+Item {
3161+ id: historyView
3162+
3163+ property alias historyModel: historyTimeframeModel.sourceModel
3164+
3165+ signal seeMoreEntriesClicked(var model)
3166+ signal done()
3167+
3168+ Rectangle {
3169+ anchors.fill: parent
3170+ }
3171+
3172+ ListView {
3173+ id: domainsListView
3174+
3175+ anchors {
3176+ top: parent.top
3177+ left: parent.left
3178+ right: parent.right
3179+ bottom: toolbar.top
3180+ margins: units.gu(2)
3181+ }
3182+
3183+ spacing: units.gu(2)
3184+
3185+ model: HistoryDomainListChronologicalModel {
3186+ sourceModel: HistoryDomainListModel {
3187+ sourceModel: HistoryTimeframeModel {
3188+ id: historyTimeframeModel
3189+ }
3190+ }
3191+ }
3192+
3193+ section.property: "lastVisitDate"
3194+ section.delegate: HistorySectionDelegate {
3195+ width: parent.width
3196+ }
3197+
3198+ delegate: UrlDelegate {
3199+ width: parent.width
3200+ height: units.gu(3)
3201+
3202+ title: model.domain
3203+ url: lastVisitedTitle
3204+ icon: model.lastVisitedIcon
3205+
3206+ onClicked: historyView.seeMoreEntriesClicked(model.entries)
3207+ }
3208+ }
3209+
3210+ Toolbar {
3211+ id: toolbar
3212+
3213+ anchors {
3214+ left: parent.left
3215+ right: parent.right
3216+ bottom: parent.bottom
3217+ }
3218+ height: units.gu(7)
3219+
3220+ Button {
3221+ objectName: "doneButton"
3222+ anchors {
3223+ left: parent.left
3224+ leftMargin: units.gu(2)
3225+ verticalCenter: parent.verticalCenter
3226+ }
3227+
3228+ color: "white"
3229+
3230+ text: i18n.tr("Done")
3231+
3232+ onClicked: historyView.done()
3233+ }
3234+
3235+ ToolbarAction {
3236+ anchors {
3237+ right: parent.right
3238+ rightMargin: units.gu(2)
3239+ verticalCenter: parent.verticalCenter
3240+ }
3241+ height: parent.height - units.gu(2)
3242+ width: height
3243+
3244+ text: i18n.tr("Clear")
3245+
3246+ iconName: "delete"
3247+
3248+ enabled: domainsListView.count > 0
3249+
3250+ onClicked: PopupUtils.open(confirmClearComponent)
3251+
3252+ Component {
3253+ id: confirmClearComponent
3254+
3255+ Dialog {
3256+ id: confirmClearDialog
3257+
3258+ text: i18n.tr("Delete all history?")
3259+
3260+ Button {
3261+ text: i18n.tr("Yes")
3262+ color: UbuntuColors.orange
3263+ onClicked: {
3264+ PopupUtils.close(confirmClearDialog)
3265+ historyView.historyModel.clearAll()
3266+ }
3267+ }
3268+
3269+ Button {
3270+ text: i18n.tr("No")
3271+ color: UbuntuColors.warmGrey
3272+ onClicked: PopupUtils.close(confirmClearDialog)
3273+ }
3274+ }
3275+ }
3276+ }
3277+ }
3278+}
3279
3280=== modified file 'src/app/webbrowser/NewTabView.qml'
3281--- src/app/webbrowser/NewTabView.qml 2014-07-11 12:11:43 +0000
3282+++ src/app/webbrowser/NewTabView.qml 2014-07-30 17:01:24 +0000
3283@@ -17,9 +17,10 @@
3284 */
3285
3286 import QtQuick 2.0
3287-import Ubuntu.Components 0.1
3288-import Ubuntu.Components.ListItems 0.1 as ListItem
3289+import Ubuntu.Components 1.1
3290+import Ubuntu.Components.ListItems 1.0 as ListItem
3291 import webbrowserapp.private 0.1
3292+import ".."
3293
3294 Item {
3295 id: newTabView
3296@@ -77,7 +78,6 @@
3297 Rectangle {
3298 id: newTabBackground
3299 anchors.fill: parent
3300- color: "white"
3301 }
3302
3303 ListView {
3304@@ -161,13 +161,35 @@
3305 Repeater {
3306 model: parent.opacity == 0.0 ? "" : historyListModel
3307
3308- delegate: PageDelegate{
3309+ delegate: MouseArea {
3310 width: units.gu(18)
3311- height: units.gu(25)
3312-
3313- url: model.url
3314- label: model.title ? model.title : model.url
3315- icon: model.icon
3316+ height: units.gu(22)
3317+
3318+ Column {
3319+ anchors.fill: parent
3320+ spacing: units.gu(1)
3321+
3322+ UbuntuShape {
3323+ width: parent.width
3324+ height: width
3325+
3326+ Favicon {
3327+ anchors.centerIn: parent
3328+ source: model.icon
3329+ }
3330+ }
3331+
3332+ Label {
3333+ width: parent.width
3334+ height: units.gu(2)
3335+
3336+ fontSize: "small"
3337+ wrapMode: Text.Wrap
3338+ elide: Text.ElideRight
3339+
3340+ text: model.title ? model.title : model.url
3341+ }
3342+ }
3343
3344 onClicked: historyEntryClicked(model.url)
3345 }
3346
3347=== removed file 'src/app/webbrowser/PageDelegate.qml'
3348--- src/app/webbrowser/PageDelegate.qml 2014-07-11 12:01:59 +0000
3349+++ src/app/webbrowser/PageDelegate.qml 1970-01-01 00:00:00 +0000
3350@@ -1,160 +0,0 @@
3351-/*
3352- * Copyright 2013 Canonical Ltd.
3353- *
3354- * This file is part of webbrowser-app.
3355- *
3356- * webbrowser-app is free software; you can redistribute it and/or modify
3357- * it under the terms of the GNU General Public License as published by
3358- * the Free Software Foundation; version 3.
3359- *
3360- * webbrowser-app is distributed in the hope that it will be useful,
3361- * but WITHOUT ANY WARRANTY; without even the implied warranty of
3362- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3363- * GNU General Public License for more details.
3364- *
3365- * You should have received a copy of the GNU General Public License
3366- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3367- */
3368-
3369-import QtQuick 2.0
3370-import Ubuntu.Components 0.1
3371-
3372-Item {
3373- id: pageDelegate
3374-
3375- property url url
3376- property alias thumbnail: thumbnail.source
3377- property alias icon: icon.source
3378- property alias label: label.text
3379- property bool canClose: false
3380- property bool canBookmark: false
3381- property bool bookmarked
3382- property QtObject bookmarksModel
3383-
3384- signal clicked()
3385-
3386- MouseArea {
3387- anchors.fill: parent
3388- onClicked: pageDelegate.clicked()
3389- onPressAndHold: {
3390- if (pageDelegate.canClose) {
3391- pageDelegate.state = (pageDelegate.state === "" ? "close" : "")
3392- }
3393- }
3394- }
3395-
3396- Column {
3397- anchors.fill: parent
3398- spacing: units.gu(1)
3399-
3400- UbuntuShape {
3401- width: parent.width
3402- height: width
3403-
3404- image: Image {
3405- id: thumbnail
3406- }
3407-
3408- // Show the favicon if no thumbnail defined for the url
3409- Favicon {
3410- id: icon
3411- anchors.centerIn: parent
3412-
3413- visible: !thumbnail.source.toString()
3414- }
3415- }
3416-
3417- MouseArea {
3418- width: parent.width
3419- height: units.gu(3)
3420-
3421- Row {
3422- anchors.fill: parent
3423- spacing: units.gu(1)
3424-
3425- Image {
3426- id: starIcon
3427- source: pageDelegate.bookmarked ? "assets/browser_favourite_on.png"
3428- : "assets/browser_favourite_off.png"
3429- visible: pageDelegate.canBookmark
3430- width: visible ? units.gu(2) : 0
3431- height: units.gu(2)
3432- }
3433-
3434- Label {
3435- id: label
3436- fontSize: "small"
3437- width: parent.width - starIcon.width - (starIcon.visible ? parent.spacing : 0)
3438- wrapMode: Text.Wrap
3439- elide: Text.ElideRight
3440- maximumLineCount: 2
3441- }
3442- }
3443-
3444- enabled: pageDelegate.canBookmark
3445- onClicked: pageDelegate.bookmarked = !pageDelegate.bookmarked
3446- }
3447- }
3448-
3449- states: State {
3450- name: "close"
3451- }
3452-
3453- Item {
3454- width: units.gu(5)
3455- height: units.gu(5)
3456- anchors {
3457- top: parent.top
3458- topMargin: -units.gu(1)
3459- left: parent.left
3460- leftMargin: -units.gu(1)
3461- }
3462-
3463- Image {
3464- id: closeButton
3465-
3466- source: "assets/close_btn.png"
3467-
3468- anchors.centerIn: parent
3469- width: units.gu(4)
3470- height: units.gu(4)
3471-
3472- states: State {
3473- name: "hidden"
3474- PropertyChanges {
3475- target: closeButton
3476- width: 0
3477- height: 0
3478- }
3479- }
3480- state: (pageDelegate.state === "close") ? "" : "hidden"
3481-
3482- transitions: Transition {
3483- UbuntuNumberAnimation {
3484- properties: "width,height"
3485- }
3486- }
3487- }
3488- }
3489-
3490- onBookmarksModelChanged: {
3491- if (bookmarksModel) {
3492- bookmarked = bookmarksModel.contains(url)
3493- }
3494- }
3495-
3496- onBookmarkedChanged: {
3497- var previouslyBookmarked = bookmarksModel.contains(pageDelegate.url)
3498- if (bookmarked && !previouslyBookmarked) {
3499- bookmarksModel.add(pageDelegate.url, pageDelegate.label, pageDelegate.icon)
3500- } else if (!bookmarked && previouslyBookmarked) {
3501- bookmarksModel.remove(pageDelegate.url)
3502- }
3503- }
3504-
3505- Connections {
3506- target: bookmarksModel
3507- onAdded: if (url === pageDelegate.url) bookmarked = true
3508- onRemoved: if (url === pageDelegate.url) bookmarked = false
3509- }
3510-}
3511
3512=== modified file 'src/app/webbrowser/Suggestions.qml'
3513--- src/app/webbrowser/Suggestions.qml 2013-11-25 16:04:05 +0000
3514+++ src/app/webbrowser/Suggestions.qml 2014-07-30 17:01:24 +0000
3515@@ -1,5 +1,5 @@
3516 /*
3517- * Copyright 2013 Canonical Ltd.
3518+ * Copyright 2013-2014 Canonical Ltd.
3519 *
3520 * This file is part of webbrowser-app.
3521 *
3522@@ -17,8 +17,8 @@
3523 */
3524
3525 import QtQuick 2.0
3526-import Ubuntu.Components 0.1
3527-import Ubuntu.Components.ListItems 0.1 as ListItem
3528+import Ubuntu.Components 1.1
3529+import Ubuntu.Components.ListItems 1.0 as ListItem
3530
3531 Rectangle {
3532 id: suggestions
3533@@ -30,9 +30,8 @@
3534 signal selected(url url)
3535
3536 radius: units.gu(0.5)
3537- color: "white"
3538 border {
3539- color: UbuntuColors.warmGrey
3540+ color: "#dedede"
3541 width: 1
3542 }
3543
3544@@ -55,6 +54,8 @@
3545 property alias text: label.text
3546 property alias subText: subLabel.text
3547
3548+ showDivider: index < (listview.count - 1)
3549+
3550 __height: Math.max(middleVisuals.height, units.gu(6))
3551
3552 Item {
3553
3554=== added file 'src/app/webbrowser/TabPreview.qml'
3555--- src/app/webbrowser/TabPreview.qml 1970-01-01 00:00:00 +0000
3556+++ src/app/webbrowser/TabPreview.qml 2014-07-30 17:01:24 +0000
3557@@ -0,0 +1,186 @@
3558+/*
3559+ * Copyright 2014 Canonical Ltd.
3560+ *
3561+ * This file is part of webbrowser-app.
3562+ *
3563+ * webbrowser-app is free software; you can redistribute it and/or modify
3564+ * it under the terms of the GNU General Public License as published by
3565+ * the Free Software Foundation; version 3.
3566+ *
3567+ * webbrowser-app is distributed in the hope that it will be useful,
3568+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3569+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3570+ * GNU General Public License for more details.
3571+ *
3572+ * You should have received a copy of the GNU General Public License
3573+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3574+ */
3575+
3576+import QtQuick 2.0
3577+import Ubuntu.Components 1.1
3578+
3579+Column {
3580+ id: tab
3581+
3582+ property alias title: label.text
3583+ property var webview
3584+
3585+ signal selected()
3586+ signal closeRequested()
3587+
3588+ Item {
3589+ id: header
3590+
3591+ width: parent.width
3592+ height: units.gu(4)
3593+
3594+ Row {
3595+ anchors.fill: parent
3596+
3597+ AbstractButton {
3598+ id: closeButton
3599+ objectName: "closeButton"
3600+
3601+ height: parent.height
3602+ width: units.gu(5)
3603+
3604+ Rectangle {
3605+ anchors.fill: parent
3606+ }
3607+
3608+ Icon {
3609+ height: units.gu(2)
3610+ width: height
3611+ anchors.centerIn: parent
3612+ name: "close"
3613+ }
3614+
3615+ onTriggered: tab.closeRequested()
3616+
3617+ Rectangle {
3618+ anchors {
3619+ top: parent.top
3620+ bottom: parent.bottom
3621+ right: parent.right
3622+ }
3623+ width: units.dp(1)
3624+
3625+ color: "#d9d9d9"
3626+ }
3627+ }
3628+
3629+ Item {
3630+ width: parent.width - closeButton.width
3631+ height: parent.height
3632+
3633+ Image {
3634+ id: tabBackgroundLeft
3635+ height: parent.height
3636+ anchors {
3637+ left: parent.left
3638+ right: tabBackgroundCenter.left
3639+ }
3640+ source: "assets/tab-header-left.png"
3641+ fillMode: Image.TileHorizontally
3642+ }
3643+
3644+ Image {
3645+ id: tabBackgroundCenter
3646+ height: parent.height
3647+ anchors.horizontalCenter: parent.horizontalCenter
3648+ source: "assets/tab-header-center.png"
3649+ fillMode: Image.PreserveAspectFit
3650+ }
3651+
3652+ Image {
3653+ id: tabBackgroundRight
3654+ height: parent.height
3655+ anchors {
3656+ left: tabBackgroundCenter.right
3657+ right: parent.right
3658+ }
3659+ source: "assets/tab-header-right.png"
3660+ fillMode: Image.TileHorizontally
3661+ }
3662+
3663+ Label {
3664+ id: label
3665+ anchors {
3666+ fill: tabBackgroundLeft
3667+ leftMargin: units.gu(1)
3668+ }
3669+ verticalAlignment: Text.AlignVCenter
3670+ elide: Text.ElideRight
3671+ }
3672+
3673+ MouseArea {
3674+ anchors {
3675+ top: parent.top
3676+ bottom: parent.bottom
3677+ left: parent.left
3678+ }
3679+ width: parent.width / 2
3680+
3681+ onClicked: tab.selected()
3682+ }
3683+ }
3684+ }
3685+
3686+ Rectangle {
3687+ anchors {
3688+ left: parent.left
3689+ right: parent.right
3690+ bottom: parent.bottom
3691+ }
3692+ height: units.dp(1)
3693+
3694+ color: "#d9d9d9"
3695+ }
3696+ }
3697+
3698+ Rectangle {
3699+ width: parent.width
3700+ height: parent.height - header.height
3701+
3702+ Item {
3703+ id: previewContainer
3704+ anchors.fill: parent
3705+ clip: true
3706+ }
3707+
3708+ MouseArea {
3709+ anchors.fill: parent
3710+ onClicked: tab.selected()
3711+ }
3712+
3713+ Rectangle {
3714+ anchors.fill: parent
3715+
3716+ gradient: Gradient {
3717+ GradientStop { position: 0.0; color: "white" }
3718+ GradientStop { position: 1.0; color: "black" }
3719+ }
3720+
3721+ opacity: 0.3
3722+ }
3723+ }
3724+
3725+ QtObject {
3726+ id: internal
3727+ property var previewParent
3728+ }
3729+
3730+ Component.onCompleted: {
3731+ var preview = tab.webview.preview
3732+ internal.previewParent = preview.parent
3733+ preview.parent = previewContainer
3734+ preview.width = internal.previewParent.width
3735+ preview.height = internal.previewParent.height
3736+ }
3737+ Component.onDestruction: {
3738+ var preview = tab.webview.preview
3739+ preview.parent = internal.previewParent
3740+ preview.width = preview.parent.width
3741+ preview.height = preview.parent.height
3742+ }
3743+}
3744
3745=== removed file 'src/app/webbrowser/TabsList.qml'
3746--- src/app/webbrowser/TabsList.qml 2014-07-09 10:11:10 +0000
3747+++ src/app/webbrowser/TabsList.qml 1970-01-01 00:00:00 +0000
3748@@ -1,119 +0,0 @@
3749-/*
3750- * Copyright 2013 Canonical Ltd.
3751- *
3752- * This file is part of webbrowser-app.
3753- *
3754- * webbrowser-app is free software; you can redistribute it and/or modify
3755- * it under the terms of the GNU General Public License as published by
3756- * the Free Software Foundation; version 3.
3757- *
3758- * webbrowser-app is distributed in the hope that it will be useful,
3759- * but WITHOUT ANY WARRANTY; without even the implied warranty of
3760- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3761- * GNU General Public License for more details.
3762- *
3763- * You should have received a copy of the GNU General Public License
3764- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3765- */
3766-
3767-import QtQuick 2.0
3768-import Ubuntu.Components 0.1
3769-import Ubuntu.Components.ListItems 0.1 as ListItem
3770-
3771-Column {
3772- id: tabsList
3773-
3774- property alias tabsModel: listview.model
3775- property QtObject bookmarksModel
3776-
3777- signal newTabClicked()
3778- signal switchToTabClicked(int index)
3779- signal tabRemoved(int index)
3780-
3781- spacing: units.gu(2)
3782-
3783- ListItem.Header {
3784- // TRANSLATORS: %1 refers to the number of open tabs
3785- text: i18n.tr("Currently viewing (%1)").arg('<font color="%1">%2</font>'.arg(UbuntuColors.orange).arg(tabsModel.count))
3786- }
3787-
3788- ListView {
3789- id: listview
3790- anchors {
3791- left: parent.left
3792- right: parent.right
3793- margins: units.gu(2)
3794- }
3795- height: units.gu(17)
3796- spacing: units.gu(2)
3797- orientation: ListView.Horizontal
3798- boundsBehavior: Flickable.StopAtBounds
3799- currentIndex: model.currentIndex
3800-
3801- states: State {
3802- name: "close"
3803- }
3804-
3805- header: Item {
3806- width: units.gu(14)
3807- height: parent.height
3808-
3809- UbuntuShape {
3810- objectName: "newTabDelegate"
3811- width: units.gu(12)
3812- height: units.gu(12)
3813- color: "white"
3814- Label {
3815- anchors.centerIn: parent
3816- fontSize: "x-large"
3817- text: i18n.tr("+")
3818- }
3819- MouseArea {
3820- anchors.fill: parent
3821- onClicked: newTabClicked()
3822- }
3823- }
3824- }
3825-
3826- delegate: PageDelegate {
3827- objectName: "openTabDelegate"
3828-
3829- width: units.gu(12)
3830- height: units.gu(15)
3831-
3832- url: model.url
3833- label: model.title ? model.title : model.url
3834- icon: model.icon
3835- //thumbnail: model.webview.thumbnail
3836- canClose: true
3837-
3838- state: listview.state
3839- onStateChanged: listview.state = state
3840- Connections {
3841- target: listview
3842- onStateChanged: state = listview.state
3843- }
3844-
3845- canBookmark: url.toString() && (state === "")
3846- bookmarksModel: tabsList.bookmarksModel
3847-
3848- onClicked: {
3849- if (state === "close") {
3850- tabRemoved(index)
3851- } else {
3852- switchToTabClicked(index)
3853- }
3854- }
3855- }
3856-
3857- onVisibleChanged: {
3858- if (!visible) {
3859- state = ""
3860- }
3861- }
3862- }
3863-
3864- function centerViewOnCurrentTab() {
3865- listview.positionViewAtIndex(tabsModel.currentIndex, ListView.Center)
3866- }
3867-}
3868
3869=== added file 'src/app/webbrowser/TabsView.qml'
3870--- src/app/webbrowser/TabsView.qml 1970-01-01 00:00:00 +0000
3871+++ src/app/webbrowser/TabsView.qml 2014-07-30 17:01:24 +0000
3872@@ -0,0 +1,120 @@
3873+/*
3874+ * Copyright 2014 Canonical Ltd.
3875+ *
3876+ * This file is part of webbrowser-app.
3877+ *
3878+ * webbrowser-app is free software; you can redistribute it and/or modify
3879+ * it under the terms of the GNU General Public License as published by
3880+ * the Free Software Foundation; version 3.
3881+ *
3882+ * webbrowser-app is distributed in the hope that it will be useful,
3883+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
3884+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3885+ * GNU General Public License for more details.
3886+ *
3887+ * You should have received a copy of the GNU General Public License
3888+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
3889+ */
3890+
3891+import QtQuick 2.0
3892+import Ubuntu.Components 1.1
3893+
3894+Item {
3895+ id: tabsview
3896+
3897+ property alias model: listview.model
3898+
3899+ signal newTabRequested()
3900+ signal done()
3901+
3902+ Rectangle {
3903+ anchors.fill: parent
3904+ color: "#312f2c"
3905+ }
3906+
3907+ ListView {
3908+ id: listview
3909+
3910+ anchors {
3911+ left: parent.left
3912+ right: parent.right
3913+ top: parent.top
3914+ bottom: toolbar.top
3915+ }
3916+
3917+ spacing: units.gu(-10)
3918+
3919+ boundsBehavior: Flickable.StopAtBounds
3920+
3921+ delegate: TabPreview {
3922+ width: parent.width
3923+ height: (listview.count == 1) ? listview.height : units.gu(40)
3924+ z: index
3925+
3926+ title: model.title ? model.title : (model.url.toString() ? model.url : i18n.tr("New tab"))
3927+ webview: model.webview
3928+
3929+ onSelected: {
3930+ tabsview.model.setCurrent(index)
3931+ webview.forceActiveFocus()
3932+ tabsview.done()
3933+ }
3934+ onCloseRequested: {
3935+ var webview = tabsview.model.remove(index)
3936+ if (webview) {
3937+ webview.destroy()
3938+ }
3939+ if (tabsview.model.count === 0) {
3940+ tabsview.newTabRequested()
3941+ tabsview.done()
3942+ }
3943+ }
3944+ }
3945+ }
3946+
3947+ Toolbar {
3948+ id: toolbar
3949+
3950+ anchors {
3951+ left: parent.left
3952+ right: parent.right
3953+ bottom: parent.bottom
3954+ }
3955+ height: units.gu(7)
3956+
3957+ Button {
3958+ objectName: "doneButton"
3959+ anchors {
3960+ left: parent.left
3961+ leftMargin: units.gu(2)
3962+ verticalCenter: parent.verticalCenter
3963+ }
3964+
3965+ color: "white"
3966+
3967+ text: i18n.tr("Done")
3968+
3969+ onClicked: tabsview.done()
3970+ }
3971+
3972+ ToolbarAction {
3973+ objectName: "addTabButton"
3974+ anchors {
3975+ right: parent.right
3976+ rightMargin: units.gu(2)
3977+ verticalCenter: parent.verticalCenter
3978+ }
3979+ height: parent.height - units.gu(2)
3980+ width: height
3981+
3982+ text: i18n.tr("Add")
3983+
3984+ iconName: "add"
3985+
3986+ onClicked: {
3987+ tabsview.newTabRequested()
3988+ tabsview.done()
3989+ }
3990+ }
3991+ }
3992+}
3993
3994=== removed file 'src/app/webbrowser/TimelineView.qml'
3995--- src/app/webbrowser/TimelineView.qml 2014-07-09 10:43:58 +0000
3996+++ src/app/webbrowser/TimelineView.qml 1970-01-01 00:00:00 +0000
3997@@ -1,333 +0,0 @@
3998-/*
3999- * Copyright 2013 Canonical Ltd.
4000- *
4001- * This file is part of webbrowser-app.
4002- *
4003- * webbrowser-app is free software; you can redistribute it and/or modify
4004- * it under the terms of the GNU General Public License as published by
4005- * the Free Software Foundation; version 3.
4006- *
4007- * webbrowser-app is distributed in the hope that it will be useful,
4008- * but WITHOUT ANY WARRANTY; without even the implied warranty of
4009- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4010- * GNU General Public License for more details.
4011- *
4012- * You should have received a copy of the GNU General Public License
4013- * along with this program. If not, see <http://www.gnu.org/licenses/>.
4014- */
4015-
4016-import QtQuick 2.0
4017-import Ubuntu.Components 0.1
4018-import Ubuntu.Components.ListItems 0.1 as ListItem
4019-import webbrowserapp.private 0.1
4020-
4021-Item {
4022- id: timelineView
4023-
4024- property QtObject tabsModel
4025- property QtObject historyModel
4026- property QtObject bookmarksModel
4027-
4028- signal newTabRequested()
4029- signal switchToTabRequested(int index)
4030- signal closeTabRequested(int index)
4031- signal historyEntryClicked(url url)
4032-
4033- Rectangle {
4034- anchors.fill: parent
4035- color: "#EEEEEE"
4036- }
4037-
4038- ListView {
4039- id: timeline
4040-
4041- anchors.fill: parent
4042- verticalLayoutDirection: ListView.BottomToTop
4043- clip: true
4044- interactive: loaded
4045- boundsBehavior: Flickable.StopAtBounds
4046-
4047- model: ListModel {}
4048- currentIndex: -1
4049-
4050- readonly property var timeframes: ["today", "yesterday", "last7days", "thismonth", "thisyear", "older"]
4051- readonly property bool loaded: model.count == timeframes.length
4052- Timer {
4053- interval: 1
4054- repeat: true
4055- running: !timeline.loaded
4056- onTriggered: timeline.model.append({ timeframe: timeline.timeframes[timeline.model.count] })
4057- }
4058-
4059- header: TabsList {
4060- width: parent.width
4061- height: units.gu(24)
4062-
4063- tabsModel: timelineView.tabsModel
4064- bookmarksModel: timelineView.bookmarksModel
4065-
4066- onNewTabClicked: newTabRequested()
4067- onSwitchToTabClicked: switchToTabRequested(index)
4068- onTabRemoved: closeTabRequested(index)
4069- }
4070-
4071- delegate: Column {
4072- readonly property int timelineIndex: index
4073-
4074- visible: domainsView.count > 0
4075- height: visible ? header.height + domainsView.height + entriesView.height + spacing * (2 + (timeline.currentIndex >= 0)) : 0
4076- width: parent.width
4077- clip: true
4078- spacing: units.gu(2)
4079-
4080- ListItem.Header {
4081- id: header
4082- text: {
4083- if (model.timeframe == "today") {
4084- return i18n.tr("Today")
4085- } else if (model.timeframe == "yesterday") {
4086- return i18n.tr("Yesterday")
4087- } else if (model.timeframe == "last7days") {
4088- return i18n.tr("Last 7 Days")
4089- } else if (model.timeframe == "thismonth") {
4090- return i18n.tr("This Month")
4091- } else if (model.timeframe == "thisyear") {
4092- return i18n.tr("This Year")
4093- } else if (model.timeframe == "older") {
4094- return i18n.tr("Older")
4095- }
4096- }
4097- }
4098-
4099- Item {
4100- id: entriesView
4101-
4102- property var model
4103- property string domain: ""
4104-
4105- anchors {
4106- left: parent.left
4107- right: parent.right
4108- }
4109- height: 0
4110- opacity: 0.0
4111- visible: opacity > 0
4112-
4113- Rectangle {
4114- anchors.fill: parent
4115- color: "black"
4116- opacity: 0.1
4117- }
4118-
4119- Image {
4120- anchors {
4121- top: parent.top
4122- left: parent.left
4123- right: parent.right
4124- }
4125- fillMode: Image.TileHorizontally
4126- source: "assets/expanded_top_innershadow.png"
4127- }
4128-
4129- Image {
4130- id: arrow
4131- anchors.top: parent.bottom
4132- x: domainsView.currentItem ? domainsView.currentItem.x + (domainsView.currentItem.width + width) / 2 - domainsView.contentX : 0
4133- source: "assets/expanded_tooltip.png"
4134- }
4135-
4136- Image {
4137- anchors {
4138- top: parent.bottom
4139- left: parent.left
4140- right: arrow.left
4141- }
4142- fillMode: Image.TileHorizontally
4143- source: "assets/expanded_bottom_highlight.png"
4144- }
4145-
4146- Image {
4147- anchors {
4148- top: parent.bottom
4149- left: arrow.right
4150- right: parent.right
4151- }
4152- fillMode: Image.TileHorizontally
4153- source: "assets/expanded_bottom_highlight.png"
4154- }
4155-
4156- ListView {
4157- id: entriesListView
4158-
4159- anchors {
4160- fill: parent
4161- margins: units.gu(2)
4162- topMargin: units.gu(1.5)
4163- }
4164-
4165- spacing: units.gu(2)
4166- orientation: ListView.Horizontal
4167- boundsBehavior: Flickable.StopAtBounds
4168-
4169- model: entriesView.model
4170-
4171- delegate: PageDelegate {
4172- width: units.gu(12)
4173- height: units.gu(15)
4174-
4175- url: model.url
4176- label: model.title ? model.title : model.url
4177- icon: model.icon
4178-
4179- //property url thumbnailSource: "image://webthumbnail/" + model.url
4180- //thumbnail: WebThumbnailer.thumbnailExists(model.url) ? thumbnailSource : ""
4181-
4182- canBookmark: true
4183- bookmarksModel: timelineView.bookmarksModel
4184-
4185- onClicked: historyEntryClicked(model.url)
4186- }
4187- }
4188-
4189- states: State {
4190- name: "expanded"
4191- when: timelineIndex == timeline.currentIndex
4192- PropertyChanges {
4193- target: entriesView
4194- height: units.gu(19)
4195- opacity: 1.0
4196- }
4197- }
4198-
4199- transitions: Transition {
4200- SequentialAnimation {
4201- UbuntuNumberAnimation { properties: "height,opacity" }
4202- ScriptAction {
4203- // XXX: This action is instantaneous, the view jumps to the index
4204- // without animating contentY. Unfortunately, manipulating contentY
4205- // to position the view at a given index is unreliable and discouraged
4206- // (see http://qt-project.org/doc/qt-5.0/qtquick/qml-qtquick2-listview.html#positionViewAtIndex-method).
4207- script: timeline.positionViewAtIndex(timelineIndex, ListView.Center)
4208- }
4209- }
4210- }
4211- }
4212-
4213- ListView {
4214- id: domainsView
4215-
4216- anchors {
4217- left: parent.left
4218- right: parent.right
4219- margins: units.gu(2)
4220- }
4221- height: units.gu(15)
4222-
4223- spacing: units.gu(2)
4224- orientation: ListView.Horizontal
4225- boundsBehavior: Flickable.StopAtBounds
4226-
4227- model: HistoryDomainListChronologicalModel {
4228- sourceModel: HistoryDomainListModel {
4229- sourceModel: HistoryTimeframeModel {
4230- function setStart() {
4231- var date = new Date()
4232- if (model.timeframe == "yesterday") {
4233- date.setDate(date.getDate() - 1)
4234- } else if (model.timeframe == "last7days") {
4235- date.setDate(date.getDate() - 7)
4236- } else if (model.timeframe == "thismonth") {
4237- date.setDate(1)
4238- } else if (model.timeframe == "thisyear") {
4239- date.setMonth(0)
4240- date.setDate(1)
4241- } else if (model.timeframe == "older") {
4242- date.setFullYear(0, 0, 1)
4243- }
4244- date.setHours(0)
4245- date.setMinutes(0)
4246- date.setSeconds(0)
4247- date.setMilliseconds(0)
4248- start = date
4249- }
4250- function setEnd() {
4251- var date = new Date()
4252- if (model.timeframe == "yesterday") {
4253- date.setDate(date.getDate() - 1)
4254- } else if (model.timeframe == "last7days") {
4255- date.setDate(date.getDate() - 2)
4256- } else if (model.timeframe == "thismonth") {
4257- date.setDate(date.getDate() - 8)
4258- } else if (model.timeframe == "thisyear") {
4259- date.setDate(0)
4260- } else if (model.timeframe == "older") {
4261- date.setMonth(0)
4262- date.setDate(0)
4263- }
4264- date.setHours(23)
4265- date.setMinutes(59)
4266- date.setSeconds(59)
4267- date.setMilliseconds(999)
4268- end = date
4269- }
4270- Component.onCompleted: {
4271- setStart()
4272- setEnd()
4273- sourceModel = historyModel
4274- }
4275- }
4276- }
4277- }
4278-
4279- delegate: PageDelegate {
4280- width: units.gu(12)
4281- height: units.gu(15)
4282-
4283- label: {
4284- if (model.domain === "(local)") {
4285- return i18n.tr("(local files)")
4286- } else if (model.domain === "(none)") {
4287- return i18n.tr("(other)")
4288- } else {
4289- return model.domain
4290- }
4291- }
4292-
4293- //property url thumbnailSource: "image://webthumbnail/" + model.domain
4294- //thumbnail: WebThumbnailer.thumbnailExists(model.domain) ? thumbnailSource : ""
4295-
4296- onClicked: {
4297- if ((timeline.currentIndex == timelineIndex) &&
4298- (entriesView.domain === model.domain)) {
4299- domainsView.currentIndex = -1
4300- timeline.currentIndex = -1
4301- } else {
4302- domainsView.currentIndex = index
4303- timeline.currentIndex = timelineIndex
4304- entriesView.domain = model.domain
4305- entriesView.model = model.entries
4306- }
4307- }
4308- }
4309- }
4310- }
4311-
4312- ActivityIndicator {
4313- anchors.horizontalCenter: parent.horizontalCenter
4314- y: timeline.height - timeline.contentHeight - units.gu(8)
4315- visible: y > 0
4316- running: !timeline.loaded
4317- }
4318- }
4319-
4320- onVisibleChanged: {
4321- if (visible) {
4322- timeline.positionViewAtBeginning()
4323- // Ensure that the header (currently viewing) is fully visible
4324- timeline.contentY += timeline.headerItem.height
4325- timeline.headerItem.centerViewOnCurrentTab()
4326- } else {
4327- timeline.currentIndex = -1
4328- }
4329- }
4330-}
4331
4332=== added file 'src/app/webbrowser/Toolbar.qml'
4333--- src/app/webbrowser/Toolbar.qml 1970-01-01 00:00:00 +0000
4334+++ src/app/webbrowser/Toolbar.qml 2014-07-30 17:01:24 +0000
4335@@ -0,0 +1,31 @@
4336+/*
4337+ * Copyright 2014 Canonical Ltd.
4338+ *
4339+ * This file is part of webbrowser-app.
4340+ *
4341+ * webbrowser-app is free software; you can redistribute it and/or modify
4342+ * it under the terms of the GNU General Public License as published by
4343+ * the Free Software Foundation; version 3.
4344+ *
4345+ * webbrowser-app is distributed in the hope that it will be useful,
4346+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4347+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4348+ * GNU General Public License for more details.
4349+ *
4350+ * You should have received a copy of the GNU General Public License
4351+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4352+ */
4353+
4354+import QtQuick 2.0
4355+
4356+Rectangle {
4357+ Image {
4358+ anchors {
4359+ left: parent.left
4360+ right: parent.right
4361+ bottom: parent.top
4362+ }
4363+ source: "assets/toolbar-dropshadow.png"
4364+ fillMode: Image.TileHorizontally
4365+ }
4366+}
4367
4368=== added file 'src/app/webbrowser/ToolbarAction.qml'
4369--- src/app/webbrowser/ToolbarAction.qml 1970-01-01 00:00:00 +0000
4370+++ src/app/webbrowser/ToolbarAction.qml 2014-07-30 17:01:24 +0000
4371@@ -0,0 +1,61 @@
4372+/*
4373+ * Copyright 2014 Canonical Ltd.
4374+ *
4375+ * This file is part of webbrowser-app.
4376+ *
4377+ * webbrowser-app is free software; you can redistribute it and/or modify
4378+ * it under the terms of the GNU General Public License as published by
4379+ * the Free Software Foundation; version 3.
4380+ *
4381+ * webbrowser-app is distributed in the hope that it will be useful,
4382+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
4383+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4384+ * GNU General Public License for more details.
4385+ *
4386+ * You should have received a copy of the GNU General Public License
4387+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
4388+ */
4389+
4390+import QtQuick 2.0
4391+import Ubuntu.Components 1.1
4392+
4393+AbstractButton {
4394+ property alias iconName: icon.name
4395+ property alias text: label.text
4396+
4397+ opacity: enabled ? 1.0 : 0.3
4398+
4399+ Item {
4400+ anchors {
4401+ top: parent.top
4402+ left: parent.left
4403+ right: parent.right
4404+ }
4405+ height: width
4406+
4407+ Icon {
4408+ id: icon
4409+
4410+ width: units.gu(2)
4411+ height: width
4412+ anchors {
4413+ top: parent.top
4414+ topMargin: units.gu(1)
4415+ horizontalCenter: parent.horizontalCenter
4416+ }
4417+ }
4418+ }
4419+
4420+ Label {
4421+ id: label
4422+ anchors {
4423+ bottom: parent.bottom
4424+ left: parent.left
4425+ right: parent.right
4426+ }
4427+ horizontalAlignment: Text.AlignHCenter
4428+ fontSize: "x-small"
4429+ maximumLineCount: 1
4430+ elide: Text.ElideMiddle
4431+ }
4432+}
4433
4434=== modified file 'src/app/webbrowser/UrlDelegate.qml'
4435--- src/app/webbrowser/UrlDelegate.qml 2014-07-11 12:01:59 +0000
4436+++ src/app/webbrowser/UrlDelegate.qml 2014-07-30 17:01:24 +0000
4437@@ -17,58 +17,70 @@
4438 */
4439
4440 import QtQuick 2.0
4441-import Ubuntu.Components 0.1
4442+import Ubuntu.Components 1.1
4443+import ".."
4444
4445 Item {
4446 id: urlDelegate
4447
4448 property alias icon: icon.source
4449+ property alias title: title.text
4450 property alias url: url.text
4451- property alias title: title.text
4452
4453 signal clicked()
4454
4455+ UbuntuShape {
4456+ id: iconContainer
4457+
4458+ anchors {
4459+ left: parent.left
4460+ verticalCenter: parent.verticalCenter
4461+ }
4462+ width: units.gu(3)
4463+ height: units.gu(3)
4464+
4465+ Favicon {
4466+ id: icon
4467+ anchors.centerIn: parent
4468+ }
4469+ }
4470+
4471+ Label {
4472+ id: title
4473+
4474+ anchors {
4475+ left: iconContainer.right
4476+ leftMargin: units.gu(1)
4477+ right: parent.right
4478+ top: iconContainer.top
4479+ }
4480+
4481+ fontSize: "x-small"
4482+ color: "#5d5d5d"
4483+ wrapMode: Text.Wrap
4484+ elide: Text.ElideRight
4485+ maximumLineCount: 1
4486+ }
4487+
4488+ Label {
4489+ id: url
4490+
4491+ anchors {
4492+ left: title.left
4493+ right: title.right
4494+ top: title.bottom
4495+ topMargin: units.gu(0.3)
4496+ }
4497+
4498+ fontSize: "xx-small"
4499+ wrapMode: Text.Wrap
4500+ elide: Text.ElideRight
4501+ maximumLineCount: 1
4502+ }
4503+
4504+
4505 MouseArea {
4506 anchors.fill: parent
4507 onClicked: urlDelegate.clicked()
4508 }
4509-
4510- Row {
4511- anchors.fill: parent
4512- spacing: units.gu(1)
4513-
4514- UbuntuShape {
4515- id: iconShape
4516- height: parent.height
4517- width: parent.height
4518-
4519- Favicon {
4520- id: icon
4521- anchors.centerIn: parent
4522- }
4523- }
4524-
4525- Column {
4526- width: parent.width - iconShape.width - spacing
4527- Label {
4528- id: title
4529- width: parent.width
4530- font.bold: true
4531-
4532- wrapMode: Text.Wrap
4533- elide: Text.ElideRight
4534- maximumLineCount: 1
4535- }
4536-
4537- Label {
4538- id: url
4539- width: parent.width
4540- fontSize: "small"
4541-
4542- wrapMode: Text.Wrap
4543- elide: Text.ElideRight
4544- maximumLineCount: 1
4545- }
4546- }
4547- }
4548 }
4549
4550=== removed file 'src/app/webbrowser/assets/browser_favourite_off@30.png'
4551Binary files src/app/webbrowser/assets/browser_favourite_off@30.png 2014-03-12 22:45:12 +0000 and src/app/webbrowser/assets/browser_favourite_off@30.png 1970-01-01 00:00:00 +0000 differ
4552=== removed file 'src/app/webbrowser/assets/browser_favourite_on@30.png'
4553Binary files src/app/webbrowser/assets/browser_favourite_on@30.png 2014-03-12 22:45:12 +0000 and src/app/webbrowser/assets/browser_favourite_on@30.png 1970-01-01 00:00:00 +0000 differ
4554=== removed file 'src/app/webbrowser/assets/close_btn@9.png'
4555Binary files src/app/webbrowser/assets/close_btn@9.png 2014-03-12 22:45:12 +0000 and src/app/webbrowser/assets/close_btn@9.png 1970-01-01 00:00:00 +0000 differ
4556=== removed file 'src/app/webbrowser/assets/expanded_bottom_highlight@27.png'
4557Binary files src/app/webbrowser/assets/expanded_bottom_highlight@27.png 2014-03-12 22:45:12 +0000 and src/app/webbrowser/assets/expanded_bottom_highlight@27.png 1970-01-01 00:00:00 +0000 differ
4558=== removed file 'src/app/webbrowser/assets/expanded_tooltip@27.png'
4559Binary files src/app/webbrowser/assets/expanded_tooltip@27.png 2014-03-12 22:45:12 +0000 and src/app/webbrowser/assets/expanded_tooltip@27.png 1970-01-01 00:00:00 +0000 differ
4560=== removed file 'src/app/webbrowser/assets/expanded_top_innershadow@27.png'
4561Binary files src/app/webbrowser/assets/expanded_top_innershadow@27.png 2014-03-12 22:45:12 +0000 and src/app/webbrowser/assets/expanded_top_innershadow@27.png 1970-01-01 00:00:00 +0000 differ
4562=== added file 'src/app/webbrowser/assets/tab-header-center.png'
4563Binary files src/app/webbrowser/assets/tab-header-center.png 1970-01-01 00:00:00 +0000 and src/app/webbrowser/assets/tab-header-center.png 2014-07-30 17:01:24 +0000 differ
4564=== added file 'src/app/webbrowser/assets/tab-header-left.png'
4565Binary files src/app/webbrowser/assets/tab-header-left.png 1970-01-01 00:00:00 +0000 and src/app/webbrowser/assets/tab-header-left.png 2014-07-30 17:01:24 +0000 differ
4566=== added file 'src/app/webbrowser/assets/tab-header-right.png'
4567Binary files src/app/webbrowser/assets/tab-header-right.png 1970-01-01 00:00:00 +0000 and src/app/webbrowser/assets/tab-header-right.png 2014-07-30 17:01:24 +0000 differ
4568=== added file 'src/app/webbrowser/assets/toolbar-dropshadow.png'
4569Binary files src/app/webbrowser/assets/toolbar-dropshadow.png 1970-01-01 00:00:00 +0000 and src/app/webbrowser/assets/toolbar-dropshadow.png 2014-07-30 17:01:24 +0000 differ
4570=== modified file 'src/app/webbrowser/history-domain-model.cpp'
4571--- src/app/webbrowser/history-domain-model.cpp 2014-05-22 15:32:52 +0000
4572+++ src/app/webbrowser/history-domain-model.cpp 2014-07-30 17:01:24 +0000
4573@@ -78,6 +78,16 @@
4574 return m_lastVisit;
4575 }
4576
4577+const QString& HistoryDomainModel::lastVisitedTitle() const
4578+{
4579+ return m_lastVisitedTitle;
4580+}
4581+
4582+const QUrl& HistoryDomainModel::lastVisitedIcon() const
4583+{
4584+ return m_lastVisitedIcon;
4585+}
4586+
4587 bool HistoryDomainModel::filterAcceptsRow(int source_row, const QModelIndex& source_parent) const
4588 {
4589 if (m_domain.isEmpty()) {
4590@@ -92,8 +102,14 @@
4591 {
4592 if (rowCount() > 0) {
4593 m_lastVisit = data(index(0, 0), HistoryModel::LastVisit).toDateTime();
4594+ m_lastVisitedTitle = data(index(0, 0), HistoryModel::Title).toString();
4595+ m_lastVisitedIcon = data(index(0, 0), HistoryModel::Icon).toUrl();
4596 } else {
4597 m_lastVisit = QDateTime();
4598+ m_lastVisitedTitle = QString();
4599+ m_lastVisitedIcon = QUrl();
4600 }
4601 Q_EMIT lastVisitChanged();
4602+ Q_EMIT lastVisitedTitleChanged();
4603+ Q_EMIT lastVisitedIconChanged();
4604 }
4605
4606=== modified file 'src/app/webbrowser/history-domain-model.h'
4607--- src/app/webbrowser/history-domain-model.h 2014-03-12 10:59:54 +0000
4608+++ src/app/webbrowser/history-domain-model.h 2014-07-30 17:01:24 +0000
4609@@ -23,6 +23,7 @@
4610 #include <QtCore/QDateTime>
4611 #include <QtCore/QSortFilterProxyModel>
4612 #include <QtCore/QString>
4613+#include <QtCore/QUrl>
4614
4615 class HistoryTimeframeModel;
4616
4617@@ -33,6 +34,8 @@
4618 Q_PROPERTY(HistoryTimeframeModel* sourceModel READ sourceModel WRITE setSourceModel NOTIFY sourceModelChanged)
4619 Q_PROPERTY(QString domain READ domain WRITE setDomain NOTIFY domainChanged)
4620 Q_PROPERTY(QDateTime lastVisit READ lastVisit NOTIFY lastVisitChanged)
4621+ Q_PROPERTY(QString lastVisitedTitle READ lastVisitedTitle NOTIFY lastVisitedTitleChanged)
4622+ Q_PROPERTY(QUrl lastVisitedIcon READ lastVisitedIcon NOTIFY lastVisitedIconChanged)
4623
4624 public:
4625 HistoryDomainModel(QObject* parent=0);
4626@@ -44,11 +47,15 @@
4627 void setDomain(const QString& domain);
4628
4629 const QDateTime& lastVisit() const;
4630+ const QString& lastVisitedTitle() const;
4631+ const QUrl& lastVisitedIcon() const;
4632
4633 Q_SIGNALS:
4634 void sourceModelChanged() const;
4635 void domainChanged() const;
4636 void lastVisitChanged() const;
4637+ void lastVisitedTitleChanged() const;
4638+ void lastVisitedIconChanged() const;
4639
4640 protected:
4641 // reimplemented from QSortFilterProxyModel
4642@@ -57,6 +64,8 @@
4643 private:
4644 QString m_domain;
4645 QDateTime m_lastVisit;
4646+ QString m_lastVisitedTitle;
4647+ QUrl m_lastVisitedIcon;
4648
4649 private Q_SLOTS:
4650 void onModelChanged();
4651
4652=== modified file 'src/app/webbrowser/history-domainlist-model.cpp'
4653--- src/app/webbrowser/history-domainlist-model.cpp 2014-05-22 15:32:52 +0000
4654+++ src/app/webbrowser/history-domainlist-model.cpp 2014-07-30 17:01:24 +0000
4655@@ -51,6 +51,9 @@
4656 if (roles.isEmpty()) {
4657 roles[Domain] = "domain";
4658 roles[LastVisit] = "lastVisit";
4659+ roles[LastVisitDate] = "lastVisitDate";
4660+ roles[LastVisitedTitle] = "lastVisitedTitle";
4661+ roles[LastVisitedIcon] = "lastVisitedIcon";
4662 roles[Entries] = "entries";
4663 }
4664 return roles;
4665@@ -75,6 +78,12 @@
4666 return domain;
4667 case LastVisit:
4668 return entries->lastVisit();
4669+ case LastVisitDate:
4670+ return entries->lastVisit().toLocalTime().date();
4671+ case LastVisitedTitle:
4672+ return entries->lastVisitedTitle();
4673+ case LastVisitedIcon:
4674+ return entries->lastVisitedIcon();
4675 case Entries:
4676 return QVariant::fromValue(entries);
4677 default:
4678@@ -216,6 +225,6 @@
4679 int i = m_domains.keys().indexOf(domain);
4680 if (i != -1) {
4681 QModelIndex index = this->index(i, 0);
4682- Q_EMIT dataChanged(index, index, QVector<int>() << LastVisit << Entries);
4683+ Q_EMIT dataChanged(index, index, QVector<int>() << LastVisit << LastVisitDate << LastVisitedTitle << LastVisitedIcon << Entries);
4684 }
4685 }
4686
4687=== modified file 'src/app/webbrowser/history-domainlist-model.h'
4688--- src/app/webbrowser/history-domainlist-model.h 2014-03-12 10:59:54 +0000
4689+++ src/app/webbrowser/history-domainlist-model.h 2014-07-30 17:01:24 +0000
4690@@ -42,6 +42,9 @@
4691 enum Roles {
4692 Domain = Qt::UserRole + 1,
4693 LastVisit,
4694+ LastVisitDate,
4695+ LastVisitedTitle,
4696+ LastVisitedIcon,
4697 Entries
4698 };
4699
4700
4701=== modified file 'src/app/webbrowser/history-model.cpp'
4702--- src/app/webbrowser/history-model.cpp 2014-05-22 15:32:52 +0000
4703+++ src/app/webbrowser/history-model.cpp 2014-07-30 17:01:24 +0000
4704@@ -130,6 +130,7 @@
4705 roles[Icon] = "icon";
4706 roles[Visits] = "visits";
4707 roles[LastVisit] = "lastVisit";
4708+ roles[LastVisitDate] = "lastVisitDate";
4709 }
4710 return roles;
4711 }
4712@@ -159,6 +160,8 @@
4713 return entry.visits;
4714 case LastVisit:
4715 return entry.lastVisit;
4716+ case LastVisitDate:
4717+ return entry.lastVisit.toLocalTime().date();
4718 default:
4719 return QVariant();
4720 }
4721@@ -250,6 +253,9 @@
4722 }
4723 count = ++entry.visits;
4724 if (now != entry.lastVisit) {
4725+ if (now.date() != entry.lastVisit.date()) {
4726+ roles << LastVisitDate;
4727+ }
4728 entry.lastVisit = now;
4729 roles << LastVisit;
4730 }
4731
4732=== modified file 'src/app/webbrowser/history-model.h'
4733--- src/app/webbrowser/history-model.h 2014-05-22 15:32:52 +0000
4734+++ src/app/webbrowser/history-model.h 2014-07-30 17:01:24 +0000
4735@@ -45,7 +45,8 @@
4736 Title,
4737 Icon,
4738 Visits,
4739- LastVisit
4740+ LastVisit,
4741+ LastVisitDate,
4742 };
4743
4744 // reimplemented from QAbstractListModel
4745
4746=== modified file 'src/app/webbrowser/tabs-model.cpp'
4747--- src/app/webbrowser/tabs-model.cpp 2014-04-02 13:58:42 +0000
4748+++ src/app/webbrowser/tabs-model.cpp 2014-07-30 17:01:24 +0000
4749@@ -1,5 +1,5 @@
4750 /*
4751- * Copyright 2013 Canonical Ltd.
4752+ * Copyright 2013-2014 Canonical Ltd.
4753 *
4754 * This file is part of webbrowser-app.
4755 *
4756@@ -36,7 +36,6 @@
4757 */
4758 TabsModel::TabsModel(QObject* parent)
4759 : QAbstractListModel(parent)
4760- , m_currentIndex(-1)
4761 {
4762 }
4763
4764@@ -82,31 +81,12 @@
4765 }
4766 }
4767
4768-int TabsModel::currentIndex() const
4769-{
4770- return m_currentIndex;
4771-}
4772-
4773-void TabsModel::setCurrentIndex(int index)
4774-{
4775- if (index == m_currentIndex) {
4776- return;
4777- }
4778- if (!checkValidTabIndex(index)) {
4779- return;
4780- }
4781- m_currentIndex = index;
4782- Q_EMIT currentIndexChanged();
4783- Q_EMIT currentWebviewChanged();
4784-}
4785-
4786 QObject* TabsModel::currentWebview() const
4787 {
4788- if (m_currentIndex >= 0) {
4789- return m_webviews.at(m_currentIndex);
4790- } else {
4791+ if (m_webviews.isEmpty()) {
4792 return 0;
4793 }
4794+ return m_webviews.first();
4795 }
4796
4797 /*!
4798@@ -129,6 +109,9 @@
4799 connect(webview, SIGNAL(iconChanged()), SLOT(onIconChanged()));
4800 endInsertRows();
4801 Q_EMIT countChanged();
4802+ if (index == 0) {
4803+ Q_EMIT currentWebviewChanged();
4804+ }
4805 return index;
4806 }
4807
4808@@ -149,18 +132,26 @@
4809 webview->disconnect(this);
4810 endRemoveRows();
4811 Q_EMIT countChanged();
4812- bool currentWasLast = (m_currentIndex == m_webviews.count());
4813- bool removedCurrent = (index == m_currentIndex);
4814- if (currentWasLast) {
4815- --m_currentIndex;
4816- Q_EMIT currentIndexChanged();
4817- }
4818- if (removedCurrent) {
4819+ if (index == 0) {
4820 Q_EMIT currentWebviewChanged();
4821 }
4822 return webview;
4823 }
4824
4825+void TabsModel::setCurrent(int index)
4826+{
4827+ if (index == 0) {
4828+ return;
4829+ }
4830+ if (!checkValidTabIndex(index)) {
4831+ return;
4832+ }
4833+ beginMoveRows(QModelIndex(), index, index, QModelIndex(), 0);
4834+ m_webviews.prepend(m_webviews.takeAt(index));
4835+ endMoveRows();
4836+ Q_EMIT currentWebviewChanged();
4837+}
4838+
4839 bool TabsModel::checkValidTabIndex(int index) const
4840 {
4841 if ((index < 0) || (index >= m_webviews.count())) {
4842
4843=== modified file 'src/app/webbrowser/tabs-model.h'
4844--- src/app/webbrowser/tabs-model.h 2014-03-18 11:45:08 +0000
4845+++ src/app/webbrowser/tabs-model.h 2014-07-30 17:01:24 +0000
4846@@ -1,5 +1,5 @@
4847 /*
4848- * Copyright 2013 Canonical Ltd.
4849+ * Copyright 2013-2014 Canonical Ltd.
4850 *
4851 * This file is part of webbrowser-app.
4852 *
4853@@ -31,7 +31,6 @@
4854
4855 Q_ENUMS(Roles)
4856
4857- Q_PROPERTY(int currentIndex READ currentIndex WRITE setCurrentIndex NOTIFY currentIndexChanged)
4858 Q_PROPERTY(QObject* currentWebview READ currentWebview NOTIFY currentWebviewChanged)
4859 Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
4860
4861@@ -51,16 +50,13 @@
4862 int rowCount(const QModelIndex& parent=QModelIndex()) const;
4863 QVariant data(const QModelIndex& index, int role) const;
4864
4865- int currentIndex() const;
4866- void setCurrentIndex(int index);
4867-
4868 QObject* currentWebview() const;
4869
4870 Q_INVOKABLE int add(QObject* webview);
4871 Q_INVOKABLE QObject* remove(int index);
4872+ Q_INVOKABLE void setCurrent(int index);
4873
4874 Q_SIGNALS:
4875- void currentIndexChanged() const;
4876 void currentWebviewChanged() const;
4877 void countChanged() const;
4878
4879@@ -71,7 +67,6 @@
4880
4881 private:
4882 QList<QObject*> m_webviews;
4883- int m_currentIndex;
4884
4885 bool checkValidTabIndex(int index) const;
4886 void onDataChanged(QObject* webview, int role);
4887
4888=== modified file 'src/app/webbrowser/webbrowser-app.cpp'
4889--- src/app/webbrowser/webbrowser-app.cpp 2014-07-01 16:56:01 +0000
4890+++ src/app/webbrowser/webbrowser-app.cpp 2014-07-30 17:01:24 +0000
4891@@ -86,7 +86,6 @@
4892
4893 if (BrowserApplication::initialize("webbrowser/webbrowser-app.qml")) {
4894 Settings settings;
4895- m_window->setProperty("chromeless", m_arguments.contains("--chromeless"));
4896 SearchEngine* searchEngine = settings.searchEngine();
4897 searchEngine->setParent(m_window);
4898 m_window->setProperty("searchEngine", QVariant::fromValue(searchEngine));
4899@@ -109,10 +108,9 @@
4900 {
4901 QTextStream out(stdout);
4902 QString command = QFileInfo(QCoreApplication::applicationFilePath()).fileName();
4903- out << "Usage: " << command << " [-h|--help] [--chromeless] [--fullscreen] [--maximized] [--inspector] [--app-id=APP_ID] [URL]" << endl;
4904+ out << "Usage: " << command << " [-h|--help] [--fullscreen] [--maximized] [--inspector] [--app-id=APP_ID] [URL]" << endl;
4905 out << "Options:" << endl;
4906 out << " -h, --help display this help message and exit" << endl;
4907- out << " --chromeless do not display any chrome" << endl;
4908 out << " --fullscreen display full screen" << endl;
4909 out << " --maximized opens the application maximized" << endl;
4910 out << " --inspector run a remote inspector on port " << REMOTE_INSPECTOR_PORT << endl;
4911
4912=== modified file 'src/app/webbrowser/webbrowser-app.qml'
4913--- src/app/webbrowser/webbrowser-app.qml 2014-06-30 10:40:59 +0000
4914+++ src/app/webbrowser/webbrowser-app.qml 2014-07-30 17:01:24 +0000
4915@@ -1,5 +1,5 @@
4916 /*
4917- * Copyright 2013 Canonical Ltd.
4918+ * Copyright 2013-2014 Canonical Ltd.
4919 *
4920 * This file is part of webbrowser-app.
4921 *
4922@@ -18,11 +18,10 @@
4923
4924 import QtQuick 2.0
4925 import QtQuick.Window 2.1
4926-import Ubuntu.Components 0.1
4927+import Ubuntu.Components 1.1
4928
4929 Window {
4930 property alias searchEngine: browser.searchEngine
4931- property alias chromeless: browser.chromeless
4932 property alias developerExtrasEnabled: browser.developerExtrasEnabled
4933
4934 contentOrientation: browser.screenOrientation
4935
4936=== modified file 'src/app/webcontainer/AccountItemView.qml'
4937--- src/app/webcontainer/AccountItemView.qml 2013-12-17 13:52:43 +0000
4938+++ src/app/webcontainer/AccountItemView.qml 2014-07-30 17:01:24 +0000
4939@@ -1,5 +1,5 @@
4940 /*
4941- * Copyright 2013 Canonical Ltd.
4942+ * Copyright 2013-2014 Canonical Ltd.
4943 *
4944 * This file is part of webbrowser-app.
4945 *
4946@@ -17,8 +17,8 @@
4947 */
4948
4949 import QtQuick 2.0
4950-import Ubuntu.Components 0.1
4951-import Ubuntu.Components.ListItems 0.1 as ListItem
4952+import Ubuntu.Components 1.1
4953+import Ubuntu.Components.ListItems 1.0 as ListItem
4954
4955 ListItem.Standard {
4956 id: root
4957
4958=== modified file 'src/app/webcontainer/AccountsLoginPage.qml'
4959--- src/app/webcontainer/AccountsLoginPage.qml 2014-02-21 14:55:14 +0000
4960+++ src/app/webcontainer/AccountsLoginPage.qml 2014-07-30 17:01:24 +0000
4961@@ -1,5 +1,5 @@
4962 /*
4963- * Copyright 2013 Canonical Ltd.
4964+ * Copyright 2013-2014 Canonical Ltd.
4965 *
4966 * This file is part of webbrowser-app.
4967 *
4968@@ -17,8 +17,8 @@
4969 */
4970
4971 import QtQuick 2.0
4972-import Ubuntu.Components 0.1
4973-import Ubuntu.Components.ListItems 0.1 as ListItem
4974+import Ubuntu.Components 1.1
4975+import Ubuntu.Components.ListItems 1.0 as ListItem
4976 import Ubuntu.OnlineAccounts 0.1
4977
4978
4979
4980=== modified file 'src/app/webcontainer/AccountsPage.qml'
4981--- src/app/webcontainer/AccountsPage.qml 2014-05-22 15:27:38 +0000
4982+++ src/app/webcontainer/AccountsPage.qml 2014-07-30 17:01:24 +0000
4983@@ -17,7 +17,7 @@
4984 */
4985
4986 import QtQuick 2.0
4987-import Ubuntu.Components 0.1
4988+import Ubuntu.Components 1.1
4989 import webcontainer.private 0.1
4990
4991 Page {
4992
4993=== modified file 'src/app/webcontainer/AccountsView.qml'
4994--- src/app/webcontainer/AccountsView.qml 2014-02-24 15:56:06 +0000
4995+++ src/app/webcontainer/AccountsView.qml 2014-07-30 17:01:24 +0000
4996@@ -1,5 +1,5 @@
4997 /*
4998- * Copyright 2013 Canonical Ltd.
4999+ * Copyright 2013-2014 Canonical Ltd.
5000 *
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to status/vote changes: