[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lyx-cvs
Subject:    r34715 - in lyx-devel/branches/BRANCH_1_6_X: . src/frontends/qt4
From:       uwestoehr () lyx ! org
Date:       2010-06-28 2:04:52
Message-ID: 20100628020453.1747231048 () lyx ! lyx ! org
[Download RAW message or body]

Author: uwestoehr
Date: Mon Jun 28 04:04:51 2010
New Revision: 34715
URL: http://www.lyx.org/trac/changeset/34715

Log:
GuiBox.cpp: fix #6721 for branch

Modified:
   lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiBox.cpp
   lyx-devel/branches/BRANCH_1_6_X/status.16x

Modified: lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiBox.cpp
==============================================================================
--- lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiBox.cpp	Sun Jun 27 14:54:24 2010	(r34714)
+++ lyx-devel/branches/BRANCH_1_6_X/src/frontends/qt4/GuiBox.cpp	Mon Jun 28 04:04:51 2010	(r34715)
@@ -157,6 +157,7 @@
 void GuiBox::innerBoxChanged(QString const & str)
 {
 	bool const ibox = (str != qt_("None"));
+	int outer = typeCO->currentIndex(); 
 	valignCO->setEnabled(ibox);
 	ialignCO->setEnabled(ibox);
 	halignCO->setEnabled(!ibox);
@@ -164,6 +165,12 @@
 	pagebreakCB->setEnabled(!ibox && typeCO->currentIndex() == 1);
 	heightED->setEnabled(heightCB->checkState() == Qt::Checked && ibox);
 	heightUnitsLC->setEnabled(heightCB->checkState() == Qt::Checked && ibox);
+	// except for frameless and boxed, the width cannot be specified if
+	// there is no inner box
+	bool const width_disabled = (!ibox && outer != 0 &&
+		outer != 1);
+	widthED->setEnabled(!width_disabled);
+	widthUnitsLC->setEnabled(!width_disabled);
 	setSpecial(ibox);
 }
 
@@ -186,8 +193,12 @@
 	if (innerBoxCO->count() == 2)
 		++itype;
 	pagebreakCB->setEnabled(index == 1 && itype == 0);
-	widthED->setEnabled(index != 5);
-	widthUnitsLC->setEnabled(index != 5);
+	// except for frameless and boxed, the width cannot be specified if
+	// there is no inner box
+	bool const width_disabled = (itype == 0 && !frameless
+		&& index != 1);
+	widthED->setEnabled(!width_disabled);
+	widthUnitsLC->setEnabled(!width_disabled);
 	setInnerType(frameless, itype);
 }
 
@@ -252,9 +263,9 @@
 	if (params_.use_parbox)
 		// parbox
 		inner_type = 1;
-	bool frameless = (params_.type == "Frameless");
+	bool const frameless = (params_.type == "Frameless");
 	setInnerType(frameless, inner_type);
-
+	
 	char c = params_.pos;
 	valignCO->setCurrentIndex(string("tcb").find(c, 0));
 	c = params_.inner_pos;
@@ -268,6 +279,13 @@
 	halignCO->setEnabled(!ibox);
 	setSpecial(ibox);
 
+	// 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 default_unit =
 		(lyxrc.default_papersize > 3) ? Length::CM : Length::IN;
 

Modified: lyx-devel/branches/BRANCH_1_6_X/status.16x
==============================================================================
--- lyx-devel/branches/BRANCH_1_6_X/status.16x	Sun Jun 27 14:54:24 2010	(r34714)
+++ lyx-devel/branches/BRANCH_1_6_X/status.16x	Mon Jun 28 04:04:51 2010	(r34715)
@@ -148,6 +148,9 @@
 - Correctly paint the button for external material when the "Preview"
   attribute is not defined (bug 6677).
 
+- Box dialog: without an inner box the specification of the width is only
+  possible with a simple frame (bug 6721).
+
 - Use correct fonts for rendering the \underbar and \ensuremath macros in
   math when they are nested in certain environments (bug 6729 and 6745).
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic