From 7d031e1fefbacc38037150ee74e1efa122f95b41 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Uwe=20St=C3=B6hr?= Date: Sat, 26 Jun 2010 21:02:14 +0000 Subject: [PATCH] GuiBox.cpp: fix this issue: horizontal box alignment is only possible without inner box and simple frame (the same as with pagebreaks) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34713 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiBox.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/frontends/qt4/GuiBox.cpp b/src/frontends/qt4/GuiBox.cpp index 9a002fddbc..1e928ad54d 100644 --- a/src/frontends/qt4/GuiBox.cpp +++ b/src/frontends/qt4/GuiBox.cpp @@ -119,7 +119,6 @@ void GuiBox::on_innerBoxCO_activated(int index) typeCO->itemData(typeCO->currentIndex()).toString(); valignCO->setEnabled(ibox); ialignCO->setEnabled(ibox); - halignCO->setEnabled(!ibox); heightCB->setEnabled(ibox); // except for frameless and boxed, the width cannot be specified if // there is no inner box @@ -127,6 +126,8 @@ void GuiBox::on_innerBoxCO_activated(int index) outer != "Boxed"); widthED->setEnabled(!width_disabled); widthUnitsLC->setEnabled(!width_disabled); + // halign and pagebreak are only allowed for Boxed without inner box + halignCO->setEnabled(!ibox && outer == "Boxed"); pagebreakCB->setEnabled(!ibox && outer == "Boxed"); setSpecial(ibox); changed(); @@ -141,7 +142,6 @@ void GuiBox::on_typeCO_activated(int index) if (frameless) { valignCO->setEnabled(true); ialignCO->setEnabled(true); - halignCO->setEnabled(false); heightCB->setEnabled(true); setSpecial(true); } @@ -149,13 +149,15 @@ void GuiBox::on_typeCO_activated(int index) pagebreakCB->setChecked(false); QString itype = innerBoxCO->itemData(innerBoxCO->currentIndex()).toString(); - pagebreakCB->setEnabled(type == "Boxed" && itype == "none"); // 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); + // halign and pagebreak are only allowed for Boxed without inner box + halignCO->setEnabled(type == "Boxed" && itype == "none"); + pagebreakCB->setEnabled(type == "Boxed" && itype == "none"); setInnerType(frameless, itype); changed(); } @@ -166,7 +168,6 @@ void GuiBox::initDialog() setInnerType(true, toqstr("minipage")); widthED->setText("100"); widthUnitsLC->setCurrentItem(Length::PCW); - heightCB->setCheckState(Qt::Checked); heightED->setText("1"); heightUnitsLC->setCurrentItem("totalheight"); } @@ -215,8 +216,6 @@ void GuiBox::paramsToDialog(Inset const * inset) pagebreakCB->setChecked(false); } - pagebreakCB->setEnabled(type == "Boxed" && !params.inner_box); - typeCO->setCurrentIndex(typeCO->findData(type)); // default: minipage @@ -238,9 +237,19 @@ void GuiBox::paramsToDialog(Inset const * inset) bool ibox = params.inner_box; valignCO->setEnabled(ibox); ialignCO->setEnabled(ibox); - halignCO->setEnabled(!ibox); setSpecial(ibox); + // halign and pagebreak are only allowed for Boxed without inner box + halignCO->setEnabled(!ibox && type == "Boxed"); + pagebreakCB->setEnabled(!ibox && type == "Boxed"); + + // 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); + Length::UNIT const default_unit = Length::defaultUnit(); lengthToWidgets(widthED, widthUnitsLC, -- 2.39.5