Commit 2392a9b3 authored by Harald Sitter's avatar Harald Sitter 🏳️‍🌈
Browse files

repair conditional root button

got lost in the qml port
parent 296d077b
Pipeline #172284 passed with stage
in 2 minutes and 31 seconds
......@@ -20,6 +20,7 @@
#include <QFileDialog>
#include <QQmlApplicationEngine>
#include <QQmlContext>
#include <QStandardPaths>
#include "Config.h"
#include "define.h"
......@@ -68,6 +69,11 @@ MainContext::MainContext(QObject *parent)
qmlRegisterSingletonInstance("org.kde.filelight", 1, 0, "ScanManager", m_manager);
qmlRegisterSingletonInstance("org.kde.filelight", 1, 0, "MainContext", this);
engine->setInitialProperties({
{QStringLiteral("inSandbox"),
!QStandardPaths::locate(QStandardPaths::RuntimeLocation, QStringLiteral("flatpak-info")).isEmpty() || qEnvironmentVariableIsSet("SNAP")},
});
const QUrl mainUrl(QStringLiteral("qrc:/ui/main.qml"));
QObject::connect(
engine,
......
......@@ -38,7 +38,7 @@ Kirigami.Page {
Flow {
Layout.alignment: Qt.AlignHCenter
Layout.maximumWidth: parent.width
Layout.preferredWidth: button1.implicitWidth + spacing + button2.implicitWidth + spacing + button3.implicitWidth
Layout.preferredWidth: button1.implicitWidth + spacing + button2.implicitWidth + (button3.visible ? spacing + button3.implicitWidth : 0)
QQC2.ToolButton {
id: button1
icon.width: Kirigami.Units.iconSizes.huge
......@@ -55,6 +55,7 @@ Kirigami.Page {
}
QQC2.ToolButton {
id: button3
visible: !inSandbox
icon.width: Kirigami.Units.iconSizes.huge
icon.height: Kirigami.Units.iconSizes.huge
display: QQC2.AbstractButton.TextUnderIcon
......
......@@ -13,6 +13,8 @@ import Qt.labs.platform 1.1 as Platform
Kirigami.ApplicationWindow {
id: appWindow
required property bool inSandbox
property string status
property int numberOfFiles
property var mapItem: null
......
Supports Markdown
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