From 2c48ac262615ce8b126f070c699ba352f45d6163 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=BCrgen=20Spitzm=C3=BCller?= Date: Mon, 3 Jan 2011 17:21:37 +0000 Subject: [PATCH] Fix UI glitch in the prefs dialog (bug 7190). git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_6_X@37082 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiPrefs.cpp | 31 ++++++++++++++++++++----------- src/frontends/qt4/GuiPrefs.h | 1 + status.16x | 3 +++ 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/src/frontends/qt4/GuiPrefs.cpp b/src/frontends/qt4/GuiPrefs.cpp index 716014d167..bb3c444882 100644 --- a/src/frontends/qt4/GuiPrefs.cpp +++ b/src/frontends/qt4/GuiPrefs.cpp @@ -970,29 +970,35 @@ PrefDisplay::PrefDisplay(GuiPreferences * form) connect(displayGraphicsCB, SIGNAL(toggled(bool)), this, SIGNAL(changed())); connect(instantPreviewCO, SIGNAL(activated(int)), this, SIGNAL(changed())); connect(previewSizeSB, SIGNAL(valueChanged(double)), this, SIGNAL(changed())); - if (instantPreviewCO->currentIndex() == 0) - previewSizeSB->setEnabled(false); - else - previewSizeSB->setEnabled(true); connect(paragraphMarkerCB, SIGNAL(toggled(bool)), this, SIGNAL(changed())); } void PrefDisplay::on_instantPreviewCO_currentIndexChanged(int index) { - if (index == 0) - previewSizeSB->setEnabled(false); - else - previewSizeSB->setEnabled(true); + previewSizeSB->setEnabled(index != 0); +} + + +void PrefDisplay::on_displayGraphicsCB_toggled(bool on) +{ + instantPreviewCO->setEnabled(on); + previewSizeSB->setEnabled(on && instantPreviewCO->currentIndex() > 0); } void PrefDisplay::apply(LyXRC & rc) const { switch (instantPreviewCO->currentIndex()) { - case 0: rc.preview = LyXRC::PREVIEW_OFF; break; - case 1: rc.preview = LyXRC::PREVIEW_NO_MATH; break; - case 2: rc.preview = LyXRC::PREVIEW_ON; break; + case 0: + rc.preview = LyXRC::PREVIEW_OFF; + break; + case 1: + rc.preview = LyXRC::PREVIEW_NO_MATH; + break; + case 2: + rc.preview = LyXRC::PREVIEW_ON; + break; } rc.display_graphics = displayGraphicsCB->isChecked(); @@ -1027,6 +1033,9 @@ void PrefDisplay::update(LyXRC const & rc) instantPreviewCO->setEnabled(rc.display_graphics); previewSizeSB->setValue(rc.preview_scale_factor); paragraphMarkerCB->setChecked(rc.paragraph_markers); + previewSizeSB->setEnabled( + rc.display_graphics + && rc.preview != LyXRC::PREVIEW_OFF); } diff --git a/src/frontends/qt4/GuiPrefs.h b/src/frontends/qt4/GuiPrefs.h index 7d687f4f95..036640e061 100644 --- a/src/frontends/qt4/GuiPrefs.h +++ b/src/frontends/qt4/GuiPrefs.h @@ -275,6 +275,7 @@ public: private Q_SLOTS: void on_instantPreviewCO_currentIndexChanged(int); + void on_displayGraphicsCB_toggled(bool); }; diff --git a/status.16x b/status.16x index 0454c0926a..1a64c41c30 100644 --- a/status.16x +++ b/status.16x @@ -154,6 +154,9 @@ What's new - Wake up from waiting state after encountering a file parsing error (bug 6950). +- Fix enabling/disabling of Instant Preview widgets in the preferences + dialog (bug 7190). + * DOCUMENTATION AND LOCALIZATION