connect(list_, SIGNAL(currentItemChanged (QTreeWidgetItem*, QTreeWidgetItem*)),
this, SLOT(switchPanel(QTreeWidgetItem *, QTreeWidgetItem*)));
+ connect(list_, SIGNAL(itemClicked (QTreeWidgetItem*, int)),
+ this, SLOT(itemSelected(QTreeWidgetItem *, int)));
QHBoxLayout * layout = new QHBoxLayout(this);
layout->addWidget(list_, 0);
void PanelStack::switchPanel(QTreeWidgetItem * item,
- QTreeWidgetItem * /*previous*/)
+ QTreeWidgetItem * previous)
{
// if we have a category, expand the tree and go to the
// first item
if (item->childCount() > 0) {
item->setExpanded(true);
- list_->setCurrentItem(item->child(0));
+ if (previous != item->child(0))
+ list_->setCurrentItem(item->child(0));
}
if (QWidget * w = widget_map_.value(item, 0))
stack_->setCurrentWidget(w);
}
+void PanelStack::itemSelected(QTreeWidgetItem * item, int)
+{
+ // de-select the category if a child is selected
+ if (item->childCount() > 0 && item->child(0)->isSelected())
+ item->setSelected(false);
+}
+
+
QSize PanelStack::sizeHint() const
{
return QSize(list_->width() + stack_->width(),
<rect>
<x>0</x>
<y>0</y>
- <width>409</width>
- <height>232</height>
+ <width>497</width>
+ <height>299</height>
</rect>
</property>
<property name="windowTitle" >
<string>FontUi</string>
</property>
<layout class="QGridLayout" >
- <property name="margin" >
- <number>9</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item row="7" column="0" colspan="4" >
- <spacer>
+ <item row="0" column="0" >
+ <widget class="QCheckBox" name="xetexCB" >
+ <property name="toolTip" >
+ <string>Use the XeTeX processor, which allows access to all system fonts</string>
+ </property>
+ <property name="text" >
+ <string>Use &XeTeX</string>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="5" >
+ <widget class="Line" name="line" >
<property name="orientation" >
- <enum>Qt::Vertical</enum>
+ <enum>Qt::Horizontal</enum>
</property>
- <property name="sizeType" >
- <enum>QSizePolicy::Expanding</enum>
+ </widget>
+ </item>
+ <item row="2" column="0" >
+ <widget class="QLabel" name="fontsDefaultLA" >
+ <property name="text" >
+ <string>&Default Family:</string>
</property>
- <property name="sizeHint" >
- <size>
- <width>391</width>
- <height>21</height>
- </size>
+ <property name="buddy" >
+ <cstring>fontsDefaultCO</cstring>
</property>
- </spacer>
+ </widget>
+ </item>
+ <item row="2" column="2" >
+ <widget class="QComboBox" name="fontsDefaultCO" />
+ </item>
+ <item row="2" column="3" >
+ <widget class="QLabel" name="TextLabel2_2" >
+ <property name="text" >
+ <string>&Base Size:</string>
+ </property>
+ <property name="buddy" >
+ <cstring>fontsizeCO</cstring>
+ </property>
+ </widget>
</item>
- <item row="2" column="2" colspan="2" >
+ <item row="2" column="4" >
+ <widget class="QComboBox" name="fontsizeCO" />
+ </item>
+ <item row="3" column="2" >
<spacer>
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" >
<size>
- <width>131</width>
- <height>20</height>
+ <width>182</width>
+ <height>16</height>
</size>
</property>
</spacer>
</item>
- <item row="4" column="3" >
- <widget class="QSpinBox" name="scaleTypewriterSB" >
- <property name="maximum" >
- <number>200</number>
+ <item row="4" column="0" >
+ <widget class="QLabel" name="fontsRomanLA" >
+ <property name="text" >
+ <string>&Roman:</string>
</property>
- <property name="minimum" >
- <number>10</number>
+ <property name="buddy" >
+ <cstring>fontsRomanCO</cstring>
</property>
</widget>
</item>
<item row="4" column="2" >
- <widget class="QLabel" name="scaleTypewriterLA" >
- <property name="text" >
- <string>Sc&ale (%):</string>
+ <widget class="QComboBox" name="fontsRomanCO" />
+ </item>
+ <item row="4" column="3" colspan="2" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Horizontal</enum>
</property>
- <property name="buddy" >
- <cstring>scaleTypewriterSB</cstring>
+ <property name="sizeHint" >
+ <size>
+ <width>131</width>
+ <height>20</height>
+ </size>
</property>
- </widget>
- </item>
- <item row="4" column="1" >
- <widget class="QComboBox" name="fontsTypewriterCO" />
+ </spacer>
</item>
- <item row="4" column="0" >
- <widget class="QLabel" name="fontsTypewriterLA" >
+ <item row="5" column="0" >
+ <widget class="QLabel" name="fontsSansLA" >
<property name="text" >
- <string>&Typewriter:</string>
+ <string>&Sans Serif:</string>
</property>
<property name="buddy" >
- <cstring>fontsTypewriterCO</cstring>
+ <cstring>fontsSansCO</cstring>
</property>
</widget>
</item>
- <item row="2" column="1" >
- <widget class="QComboBox" name="fontsRomanCO" />
+ <item row="5" column="2" >
+ <widget class="QComboBox" name="fontsSansCO" />
</item>
- <item row="2" column="0" >
- <widget class="QLabel" name="fontsRomanLA" >
+ <item row="5" column="3" >
+ <widget class="QLabel" name="scaleSansLA" >
<property name="text" >
- <string>&Roman:</string>
+ <string>S&cale (%):</string>
</property>
<property name="buddy" >
- <cstring>fontsRomanCO</cstring>
+ <cstring>scaleSansSB</cstring>
</property>
</widget>
</item>
- <item row="3" column="3" >
+ <item row="5" column="4" >
<widget class="QSpinBox" name="scaleSansSB" >
- <property name="maximum" >
- <number>200</number>
- </property>
<property name="minimum" >
<number>10</number>
</property>
+ <property name="maximum" >
+ <number>200</number>
+ </property>
</widget>
</item>
- <item row="3" column="2" >
- <widget class="QLabel" name="scaleSansLA" >
+ <item row="6" column="0" >
+ <widget class="QLabel" name="fontsTypewriterLA" >
<property name="text" >
- <string>S&cale (%):</string>
+ <string>&Typewriter:</string>
</property>
<property name="buddy" >
- <cstring>scaleSansSB</cstring>
+ <cstring>fontsTypewriterCO</cstring>
</property>
</widget>
</item>
- <item row="3" column="1" >
- <widget class="QComboBox" name="fontsSansCO" />
+ <item row="6" column="2" >
+ <widget class="QComboBox" name="fontsTypewriterCO" />
</item>
- <item row="3" column="0" >
- <widget class="QLabel" name="fontsSansLA" >
+ <item row="6" column="3" >
+ <widget class="QLabel" name="scaleTypewriterLA" >
<property name="text" >
- <string>&Sans Serif:</string>
+ <string>Sc&ale (%):</string>
</property>
<property name="buddy" >
- <cstring>fontsSansCO</cstring>
+ <cstring>scaleTypewriterSB</cstring>
</property>
</widget>
</item>
- <item row="1" column="1" >
- <spacer>
- <property name="orientation" >
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="sizeHint" >
- <size>
- <width>182</width>
- <height>16</height>
- </size>
+ <item row="6" column="4" >
+ <widget class="QSpinBox" name="scaleTypewriterSB" >
+ <property name="minimum" >
+ <number>10</number>
</property>
- </spacer>
- </item>
- <item row="6" column="1" >
- <widget class="QCheckBox" name="fontOsfCB" >
- <property name="text" >
- <string>Use &Old Style Figures</string>
+ <property name="maximum" >
+ <number>200</number>
</property>
</widget>
</item>
- <item row="5" column="1" >
+ <item row="7" column="2" >
<widget class="QCheckBox" name="fontScCB" >
<property name="text" >
<string>Use true S&mall Caps</string>
</property>
</widget>
</item>
- <item row="0" column="0" >
- <widget class="QLabel" name="fontsDefaultLA" >
+ <item row="8" column="2" >
+ <widget class="QCheckBox" name="fontOsfCB" >
<property name="text" >
- <string>&Default Family:</string>
- </property>
- <property name="buddy" >
- <cstring>fontsDefaultCO</cstring>
+ <string>Use &Old Style Figures</string>
</property>
</widget>
</item>
- <item row="0" column="3" >
- <widget class="QComboBox" name="fontsizeCO" />
- </item>
- <item row="0" column="2" >
- <widget class="QLabel" name="TextLabel2_2" >
- <property name="text" >
- <string>&Base Size:</string>
+ <item row="9" column="0" colspan="5" >
+ <spacer>
+ <property name="orientation" >
+ <enum>Qt::Vertical</enum>
</property>
- <property name="buddy" >
- <cstring>fontsizeCO</cstring>
+ <property name="sizeType" >
+ <enum>QSizePolicy::Expanding</enum>
</property>
- </widget>
- </item>
- <item row="0" column="1" >
- <widget class="QComboBox" name="fontsDefaultCO" />
+ <property name="sizeHint" >
+ <size>
+ <width>450</width>
+ <height>16</height>
+ </size>
+ </property>
+ </spacer>
</item>
</layout>
</widget>