From: Uwe Stöhr Date: Fri, 5 Oct 2007 00:36:38 +0000 (+0000) Subject: GuiBox.cpp: fix update of height checkbox X-Git-Tag: 1.6.10~8017 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a2fe099fc0537729721a3763dec640d054127f0c;p=features.git GuiBox.cpp: fix update of height checkbox BoxUi.ui: fix the ui according to r20727 InsetBox.cpp: fix that e.g. "1\width" wasn't output to TeX git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20739 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiBox.cpp b/src/frontends/qt4/GuiBox.cpp index a90238b3cd..afc8b16a56 100644 --- a/src/frontends/qt4/GuiBox.cpp +++ b/src/frontends/qt4/GuiBox.cpp @@ -72,7 +72,6 @@ GuiBoxDialog::GuiBoxDialog(LyXView & lv) connect(restorePB, SIGNAL(clicked()), this, SLOT(restoreClicked())); connect(typeCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); connect(typeCO, SIGNAL(activated(int)), this, SLOT(typeChanged(int))); - connect(heightCB, SIGNAL(stateChanged(int)), this, SLOT(heightChecked(int))); connect(halignCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); connect(ialignCO, SIGNAL(activated(int)), this, SLOT(change_adaptor())); connect(innerBoxCO, SIGNAL(activated(const QString&)), @@ -157,17 +156,6 @@ void GuiBoxDialog::typeChanged(int index) } -void GuiBoxDialog::heightChecked(int checkState) -{ - if (checkState == Qt::Unchecked) { - heightED->setEnabled(false); - heightUnitsLC->setEnabled(false); - } else { - heightED->setEnabled(true); - heightUnitsLC->setEnabled(true); - } -} - void GuiBoxDialog::restoreClicked() { setInnerType(true, 2); @@ -235,7 +223,7 @@ void GuiBoxDialog::updateContents() lengthToWidgets(heightED, heightUnitsLC, (controller().params().height).asString(), default_unit); - + string const height_special = controller().params().height_special; if (!height_special.empty() && height_special != "none") { QString hspc; @@ -250,6 +238,14 @@ void GuiBoxDialog::updateContents() } } } + // set no optional height when the value is the default "1\height" + // (special units like \height are handled as "in", + if (height_special == "totalheight" && + controller().params().height == Length("1in")) + heightCB->setCheckState(Qt::Unchecked); + else + heightCB->setCheckState(Qt::Checked); + heightCB->setEnabled(ibox); } diff --git a/src/frontends/qt4/GuiBox.h b/src/frontends/qt4/GuiBox.h index d3513cf7ab..938721a285 100644 --- a/src/frontends/qt4/GuiBox.h +++ b/src/frontends/qt4/GuiBox.h @@ -33,7 +33,6 @@ private Q_SLOTS: void change_adaptor(); void innerBoxChanged(const QString &); void typeChanged(int); - void heightChecked(int); void restoreClicked(); private: diff --git a/src/frontends/qt4/ui/BoxUi.ui b/src/frontends/qt4/ui/BoxUi.ui index 327ffcf7e9..30a0e8b9e1 100644 --- a/src/frontends/qt4/ui/BoxUi.ui +++ b/src/frontends/qt4/ui/BoxUi.ui @@ -132,7 +132,7 @@ &Height (optional): - true + false false @@ -141,6 +141,9 @@ + + false + 1 @@ -155,7 +158,11 @@ - + + + false + + @@ -431,5 +438,38 @@ qt_helpers.h - + + + heightCB + toggled(bool) + heightED + setEnabled(bool) + + + 75 + 83 + + + 171 + 83 + + + + + heightCB + toggled(bool) + heightUnitsLC + setEnabled(bool) + + + 86 + 100 + + + 283 + 100 + + + + diff --git a/src/insets/InsetBox.cpp b/src/insets/InsetBox.cpp index fadc13b4b0..2b10cd663d 100644 --- a/src/insets/InsetBox.cpp +++ b/src/insets/InsetBox.cpp @@ -340,7 +340,8 @@ int InsetBox::latex(Buffer const & buf, odocstream & os, // (special units like \height are handled as "in") // but when the user has chosen a non-default inner_pos, the height // must be given: \minipage[pos][height][inner-pos]{width} - if (params_.height != Length("1in") || + if ((params_.height != Length("1in") || + params_.height_special != "totalheight") || params_.inner_pos != params_.pos) { // FIXME UNICODE os << "[" << params_.height.value()