From 9a9abbe38219c196d39663b802b5b815988b7c6e Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Sat, 20 Jan 2018 03:19:59 +0100 Subject: [PATCH] Min. sizes for copy component --- .../components/copyconfigurationcomponent.cpp | 14 ++++++++++++-- .../components/copyconfigurationcomponent.h | 3 +++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/src/blackgui/components/copyconfigurationcomponent.cpp b/src/blackgui/components/copyconfigurationcomponent.cpp index 2cc19cf64..b4274c516 100644 --- a/src/blackgui/components/copyconfigurationcomponent.cpp +++ b/src/blackgui/components/copyconfigurationcomponent.cpp @@ -49,6 +49,7 @@ namespace BlackGui { ui->setupUi(this); this->initOtherSwiftVersions(); + this->setWidths(); ui->cb_ShowAll->setChecked(m_nameFilterDisables); connect(ui->rb_Cache, &QRadioButton::toggled, [ = ](bool) { this->initCurrentDirectories(true); }); @@ -300,8 +301,7 @@ namespace BlackGui void CCopyConfigurationComponent::resizeEvent(QResizeEvent *event) { - const int w = 0.45 * this->width(); - ui->cb_OtherVersions->setMaximumWidth(w); + this->setWidths(); QFrame::resizeEvent(event); } @@ -434,6 +434,16 @@ namespace BlackGui this->setNameFilterDisables(ui->cb_ShowAll->isChecked()); } + void CCopyConfigurationComponent::setWidths() + { + const int w = this->width(); + const int wCb = 0.45 * w; + const int wView = 0.4 * w; + ui->cb_OtherVersions->setMaximumWidth(wCb); + ui->tv_Destination->setMinimumWidth(wView); + ui->tv_Source->setMinimumWidth(wView); + } + const CLogCategoryList &CCopyConfigurationWizardPage::getLogCategories() { static const CLogCategoryList cats { CLogCategory::wizard(), CLogCategory::guiComponent() }; diff --git a/src/blackgui/components/copyconfigurationcomponent.h b/src/blackgui/components/copyconfigurationcomponent.h index 918534af0..dd7f7efc1 100644 --- a/src/blackgui/components/copyconfigurationcomponent.h +++ b/src/blackgui/components/copyconfigurationcomponent.h @@ -116,6 +116,9 @@ namespace BlackGui //! Set name filter disables from ui void changeNameFilterDisables(); + //! Set widths + void setWidths(); + QStringList m_otherVersionDirs; QScopedPointer ui; QString m_initializedSourceDir;