From 5ab1ae71938052cccff01eb24348fb26d96388bb Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Mon, 3 Apr 2017 23:52:32 +0200 Subject: [PATCH] refs #902, refs #887, avoid oversize combobox --- .../components/copyconfigurationcomponent.cpp | 7 + .../components/copyconfigurationcomponent.h | 4 + .../components/copyconfigurationcomponent.ui | 132 +++++++++--------- 3 files changed, 77 insertions(+), 66 deletions(-) diff --git a/src/blackgui/components/copyconfigurationcomponent.cpp b/src/blackgui/components/copyconfigurationcomponent.cpp index 1749855ec..5b49e9573 100644 --- a/src/blackgui/components/copyconfigurationcomponent.cpp +++ b/src/blackgui/components/copyconfigurationcomponent.cpp @@ -226,6 +226,13 @@ namespace BlackGui ui->rb_Settings->setEnabled(allow); } + void CCopyConfigurationComponent::resizeEvent(QResizeEvent *event) + { + const int w = 0.45 * this->width(); + ui->cb_OtherVersions->setMaximumWidth(w); + QFrame::resizeEvent(event); + } + void CCopyConfigurationComponent::currentVersionChanged(const QString &text) { Q_UNUSED(text); diff --git a/src/blackgui/components/copyconfigurationcomponent.h b/src/blackgui/components/copyconfigurationcomponent.h index eb5cf80b8..4a54385a4 100644 --- a/src/blackgui/components/copyconfigurationcomponent.h +++ b/src/blackgui/components/copyconfigurationcomponent.h @@ -57,6 +57,10 @@ namespace BlackGui //! Allow to toggle cache and settings void allowToggleCacheSettings(bool allow); + protected: + //! \copydoc QWidget::resizeEvent + virtual void resizeEvent(QResizeEvent *event) override; + private: //! Preselect newer files void preselectMissingOrOutdated(); diff --git a/src/blackgui/components/copyconfigurationcomponent.ui b/src/blackgui/components/copyconfigurationcomponent.ui index 082d64d8d..a91195c70 100644 --- a/src/blackgui/components/copyconfigurationcomponent.ui +++ b/src/blackgui/components/copyconfigurationcomponent.ui @@ -20,6 +20,72 @@ QFrame::Raised + + + + + 0 + + + 0 + + + 0 + + + + + Settings + + + true + + + + + + + Cache + + + + + + + select all + + + + + + + clear selection + + + + + + + copy over + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + @@ -126,72 +192,6 @@ - - - - - 0 - - - 0 - - - 0 - - - - - Settings - - - true - - - - - - - Cache - - - - - - - select all - - - - - - - clear selection - - - - - - - copy over - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - -