diff --git a/src/frontends/qt4/PanelStack.cpp b/src/frontends/qt4/PanelStack.cpp index 08a24e7585..145da5b9b2 100644 --- a/src/frontends/qt4/PanelStack.cpp +++ b/src/frontends/qt4/PanelStack.cpp @@ -48,6 +48,8 @@ PanelStack::PanelStack(QWidget * parent) 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); @@ -113,19 +115,28 @@ void PanelStack::setCurrentPanel(QString const & name) 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(), diff --git a/src/frontends/qt4/PanelStack.h b/src/frontends/qt4/PanelStack.h index 45ca24bb25..fa32a54e44 100644 --- a/src/frontends/qt4/PanelStack.h +++ b/src/frontends/qt4/PanelStack.h @@ -43,6 +43,8 @@ public: public Q_SLOTS: /// set current panel from an item void switchPanel(QTreeWidgetItem * it, QTreeWidgetItem * previous = 0); + /// click on the tree + void itemSelected(QTreeWidgetItem *, int); private: /// diff --git a/src/frontends/qt4/ui/FontUi.ui b/src/frontends/qt4/ui/FontUi.ui index 7f072a195a..5572acbc7a 100644 --- a/src/frontends/qt4/ui/FontUi.ui +++ b/src/frontends/qt4/ui/FontUi.ui @@ -5,129 +5,58 @@ 0 0 - 409 - 232 + 497 + 299 FontUi - - 9 - - - 6 - - - - - Qt::Vertical + + + + Use the XeTeX processor, which allows access to all system fonts - - QSizePolicy::Expanding + + Use &XeTeX - - - 391 - 21 - - - + - - + + Qt::Horizontal - - - 131 - 20 - - - - - - - - 200 - - - 10 - - - - - Sc&ale (%): - - - scaleTypewriterSB - - - - - - - - - - &Typewriter: - - - fontsTypewriterCO - - - - - - - + - &Roman: + &Default Family: - fontsRomanCO + fontsDefaultCO - - - - 200 + + + + + + + &Base Size: - - 10 + + fontsizeCO + + + - - - S&cale (%): - - - scaleSansSB - - - - - - - - - - &Sans Serif: - - - fontsSansCO - - - - Qt::Horizontal @@ -140,45 +69,127 @@ - - + + - Use &Old Style Figures + &Roman: + + + fontsRomanCO - + + + + + + + Qt::Horizontal + + + + 131 + 20 + + + + + + + + &Sans Serif: + + + fontsSansCO + + + + + + + + + + S&cale (%): + + + scaleSansSB + + + + + + + 10 + + + 200 + + + + + + + &Typewriter: + + + fontsTypewriterCO + + + + + + + + + + Sc&ale (%): + + + scaleTypewriterSB + + + + + + + 10 + + + 200 + + + + Use true S&mall Caps - - + + - &Default Family: - - - fontsDefaultCO + Use &Old Style Figures - - - - - - - &Base Size: + + + + Qt::Vertical - - fontsizeCO + + QSizePolicy::Expanding - - - - + + + 450 + 16 + + +