From 643803d0e23147f3654c76a4ee0a85d7f864709d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Sun, 23 May 2010 16:36:06 +0000 Subject: [PATCH] GuiBox.cpp: fix #6721 Also for branch? git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34471 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiBox.cpp | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) diff --git a/src/frontends/qt4/GuiBox.cpp b/src/frontends/qt4/GuiBox.cpp index 9c6196bbeb..fe270165aa 100644 --- a/src/frontends/qt4/GuiBox.cpp +++ b/src/frontends/qt4/GuiBox.cpp @@ -114,11 +114,21 @@ GuiBox::GuiBox(QWidget * parent) : InsetParamsWidget(parent) void GuiBox::on_innerBoxCO_activated(QString const & str) { bool const ibox = (str != qt_("None")); + int outer = typeCO->currentIndex(); valignCO->setEnabled(ibox); ialignCO->setEnabled(ibox); halignCO->setEnabled(!ibox); heightCB->setEnabled(ibox); - pagebreakCB->setEnabled(!ibox && typeCO->currentIndex() == 1); + // if an outer box from the fancybox LaTeX-package has no inner box, + // the width cannot be specified + if (!ibox && outer != 0 && outer != 1) { + widthED->setEnabled(false); + widthUnitsLC->setEnabled(false); + } else { + widthED->setEnabled(true); + widthUnitsLC->setEnabled(true); + } + pagebreakCB->setEnabled(!ibox && outer == 1); setSpecial(ibox); changed(); } @@ -140,8 +150,16 @@ void GuiBox::on_typeCO_activated(int index) if (innerBoxCO->count() == 2) ++itype; pagebreakCB->setEnabled(index == 1 && itype == 0); - widthED->setEnabled(index != 5); - widthUnitsLC->setEnabled(index != 5); + // if an outer box from the fancybox LaTeX-package has no inner box, + // the width cannot be specified + if (itype == 0 + && (index == 2 || index == 3 || index == 4 || index == 6)) { + widthED->setEnabled(false); + widthUnitsLC->setEnabled(false); + } else { + widthED->setEnabled(index != 5); + widthUnitsLC->setEnabled(index != 5); + } setInnerType(frameless, itype); changed(); } -- 2.39.2