]> git.lyx.org Git - features.git/commitdiff
GuiBox.cpp: fix #6721
authorUwe Stöhr <uwestoehr@web.de>
Sun, 23 May 2010 16:36:06 +0000 (16:36 +0000)
committerUwe Stöhr <uwestoehr@web.de>
Sun, 23 May 2010 16:36:06 +0000 (16:36 +0000)
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

index 9c6196bbeb7936cacb4b4cc1fd5bc1a08b00c9d6..fe270165aaf0cc4512358088a4625d0a0d6ccd29 100644 (file)
@@ -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();
 }