From ce09085156f7bd475f4079ab1ae05b77ace7785f Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Wed, 19 Mar 2008 18:15:16 +0000 Subject: [PATCH] * src/frontends/qt4/PanelStack.{cpp, h}: - fix issues with clicking and keyboard movement git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23834 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/PanelStack.cpp | 15 ++- src/frontends/qt4/PanelStack.h | 2 + src/frontends/qt4/ui/FontUi.ui | 205 ++++++++++++++++--------------- 3 files changed, 123 insertions(+), 99 deletions(-) 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,180 +5,191 @@ 0 0 - 409 - 232 + 497 + 299 FontUi - - 9 - - - 6 - - - + + + + Use the XeTeX processor, which allows access to all system fonts + + + Use &XeTeX + + + + + - Qt::Vertical + Qt::Horizontal - - QSizePolicy::Expanding + + + + + + &Default Family: - - - 391 - 21 - + + fontsDefaultCO - + + + + + + + + + &Base Size: + + + fontsizeCO + + - + + + + Qt::Horizontal - 131 - 20 + 182 + 16 - - - - 200 + + + + &Roman: - - 10 + + fontsRomanCO - - - Sc&ale (%): + + + + + + Qt::Horizontal - - scaleTypewriterSB + + + 131 + 20 + - - - - + - - + + - &Typewriter: + &Sans Serif: - fontsTypewriterCO + fontsSansCO - - + + - - + + - &Roman: + S&cale (%): - fontsRomanCO + scaleSansSB - + - - 200 - 10 + + 200 + - - + + - S&cale (%): + &Typewriter: - scaleSansSB + fontsTypewriterCO - - + + - - + + - &Sans Serif: + Sc&ale (%): - fontsSansCO + scaleTypewriterSB - - - - Qt::Horizontal - - - - 182 - 16 - + + + + 10 - - - - - - Use &Old Style Figures + + 200 - + Use true S&mall Caps - - + + - &Default Family: - - - fontsDefaultCO + Use &Old Style Figures - - - - - - - &Base Size: + + + + Qt::Vertical - - fontsizeCO + + QSizePolicy::Expanding - - - - + + + 450 + 16 + + + -- 2.39.2