From 82b6844d4f77625434050d09bd51d77b4568f180 Mon Sep 17 00:00:00 2001 From: Abs62 <ottomann@yandex.ru> Date: Wed, 19 Dec 2012 17:00:50 +0400 Subject: [PATCH] Adjust resizing of the groups management widget --- groups.cc | 4 ++++ groups.ui | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/groups.cc b/groups.cc index 2163a47a..81ee3a63 100644 --- a/groups.cc +++ b/groups.cc @@ -86,6 +86,10 @@ void Groups::countChanged() ui.renameGroup->setEnabled( en ); ui.removeGroup->setEnabled( en ); ui.removeAllGroups->setEnabled( en ); + + int stretch = ui.groups->count() / 5; + if( stretch > 3 ) stretch = 3; + ui.gridLayout->setColumnStretch( 2, stretch ); } void Groups::addNew() diff --git a/groups.ui b/groups.ui index c9bf34f8..916167e7 100644 --- a/groups.ui +++ b/groups.ui @@ -13,7 +13,7 @@ <property name="windowTitle"> <string notr="true">Groups</string> </property> - <layout class="QGridLayout" name="gridLayout"> + <layout class="QGridLayout" name="gridLayout" columnstretch="1,0,0"> <item row="0" column="0"> <layout class="QVBoxLayout" name="verticalLayout_3"> <item>