Skip to content

Commit

Permalink
Adjusted Flickables, added missing QuickScrolls, updated localizations
Browse files Browse the repository at this point in the history
  • Loading branch information
Dax89 committed Jun 4, 2015
1 parent 5797749 commit 2149dbc
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 117 deletions.
166 changes: 81 additions & 85 deletions qml/components/FavoritesView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -4,109 +4,105 @@ import "../models"
import "../js/settings/Database.js" as Database
import "../js/settings/Favorites.js" as Favorites

Item
SilicaListView
{
property alias model: favoritesmodel
signal urlRequested(string favoriteurl, bool newtab)

SilicaListView
{
id: favoritesview
clip: true
anchors.fill: parent
model: FavoritesModel { id: favoritesmodel }
quickScroll: true

delegate: ListItem {
id: listitem
contentHeight: Theme.itemSizeSmall
width: favoritesview.width

menu: ContextMenu {
MenuItem {
text: qsTr("Open")
visible: !isfolder

onClicked: {
urlRequested(url, false)
pageStack.pop(rootPage);
}
}
VerticalScrollDecorator { flickable: favoritesview }

MenuItem {
text: qsTr("Open in New Tab")
visible: !isfolder
id: favoritesview
model: FavoritesModel { id: favoritesmodel }
quickScroll: true

onClicked: {
urlRequested(url, true)
pageStack.pop(rootPage);
}
}
delegate: ListItem {
id: listitem
contentHeight: Theme.itemSizeSmall
contentWidth: favoritesview.width

MenuItem {
text: qsTr("Edit");
menu: ContextMenu {
MenuItem {
text: qsTr("Open")
visible: !isfolder

onClicked: pageStack.push(Qt.resolvedUrl("../pages/favorite/FavoritePage.qml"), { "model": favoritesmodel,
"favoriteId": favoriteid,
"parentId": parentid,
"isFolder": isfolder,
"title": title,
"url": url });
onClicked: {
urlRequested(url, false)
pageStack.pop(rootPage);
}
}

MenuItem {
text: qsTr("Delete");
MenuItem {
text: qsTr("Open in New Tab")
visible: !isfolder

onClicked: listitem.remorseAction(isfolder ? qsTr("Deleting Folder") : qsTr("Deleting Favorite"),
function() {
favoritesmodel.erase(favoriteid, parentid);
});
onClicked: {
urlRequested(url, true)
pageStack.pop(rootPage);
}
}

MenuItem
{
text: qsTr("Add to Quick Grid")
onClicked: mainwindow.settings.quickgridmodel.addUrl(title, url)
}
MenuItem {
text: qsTr("Edit");

onClicked: pageStack.push(Qt.resolvedUrl("../pages/favorite/FavoritePage.qml"), { "model": favoritesmodel,
"favoriteId": favoriteid,
"parentId": parentid,
"isFolder": isfolder,
"title": title,
"url": url });
}

onClicked: {
if(isfolder) {
pageStack.push(Qt.resolvedUrl("../pages/favorite/FavoritesPage.qml"), { "folderId": favoriteid, "tabview": tabview, "rootPage": rootPage })
return;
}
MenuItem {
text: qsTr("Delete");

urlRequested(url, true);
pageStack.pop(rootPage);
onClicked: listitem.remorseAction(isfolder ? qsTr("Deleting Folder") : qsTr("Deleting Favorite"),
function() {
favoritesmodel.erase(favoriteid, parentid);
});
}

Row {
anchors.fill: parent
spacing: Theme.paddingSmall

Image
{
id: favicon
cache: false
asynchronous: true
width: Theme.iconSizeSmall
height: Theme.iconSizeSmall
fillMode: Image.PreserveAspectFit
anchors.verticalCenter: parent.verticalCenter
source: isfolder ? "image://theme/icon-m-folder" : mainwindow.settings.icondatabase.provideIcon(url)
}
MenuItem
{
text: qsTr("Add to Quick Grid")
onClicked: mainwindow.settings.quickgridmodel.addUrl(title, url)
}
}

Label {
id: lbltitle;
height: parent.height
width: favoritesview.width - favicon.width
text: title
anchors.verticalCenter: parent.verticalCenter
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft
truncationMode: TruncationMode.Fade
color: listitem.down ? Theme.highlightColor : Theme.primaryColor
}
onClicked: {
if(isfolder) {
pageStack.push(Qt.resolvedUrl("../pages/favorite/FavoritesPage.qml"), { "folderId": favoriteid, "tabview": tabview, "rootPage": rootPage })
return;
}

urlRequested(url, true);
pageStack.pop(rootPage);
}

Row {
anchors.fill: parent
spacing: Theme.paddingSmall

Image
{
id: favicon
cache: false
asynchronous: true
width: Theme.iconSizeSmall
height: Theme.iconSizeSmall
fillMode: Image.PreserveAspectFit
anchors.verticalCenter: parent.verticalCenter
source: isfolder ? "image://theme/icon-m-folder" : mainwindow.settings.icondatabase.provideIcon(url)
}

Label {
id: lbltitle;
height: parent.height
width: favoritesview.width - favicon.width
text: title
anchors.verticalCenter: parent.verticalCenter
verticalAlignment: Text.AlignVCenter
horizontalAlignment: Text.AlignLeft
truncationMode: TruncationMode.Fade
color: listitem.down ? Theme.highlightColor : Theme.primaryColor
}
}
}
Expand Down
3 changes: 3 additions & 0 deletions qml/pages/cookie/CookieManagerPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,11 @@ Page
id: listview
anchors { left: parent.left; top: content.bottom; right: parent.right; bottom: parent.bottom }
model: settings.cookiejar.domains
quickScroll: true
clip: true

VerticalScrollDecorator { flickable: listview }

delegate: DomainListItem {
id: domainlistitem
contentWidth: parent.width
Expand Down
26 changes: 10 additions & 16 deletions qml/pages/favorite/FavoritesPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,8 @@ Page
onParsingError: popupmessage.show(qsTr("Cannot import favorites"));
}

SilicaFlickable
FavoritesView
{
anchors.fill: parent

PullDownMenu
{
MenuItem
Expand Down Expand Up @@ -82,24 +80,20 @@ Page
}
}

PageHeader { id: header }
id: favoritesview
anchors.fill: parent
header: PageHeader { id: header }

FavoritesView
{
id: favoritesview
anchors { top: header.bottom; left: parent.left; right: parent.right; bottom: parent.bottom }

onUrlRequested: {
if(newtab)
tabview.addTab(favoriteurl);
else
tabview.tabs.get(tabview.currentIndex).tab.load(favoriteurl);
}
onUrlRequested: {
if(newtab)
tabview.addTab(favoriteurl);
else
tabview.tabs.get(tabview.currentIndex).tab.load(favoriteurl);
}
}

Component.onCompleted: {
favoritesview.model.jumpTo(folderId);
header.title = (folderId === 0 ? qsTr("Favorites") : favoritesview.model.currentFolder());
favoritesview.headerItem.title = (folderId === 0 ? qsTr("Favorites") : favoritesview.model.currentFolder());
}
}
2 changes: 2 additions & 0 deletions qml/pages/history/NavigationHistoryPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Page

SilicaListView
{
VerticalScrollDecorator { flickable: listview }

PullDownMenu
{
MenuItem
Expand Down
2 changes: 1 addition & 1 deletion rpm/harbour-webpirate.changes.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
# * date Author's Name <author's email> version-release
# - Summary of changes

* Thu Jun 25 2015 Antonio Davide Trogu <trogu.davide@gmail.com> 1.3-1
* Thu Jun 25 2015 Antonio Davide Trogu <trogu.davide@gmail.com> 1.3-2
- Experimental support for Notifications with SailfishOS (Web Notification API and Download Manager)
- YouTube Grabber: Added experimental decoder for ciphered/scambled videos
- Restart the WebProcess automatically if crashes
Expand Down
2 changes: 1 addition & 1 deletion rpm/harbour-webpirate.spec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Name: harbour-webpirate
%{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: harbour-webpirate
Version: 1.3
Release: 1
Release: 2
Group: Qt/Qt
License: GPL3
URL: http://github.com/Dax89/harbour-webpirate
Expand Down
2 changes: 1 addition & 1 deletion rpm/harbour-webpirate.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Name: harbour-webpirate
Summary: harbour-webpirate
Version: 1.3
Release: 1
Release: 2
# The contents of the Group field should be one of the groups listed here:
# http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS
Group: Qt/Qt
Expand Down
20 changes: 10 additions & 10 deletions translations/harbour-webpirate-es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@
</message>
<message>
<source>Status</source>
<translation type="unfinished"></translation>
<translation>Estado</translation>
</message>
</context>
<context>
Expand Down Expand Up @@ -655,7 +655,7 @@
</message>
<message>
<source>Cannot import favorites</source>
<translation>No se pueden importar los favoritos</translation>
<translation>No es posible importar los favoritos</translation>
</message>
</context>
<context>
Expand Down Expand Up @@ -1235,23 +1235,23 @@
<name>YouTubeCipher</name>
<message>
<source>Downloading Player&apos;s Cipher</source>
<translation type="unfinished"></translation>
<translation>Descargando decodificador del reproductor</translation>
</message>
<message>
<source>Cannot find decoding function</source>
<translation type="unfinished"></translation>
<translation>No es posible encontrar función de decodificación</translation>
</message>
<message>
<source>Cannot find decoding object</source>
<translation type="unfinished"></translation>
<translation>No es posible encontrar objeto de decodificación</translation>
</message>
<message>
<source>Cannot download Video Configuration</source>
<translation type="unfinished"></translation>
<translation>No es posible descargar configuración del vídeo</translation>
</message>
<message>
<source>Ciphered Video: Downloading WebPage</source>
<translation type="unfinished"></translation>
<translation>Vídeo codificado: descargando de página Web</translation>
</message>
</context>
<context>
Expand All @@ -1262,15 +1262,15 @@
</message>
<message>
<source>OK</source>
<translation type="unfinished">OK</translation>
<translation>OK</translation>
</message>
<message>
<source>Downloading video info</source>
<translation type="unfinished"></translation>
<translation>Descargando info del vídeo</translation>
</message>
<message>
<source>FAILED</source>
<translation type="unfinished">FALLIDO</translation>
<translation>FALLIDO</translation>
</message>
</context>
<context>
Expand Down
6 changes: 3 additions & 3 deletions translations/harbour-webpirate-ru_RU.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1261,15 +1261,15 @@
</message>
<message>
<source>OK</source>
<translation type="unfinished">OK</translation>
<translation>OK</translation>
</message>
<message>
<source>Downloading video info</source>
<translation type="unfinished"></translation>
<translation>Загружаю информацию о видео</translation>
</message>
<message>
<source>FAILED</source>
<translation type="unfinished">Ошибка</translation>
<translation>Ошибка</translation>
</message>
</context>
<context>
Expand Down

0 comments on commit 2149dbc

Please sign in to comment.