diff --git a/discover/qml/ApplicationDelegate.qml b/discover/qml/ApplicationDelegate.qml --- a/discover/qml/ApplicationDelegate.qml +++ b/discover/qml/ApplicationDelegate.qml @@ -107,7 +107,6 @@ InstallApplicationButton { id: installButton Layout.alignment: Qt.AlignRight - canUpgrade: false } } } diff --git a/discover/qml/ApplicationPage.qml b/discover/qml/ApplicationPage.qml --- a/discover/qml/ApplicationPage.qml +++ b/discover/qml/ApplicationPage.qml @@ -43,34 +43,51 @@ } pageOverlay: Item { - InstallApplicationButton { - id: button + Rectangle { + id: bg + color: Kirigami.Theme.viewBackgroundColor + anchors.fill: layo + } + RowLayout { + Binding { + target: appInfo + property: "bottomPadding" + value: layo.height + Kirigami.Units.largeSpacing + } + id: layo anchors { + left: parent.left right: parent.right bottom: parent.bottom - bottomMargin: Kirigami.Units.gridUnit - rightMargin: appInfo.width - appInfo.flickable.width + } + ToolButton { + iconName: "draw-arrow-forward" + enabled: appInfo.sClose.enabled + onClicked: appInfo.sClose.activated() + } + Label { + enabled: appInfo.sClose.enabled + text: i18n("Close Description") } - Layout.alignment: Qt.AlignRight - application: appInfo.application - fill: true - additionalItem: Button { + Item { Layout.fillWidth: true - visible: application.isInstalled && application.canExecute - text: i18n("Launch") - onClicked: application.invokeApplication() } - } - DropShadow { - anchors.fill: button - source: button - horizontalOffset: 3 - verticalOffset: 3 - radius: 8 - samples: 10 - color: "#000000" + spacing: 0 + + InstallApplicationButton { + application: appInfo.application + Layout.minimumWidth: Kirigami.Units.gridUnit * 10 + } + } + Kirigami.Separator { + anchors { + left: bg.left + right: bg.right + top: bg.top + } + z: 4000 } } diff --git a/discover/qml/InstallApplicationButton.qml b/discover/qml/InstallApplicationButton.qml --- a/discover/qml/InstallApplicationButton.qml +++ b/discover/qml/InstallApplicationButton.qml @@ -2,6 +2,7 @@ import QtQuick.Controls 1.1 import QtQuick.Layouts 1.1 import org.kde.discover 1.0 +import org.kde.kirigami 2.0 as Kirigami ConditionalLoader { @@ -11,8 +12,6 @@ readonly property alias progress: listener.progress readonly property alias listener: listener property Component additionalItem: null - property bool canUpgrade: true - property bool fill: false TransactionListener { id: listener @@ -40,32 +39,18 @@ } } - componentFalse: RowLayout { + componentFalse: ToolButton { + id: button function click() { button.clicked(); } - Loader { - Layout.fillWidth: root.fill - Component { - id: updateButton - Button { - text: i18n("Update") - onClicked: ResourcesModel.installApplication(application) - } - } - sourceComponent: (root.canUpgrade && application.canUpgrade) ? updateButton : root.additionalItem - } - Button { - id: button - enabled: application.state != AbstractResource.Broken - text: !application.isInstalled ? i18n("Install") : i18n("Remove") - Layout.fillWidth: root.fill + enabled: application.state != AbstractResource.Broken + text: !application.isInstalled ? i18n("Install") : i18n("Remove") - onClicked: { - if(application.isInstalled) - ResourcesModel.removeApplication(application); - else - ResourcesModel.installApplication(application); - } + onClicked: { + if(application.isInstalled) + ResourcesModel.removeApplication(application); + else + ResourcesModel.installApplication(application); } } }