Uwe Stöhr wrote:
> - the text style dialog is too small, see bug 3032:
> http://bugzilla.lyx.org/show_bug.cgi?id=3032
The only way to get the combo boxes resize properly seems to be to trigger
show() again after the items have been inserted, see:
http://lists.trolltech.com/qt-interest/2002-03/thread01170-0.html
This is all but pretty, but I tried several more elegant solutions to no
avail. The attached patch works. OK?
Jürgen
Index: src/frontends/qt4/ui/QCharacterUi.ui
===================================================================
--- src/frontends/qt4/ui/QCharacterUi.ui (Revision 16318)
+++ src/frontends/qt4/ui/QCharacterUi.ui (Arbeitskopie)
@@ -1,14 +1,11 @@
<ui version="4.0" >
- <author></author>
- <comment></comment>
- <exportmacro></exportmacro>
<class>QCharacterUi</class>
<widget class="QDialog" name="QCharacterUi" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
- <width>303</width>
+ <width>325</width>
<height>231</height>
</rect>
</property>
@@ -67,6 +64,9 @@
<property name="toolTip" >
<string>Font shape</string>
</property>
+ <property name="sizeAdjustPolicy" >
+ <enum>QComboBox::AdjustToContents</enum>
+ </property>
</widget>
</item>
<item row="2" column="0" >
@@ -95,6 +95,9 @@
<property name="toolTip" >
<string>Font series</string>
</property>
+ <property name="sizeAdjustPolicy" >
+ <enum>QComboBox::AdjustToContents</enum>
+ </property>
</widget>
</item>
<item row="4" column="1" >
@@ -110,6 +113,9 @@
<property name="toolTip" >
<string>Language</string>
</property>
+ <property name="sizeAdjustPolicy" >
+ <enum>QComboBox::AdjustToContents</enum>
+ </property>
</widget>
</item>
<item row="0" column="1" >
@@ -125,6 +131,9 @@
<property name="toolTip" >
<string>Font family</string>
</property>
+ <property name="sizeAdjustPolicy" >
+ <enum>QComboBox::AdjustToContents</enum>
+ </property>
</widget>
</item>
<item row="3" column="1" >
@@ -140,6 +149,9 @@
<property name="toolTip" >
<string>Font color</string>
</property>
+ <property name="sizeAdjustPolicy" >
+ <enum>QComboBox::AdjustToContents</enum>
+ </property>
</widget>
</item>
<item row="4" column="0" >
@@ -232,6 +244,9 @@
<property name="toolTip" >
<string>Font size</string>
</property>
+ <property name="sizeAdjustPolicy" >
+ <enum>QComboBox::AdjustToContents</enum>
+ </property>
</widget>
</item>
</layout>
@@ -267,6 +282,9 @@
<property name="toolTip" >
<string>Other font settings</string>
</property>
+ <property name="sizeAdjustPolicy" >
+ <enum>QComboBox::AdjustToContents</enum>
+ </property>
</widget>
</item>
</layout>
@@ -383,10 +401,6 @@
</item>
</layout>
</widget>
- <pixmapfunction></pixmapfunction>
- <includes>
- <include location="local" >qt_helpers.h</include>
- </includes>
<tabstops>
<tabstop>familyCO</tabstop>
<tabstop>seriesCO</tabstop>
@@ -401,6 +415,9 @@
<tabstop>applyPB</tabstop>
<tabstop>closePB</tabstop>
</tabstops>
+ <includes>
+ <include location="local" >qt_helpers.h</include>
+ </includes>
<resources/>
<connections/>
</ui>
Index: src/frontends/qt4/QCharacter.C
===================================================================
--- src/frontends/qt4/QCharacter.C (Revision 16318)
+++ src/frontends/qt4/QCharacter.C (Arbeitskopie)
@@ -90,6 +90,9 @@ void QCharacter::build_dialog()
bcview().addReadOnly(dialog_->colorCO);
bcview().addReadOnly(dialog_->toggleallCB);
bcview().addReadOnly(dialog_->autoapplyCB);
+
+ // qt resizes the comboboxes only after show(), so ...
+ dialog_->show();
}