From 4868a2e54c649c7eb993b0e9a89fd320d9546fc3 Mon Sep 17 00:00:00 2001 From: reionwong Date: Wed, 18 Aug 2021 05:35:23 +0800 Subject: [PATCH] Fix OpenWithDialog icon --- dialogs/openwithdialog.cpp | 4 ++++ qml/Dialogs/OpenWithDialog.qml | 9 ++++----- qml/main.qml | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/dialogs/openwithdialog.cpp b/dialogs/openwithdialog.cpp index 58c3842..4e8cef4 100644 --- a/dialogs/openwithdialog.cpp +++ b/dialogs/openwithdialog.cpp @@ -37,6 +37,10 @@ OpenWithDialog::OpenWithDialog(const QUrl &url, QQuickView *parent) engine()->rootContext()->setContextProperty("launcher", FileLauncher::self()); setSource(QUrl("qrc:/qml/Dialogs/OpenWithDialog.qml")); + + QRect rect = geometry(); + setMinimumSize(rect.size()); + setMaximumSize(rect.size()); } QString OpenWithDialog::url() const diff --git a/qml/Dialogs/OpenWithDialog.qml b/qml/Dialogs/OpenWithDialog.qml index fcb55c1..d19a622 100644 --- a/qml/Dialogs/OpenWithDialog.qml +++ b/qml/Dialogs/OpenWithDialog.qml @@ -118,12 +118,11 @@ Item { anchors.margins: FishUI.Units.smallSpacing spacing: FishUI.Units.smallSpacing - Image { + FishUI.IconItem { id: icon - source: "image://icontheme/" + model.icon - width: 30 - height: width - sourceSize: Qt.size(width, height) + Layout.fillHeight: true + Layout.preferredWidth: height + source: model.icon Layout.alignment: Qt.AlignLeft } diff --git a/qml/main.qml b/qml/main.qml index 5633343..dfa4db0 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -35,7 +35,7 @@ FishUI.Window { title: qsTr("File Manager") header.height: 36 + FishUI.Units.largeSpacing - background.opacity: 0.9 + background.opacity: root.compositing ? 0.9 : 1.0 FishUI.WindowBlur { view: root