diff --git a/dialogs/filepropertiesdialog.cpp b/dialogs/filepropertiesdialog.cpp index d0165a7..3fb803c 100644 --- a/dialogs/filepropertiesdialog.cpp +++ b/dialogs/filepropertiesdialog.cpp @@ -71,6 +71,13 @@ FilePropertiesDialog::~FilePropertiesDialog() } } +void FilePropertiesDialog::updateSize(int width, int height) +{ + setBaseSize(QSize(width, height)); + setMinimumSize(QSize(width, height)); + setMaximumSize(QSize(width, height)); +} + void FilePropertiesDialog::accept(const QString &text) { KFileItemList list = m_items; diff --git a/dialogs/filepropertiesdialog.h b/dialogs/filepropertiesdialog.h index 809f695..a87bf5f 100644 --- a/dialogs/filepropertiesdialog.h +++ b/dialogs/filepropertiesdialog.h @@ -50,6 +50,8 @@ public: explicit FilePropertiesDialog(const QUrl &url, QQuickView *parent = nullptr); ~FilePropertiesDialog(); + Q_INVOKABLE void updateSize(int width, int height); + Q_INVOKABLE void accept(const QString &text); Q_INVOKABLE void reject(); diff --git a/qml/Dialogs/PropertiesDialog.qml b/qml/Dialogs/PropertiesDialog.qml index 7002d88..86592cc 100644 --- a/qml/Dialogs/PropertiesDialog.qml +++ b/qml/Dialogs/PropertiesDialog.qml @@ -26,8 +26,14 @@ import FishUI 1.0 as FishUI Item { id: control - width: _mainLayout.implicitWidth + FishUI.Units.largeSpacing * 4 - height: _mainLayout.implicitHeight + FishUI.Units.largeSpacing * 2 + property int widthValue: _mainLayout.implicitWidth + FishUI.Units.largeSpacing * 4 + property int heightValue: _mainLayout.implicitHeight + FishUI.Units.largeSpacing * 2 + + // width: widthValue + // height: heightValue + + onWidthValueChanged: main.updateSize(widthValue, heightValue) + onHeightValueChanged: main.updateSize(widthValue, heightValue) focus: true Keys.enabled: true