Commit 309703c8 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Simplify and unify some pages not to have a header but a toolbar

parent 4b201f07
......@@ -86,184 +86,182 @@ DiscoverPage {
}
}
ListView {
headerPositioning: ListView.OverlayHeader
header: Kirigami.ItemViewHeader {
maximumHeight: minimumHeight
header: QQC2.ToolBar {
anchors {
right: parent.right
left: parent.left
}
contentItem: RowLayout {
spacing: Kirigami.Units.smallSpacing
contentItem: RowLayout {
spacing: Kirigami.Units.smallSpacing
ToolButton {
iconName: "draw-arrow-back"
tooltip: i18n("Back")
enabled: appInfo.sClose.enabled
onClicked: appInfo.sClose.activated()
}
Item {
Layout.fillWidth: true
}
Kirigami.Icon {
Layout.preferredHeight: Kirigami.Units.gridUnit * 2
Layout.preferredWidth: Kirigami.Units.gridUnit * 2
ToolButton {
iconName: "draw-arrow-back"
tooltip: i18n("Back")
enabled: appInfo.sClose.enabled
onClicked: appInfo.sClose.activated()
}
Item {
Layout.fillWidth: true
}
Kirigami.Icon {
Layout.preferredHeight: Kirigami.Units.gridUnit * 2
Layout.preferredWidth: Kirigami.Units.gridUnit * 2
source: appInfo.application.icon
Layout.alignment: Qt.AlignVCenter
}
Kirigami.Heading {
level: 3
Layout.maximumWidth: parent.width/2
text: appInfo.application.name
maximumLineCount: 1
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
}
Item {
Layout.fillWidth: true
}
source: appInfo.application.icon
Layout.alignment: Qt.AlignVCenter
}
Kirigami.Heading {
level: 3
Layout.maximumWidth: parent.width/2
text: appInfo.application.name
maximumLineCount: 1
elide: Text.ElideRight
horizontalAlignment: Text.AlignHCenter
}
Item {
Layout.fillWidth: true
}
Binding {
target: appInfo.actions
property: "main"
value: appbutton.action
}
Binding {
target: appInfo.actions
property: "main"
value: appbutton.action
}
InstallApplicationButton {
id: appbutton
application: appInfo.application
visible: applicationWindow().wideScreen
}
InstallApplicationButton {
id: appbutton
application: appInfo.application
visible: applicationWindow().wideScreen
}
Button {
visible: application.isInstalled && application.canExecute
text: i18n("Launch")
onClicked: application.invokeApplication()
}
Button {
visible: application.isInstalled && application.canExecute
text: i18n("Launch")
onClicked: application.invokeApplication()
}
}
}
model: 1
delegate: ColumnLayout {
x: Kirigami.Units.gridUnit
y: Kirigami.Units.gridUnit
width: ListView.view.width - Kirigami.Units.gridUnit * 2
spacing: 0
ColumnLayout {
x: Kirigami.Units.gridUnit
y: Kirigami.Units.gridUnit
width: ListView.view.width - Kirigami.Units.gridUnit * 2
spacing: 0
QQC2.Label {
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.fillWidth: true
text: appInfo.application.comment
wrapMode: Text.WordWrap
elide: Text.ElideRight
maximumLineCount: 1
}
QQC2.Label {
Layout.fillWidth: true
elide: Text.ElideRight
text: appInfo.application.categoryDisplay
color: Kirigami.Theme.linkColor
}
QQC2.Label {
Layout.fillWidth: true
text: appInfo.application.comment
wrapMode: Text.WordWrap
elide: Text.ElideRight
maximumLineCount: 1
}
QQC2.Label {
Layout.fillWidth: true
elide: Text.ElideRight
text: appInfo.application.categoryDisplay
color: Kirigami.Theme.linkColor
}
Item {
Layout.fillWidth: true
Layout.fillHeight: true
}
Item {
Layout.fillWidth: true
Layout.fillHeight: true
}
QQC2.Label {
readonly property string version: appInfo.application.isInstalled ? appInfo.application.installedVersion : appInfo.application.availableVersion
visible: version.length > 0
text: version ? i18n("Version: %1", version) : ""
}
QQC2.Label {
text: i18n("Size: %1", appInfo.application.sizeDescription)
}
RowLayout {
QQC2.Label {
readonly property string version: appInfo.application.isInstalled ? appInfo.application.installedVersion : appInfo.application.availableVersion
visible: version.length > 0
text: version ? i18n("Version: %1", version) : ""
text: i18n("Source:")
}
QQC2.Label {
text: i18n("Size: %1", appInfo.application.sizeDescription)
LinkButton {
enabled: alternativeResourcesView.count > 1
text: appInfo.application.displayOrigin
onClicked: originsOverlay.open()
}
RowLayout {
QQC2.Label {
text: i18n("Source:")
}
LinkButton {
enabled: alternativeResourcesView.count > 1
text: appInfo.application.displayOrigin
onClicked: originsOverlay.open()
}
}
RowLayout {
QQC2.Label {
text: i18n("License:")
}
RowLayout {
QQC2.Label {
text: i18n("License:")
}
LinkButton {
text: appInfo.application.license
LinkButton {
text: appInfo.application.license
// tooltip: i18n("See full license terms")
onClicked: Qt.openUrlExternally("https://spdx.org/licenses/" + appInfo.application.license + ".html#licenseText")
}
onClicked: Qt.openUrlExternally("https://spdx.org/licenses/" + appInfo.application.license + ".html#licenseText")
}
}
ApplicationScreenshots {
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.fillWidth: true
resource: appInfo.application
page: appInfo
}
ApplicationScreenshots {
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.fillWidth: true
resource: appInfo.application
page: appInfo
}
Kirigami.Heading {
level: 3
Layout.topMargin: Kirigami.Units.largeSpacing
text: i18n("Description")
Layout.fillWidth: true
visible: appInfo.application.longDescription.length > 0
}
QQC2.Label {
Layout.fillWidth: true
horizontalAlignment: Text.AlignJustify
wrapMode: Text.WordWrap
text: appInfo.application.longDescription + originsOverlay.sentence
onLinkActivated: {
var idx = parseInt(link, 10)
var res = originsOverlay.model.resourceAt(idx)
window.stack.pop()
Navigation.openApplication(res)
}
Kirigami.Heading {
level: 3
Layout.topMargin: Kirigami.Units.largeSpacing
text: i18n("Description")
Layout.fillWidth: true
visible: appInfo.application.longDescription.length > 0
}
QQC2.Label {
Layout.fillWidth: true
horizontalAlignment: Text.AlignJustify
wrapMode: Text.WordWrap
text: appInfo.application.longDescription + originsOverlay.sentence
onLinkActivated: {
var idx = parseInt(link, 10)
var res = originsOverlay.model.resourceAt(idx)
window.stack.pop()
Navigation.openApplication(res)
}
}
RowLayout {
visible: button.text.length > 0
QQC2.Label {
text: i18n("Homepage: ")
}
LinkButton {
id: button
text: application.homepage
onClicked: Qt.openUrlExternally(application.homepage)
}
RowLayout {
visible: button.text.length > 0
QQC2.Label {
text: i18n("Homepage: ")
}
LinkButton {
id: addonsButton
text: i18n("Addons")
visible: addonsView.containsAddons
onClicked: addonsView.sheetOpen = true
id: button
text: application.homepage
onClicked: Qt.openUrlExternally(application.homepage)
}
}
LinkButton {
text: i18n("Review")
onClicked: reviewsSheet.openReviewDialog()
visible: !commentsButton.visible && reviewsModel.backend.isResourceSupported(appInfo.application)
}
LinkButton {
id: commentsButton
readonly property QtObject rating: appInfo.application.rating
visible: rating && rating.ratingCount>0 && reviewsModel.count
text: i18n("Show reviews (%1)...", rating ? reviewsModel.count : 0)
LinkButton {
id: addonsButton
text: i18n("Addons")
visible: addonsView.containsAddons
onClicked: addonsView.sheetOpen = true
}
onClicked: {
reviewsSheet.open()
}
}
LinkButton {
text: i18n("Review")
onClicked: reviewsSheet.openReviewDialog()
visible: !commentsButton.visible && reviewsModel.backend.isResourceSupported(appInfo.application)
}
LinkButton {
id: commentsButton
readonly property QtObject rating: appInfo.application.rating
visible: rating && rating.ratingCount>0 && reviewsModel.count
text: i18n("Show reviews (%1)...", rating ? reviewsModel.count : 0)
Item {
height: addonsButton.height
width: 5
onClicked: {
reviewsSheet.open()
}
}
Item {
height: addonsButton.height
width: 5
}
}
readonly property var addons: AddonsView {
......
......@@ -3,7 +3,7 @@ import QtQuick.Controls 1.1
import QtQuick.Layouts 1.1
import org.kde.discover 2.0
import org.kde.discover.app 1.0
import org.kde.kirigami 2.0 as Kirigami
import org.kde.kirigami 2.1 as Kirigami
ApplicationsListPage {
id: page
......@@ -16,7 +16,7 @@ ApplicationsListPage {
compact: true
canNavigate: false
listHeader: PageHeader {
backgroundImage.source: "qrc:/banners/installedcrop.jpg"
listHeader: Kirigami.ItemViewHeader {
maximumHeight: minimumHeight
}
}
import QtQuick 2.4
import QtQuick.Controls 1.1
import QtQuick.Controls 2.1 as QQC2
import QtQuick.Layouts 1.1
import org.kde.discover 2.0
import org.kde.discover.app 1.0
import org.kde.kquickcontrolsaddons 2.0
import org.kde.kirigami 2.0 as Kirigami
import org.kde.kirigami 2.1 as Kirigami
import "navigation.js" as Navigation
DiscoverPage {
......@@ -73,14 +74,22 @@ DiscoverPage {
}
headerPositioning: ListView.OverlayHeader
header: PageHeader {
backgroundImage.source: "qrc:/banners/syssettingscrop.jpg"
extra: RowLayout {
header: QQC2.ToolBar {
anchors {
right: parent.right
left: parent.left
}
contentItem: RowLayout {
anchors {
topMargin: Kirigami.Units.smallSpacing
bottomMargin: Kirigami.Units.smallSpacing
}
Item {
Layout.fillWidth: true
}
ToolButton {
text: i18n("Application Sources")
tooltip: i18n("Allows to choose the source that will be used for browsing applications")
......@@ -167,9 +176,6 @@ DiscoverPage {
MenuItem { action: ActionBridge { action: app.action("help_report_bug") } }
}
}
Item {
Layout.fillWidth: true
}
}
}
......@@ -213,7 +219,7 @@ DiscoverPage {
model.checked = checkedState
}
}
Label {
QQC2.Label {
text: model.display + " - <i>" + model.toolTip + "</i>"
elide: Text.ElideRight
Layout.fillWidth: true
......
......@@ -7,7 +7,7 @@ import org.kde.discover.app 1.0
import org.kde.kquickcontrolsaddons 2.0
import org.kde.kcoreaddons 1.0
import "navigation.js" as Navigation
import org.kde.kirigami 2.0 as Kirigami
import org.kde.kirigami 2.1 as Kirigami
DiscoverPage
{
......@@ -67,17 +67,14 @@ DiscoverPage
}
headerPositioning: ListView.OverlayHeader
header: PageHeader {
backgroundImage.source: "qrc:/banners/updatescrop.jpg"
extra: RowLayout {
id: updateControls
anchors.topMargin: Kirigami.Units.smallSpacing
Layout.fillWidth: true
visible: (updateModel.totalUpdatesCount > 0 && resourcesUpdatesModel.isProgressing) || updateModel.hasUpdates
header: QQC2.ToolBar {
anchors {
right: parent.right
left: parent.left
}
visible: (updateModel.totalUpdatesCount > 0 && resourcesUpdatesModel.isProgressing) || updateModel.hasUpdates
contentItem: RowLayout {
LabelBackground {
Layout.leftMargin: Kirigami.Units.gridUnit
text: updateModel.toUpdateCount + " (" + updateModel.updateSize+")"
......@@ -94,7 +91,11 @@ DiscoverPage
text: i18n("updates not selected")
visible: unselectedItem.visible
}
Item { Layout.fillWidth: true}
Item {
Layout.fillWidth: true
}
Button {
Layout.minimumWidth: Kirigami.Units.gridUnit * 6
Layout.rightMargin: Kirigami.Units.gridUnit
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment