]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiBox.cpp
Fix handling of the add branch textfield in GuiBranches
[lyx.git] / src / frontends / qt4 / GuiBox.cpp
index a74117ef74897acbc6a9e1574b59857d17d91d40..c4ddeedb55c1ae2cf03e6bc89c9c5a509731fccc 100644 (file)
@@ -14,7 +14,6 @@
 
 #include "GuiBox.h"
 
-#include "FuncRequest.h"
 #include "LengthCombo.h"
 #include "Length.h"
 #include "qt_helpers.h"
@@ -111,7 +110,7 @@ GuiBox::GuiBox(QWidget * parent) : InsetParamsWidget(parent)
 }
 
 
-void GuiBox::on_innerBoxCO_activated(int index)
+void GuiBox::on_innerBoxCO_activated(int /* index */)
 {
        QString itype =
                innerBoxCO->itemData(innerBoxCO->currentIndex()).toString();
@@ -128,10 +127,10 @@ void GuiBox::on_innerBoxCO_activated(int index)
        heightCB->setEnabled(ibox);
        // except for frameless and boxed, the width cannot be specified if
        // there is no inner box
-       bool const width_disabled = (!ibox && outer != "Frameless" &&
-               outer != "Boxed");
-       widthED->setEnabled(!width_disabled);
-       widthUnitsLC->setEnabled(!width_disabled);
+       bool const width_enabled =
+               ibox || outer == "Frameless" || outer == "Boxed";
+       widthED->setEnabled(width_enabled);
+       widthUnitsLC->setEnabled(width_enabled);
        // halign is only allowed for Boxed without inner box or for makebox
        halignCO->setEnabled((!ibox && outer == "Boxed")
                || (itype == "makebox"));
@@ -167,10 +166,10 @@ void GuiBox::on_typeCO_activated(int index)
        }
        // except for frameless and boxed, the width cannot be specified if
        // there is no inner box
-       bool const width_disabled = (itype == "none" && !frameless
-               && type != "Boxed");
-       widthED->setEnabled(!width_disabled);
-       widthUnitsLC->setEnabled(!width_disabled);
+       bool const width_enabled = 
+               itype != "none" || frameless || type == "Boxed";
+       widthED->setEnabled(width_enabled);
+       widthUnitsLC->setEnabled(width_enabled);
        // halign is only allowed for Boxed without inner box or for makebox
        halignCO->setEnabled((type == "Boxed" && itype == "none") || (itype == "makebox"));
        // pagebreak is only allowed for Boxed without inner box
@@ -264,10 +263,9 @@ void GuiBox::paramsToDialog(Inset const * inset)
 
        // except for frameless and boxed, the width cannot be specified if
        // there is no inner box
-       bool const width_disabled = (!ibox && !frameless
-               && type != "Boxed");
-       widthED->setEnabled(!width_disabled);
-       widthUnitsLC->setEnabled(!width_disabled);
+       bool const width_enabled = (ibox || frameless || type == "Boxed");
+       widthED->setEnabled(width_enabled);
+       widthUnitsLC->setEnabled(width_enabled);
 
        Length::UNIT const default_unit = Length::defaultUnit();