Commit 786f4ffa authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Improve look of the dependencies and permissions popup

parent d0c8c5ec
/*
* Copyright (C) 2018 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Library/Lesser General Public License
* version 2, or (at your option) any later version, as published by the
* Free Software Foundation
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details
*
* You should have received a copy of the GNU Library/Lesser General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.8
import QtQuick.Controls 2.1
import org.kde.kirigami 2.1 as Kirigami
Popup {
id: overlay
parent: applicationWindow().overlay
bottomPadding: Kirigami.Units.largeSpacing
topPadding: Kirigami.Units.largeSpacing
x: (parent.width - width)/2
y: (parent.height - height)/2
width: Math.min(parent.width - Kirigami.Units.gridUnit * 3, Kirigami.Units.gridUnit * 50)
height: Math.min(view.contentHeight + bottomPadding + topPadding, parent.height * 4/5)
}
......@@ -35,6 +35,7 @@
<file>qml/LoadingPage.qml</file>
<file>qml/SearchField.qml</file>
<file>qml/Shadow.qml</file>
<file>qml/DiscoverPopup.qml</file>
<file>qml/navigation.js</file>
</qresource>
......
......@@ -17,7 +17,7 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
import QtQuick 2.1
import QtQuick 2.8
import QtQuick.Controls 2.1
import org.kde.kirigami 2.1 as Kirigami
......@@ -37,22 +37,17 @@ LinkButton
}
}
Popup {
DiscoverPopup {
id: overlay
parent: applicationWindow().overlay
bottomPadding: Kirigami.Units.largeSpacing
topPadding: Kirigami.Units.largeSpacing
x: (parent.width - width)/2
y: (parent.height - height)/2
width: parent.width * 1/3
height: Math.min(view.contentHeight + bottomPadding + topPadding, parent.height * 4/5)
ListView {
id: view
anchors.fill: parent
header: Kirigami.Heading {
text: i18n ("%1 Dependencies", resource.name)
clip: true
headerPositioning: ListView.OverlayHeader
header: Kirigami.ItemViewHeader {
title: i18n("%1 Dependencies", resource.name)
}
model: ListModel {}
delegate: Kirigami.BasicListItem {
......
......@@ -30,21 +30,13 @@ Button
onClicked: overlay.open()
visible: view.count > 0
Popup {
DiscoverPopup {
id: overlay
parent: applicationWindow().overlay
bottomPadding: Kirigami.Units.largeSpacing
topPadding: Kirigami.Units.largeSpacing
x: (parent.width - width)/2
y: (parent.height - height)/2
width: parent.width * 1/3
height: Math.min(view.contentHeight + bottomPadding + topPadding, parent.height * 4/5)
ListView {
id: view
anchors.fill: parent
header: Kirigami.Heading {
header: Kirigami.ItemViewHeader {
text: i18n ("Permissions for %1", resource.name)
}
model: resource.plugs(root)
......
<!DOCTYPE RCC>
<RCC version="1.0">
<qresource>
<file>snapui/PermissionsButton.qml</file>
<file>qml/PermissionsButton.qml</file>
</qresource>
</RCC>
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