citeCmds_ = documentBuffer().params().citeCommands();
citeStyles_ = documentBuffer().params().citeStyles();
init();
+
+ // Set the minimal size of the QToolbox. Without this, the size of the
+ // QToolbox is only determined by values in the ui file (e.g. computed by
+ // qtcreator) and therefore causes portability and localisation issues. In
+ // the future, this should be integrated into a custom widget if plans are
+ // made to generalise such a use of QToolboxes. Note that the page widgets
+ // must have a layout with layoutSizeContraint = SetMinimumSize or similar.
+ if (!isVisible()) {
+ // only reliable way to get the size calculations up-to-date
+ show();
+ layout()->invalidate();
+ hide();
+ // this does not show any window since hide() is called before
+ // relinquishing control
+ }
+ QSize minimum_size = QSize(0,0);
+ // Compute the max of the minimal sizes of the pages
+ QWidget * page;
+ for (int i = 0; (page = citationTB->widget(i)); ++i)
+ minimum_size = minimum_size.expandedTo(page->minimumSizeHint());
+ // Add the height of the tabs
+ if (citationTB->currentWidget())
+ minimum_size.rheight() += citationTB->height() -
+ citationTB->currentWidget()->height();
+ citationTB->setMinimumSize(minimum_size);
+ updateGeometry();
+
return true;
}
<property name="sizeGripEnabled">
<bool>true</bool>
</property>
- <layout class="QGridLayout" name="gridLayout_4">
+ <layout class="QGridLayout" name="gridLayout_4" rowstretch="1,0,0">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<attribute name="label">
<string>&Search Citation</string>
</attribute>
- <layout class="QGridLayout" name="gridLayout_3">
+ <layout class="QGridLayout" name="gridLayout_3" columnstretch="0,1,0,0,0,0">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetMinimumSize</enum>
+ </property>
<item row="0" column="0">
<widget class="QLabel" name="findKeysLA">
<property name="text">
</item>
<item row="1" column="1">
<widget class="QComboBox" name="fieldsCO">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="maxVisibleItems">
<number>16</number>
</property>
</item>
<item row="2" column="1">
<widget class="QComboBox" name="entriesCO">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="MinimumExpanding" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="insertPolicy">
<enum>QComboBox::NoInsert</enum>
</property>
<string>For&matting</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
+ <property name="sizeConstraint">
+ <enum>QLayout::SetMinimumSize</enum>
+ </property>
<item row="0" column="0">
<widget class="QLabel" name="citationStyleLA">
<property name="text">
<property name="sizeHint" stdset="0">
<size>
<width>21</width>
- <height>20</height>
+ <height>26</height>
</size>
</property>
</spacer>