From 6be22ade49db7c1ee2a70a048a4c4172e283409d Mon Sep 17 00:00:00 2001 From: Edwin Leuven Date: Sun, 2 Sep 2001 18:10:50 +0000 Subject: [PATCH] buttons at bottom git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2658 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 5 + src/frontends/qt2/QMinipage.C | 28 +- src/frontends/qt2/ui/QMinipageDialog.ui | 431 +++++++++++------------- 3 files changed, 226 insertions(+), 238 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index de626f3f27..31ebdd2ebe 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,8 @@ +2001-09-02 Edwin Leuven + + * QMinipage.C: remove radiobutton add combox + * ui/QMinipageDialog.ui: + buttons at bottom + 2001-09-01 John Levon * Makefile.dialogs: diff --git a/src/frontends/qt2/QMinipage.C b/src/frontends/qt2/QMinipage.C index fabb86d826..070a7fc439 100644 --- a/src/frontends/qt2/QMinipage.C +++ b/src/frontends/qt2/QMinipage.C @@ -13,7 +13,7 @@ #endif #include -#include +#include #include #include "lengthcombo.h" @@ -26,6 +26,7 @@ #include "QtLyXView.h" #include "ControlMinipage.h" +#include "debug.h" typedef Qt2CB > base_class; QMinipage::QMinipage(ControlMinipage & c) @@ -45,9 +46,7 @@ void QMinipage::build_dialog() bc().addReadOnly(dialog_->widthED); bc().addReadOnly(dialog_->unitsLC); - bc().addReadOnly(dialog_->topRB); - bc().addReadOnly(dialog_->bottomRB); - bc().addReadOnly(dialog_->middleRB); + bc().addReadOnly(dialog_->valignCO); } @@ -62,12 +61,17 @@ void QMinipage::apply() controller().params().width = len.asString(); - if (dialog_->topRB->isChecked()) + switch (dialog_->valignCO->currentItem()) { + case 0: controller().params().pos = InsetMinipage::top; - else if (dialog_->middleRB->isChecked()) + break; + case 1: controller().params().pos = InsetMinipage::center; - else + break; + case 2: controller().params().pos = InsetMinipage::bottom; + break; + } } @@ -86,16 +90,16 @@ void QMinipage::update_contents() LyXLength len(controller().params().width.c_str()); dialog_->widthED->setText(numtostr(len.value()).c_str()); dialog_->unitsLC->setCurrentItem(len.unit()); + lyxerr << "width " << numtostr(len.value()).c_str() << " units " << len.unit() << std::endl; - QRadioButton * button = dialog_->topRB; - + int item = 0; switch (controller().params().pos) { case InsetMinipage::center: - button = dialog_->middleRB; + item = 1; break; case InsetMinipage::bottom: - button = dialog_->bottomRB; + item = 2; break; } - button->setChecked(true); + dialog_->valignCO->setCurrentItem(item); } diff --git a/src/frontends/qt2/ui/QMinipageDialog.ui b/src/frontends/qt2/ui/QMinipageDialog.ui index d3250f54b6..aa45ae1305 100644 --- a/src/frontends/qt2/ui/QMinipageDialog.ui +++ b/src/frontends/qt2/ui/QMinipageDialog.ui @@ -14,14 +14,20 @@ 0 0 - 296 - 184 + 369 + 104 caption Minipage settings + + layoutMargin + + + layoutSpacing + margin @@ -31,180 +37,13 @@ spacing 6 - - QPushButton - - name - restorePB - - - text - &Restore - - - default - true - - - toolTip - - - - - LengthCombo - - name - unitsLC - - - sizePolicy - - 3 - 0 - - - - minimumSize - - 40 - 22 - - - - focusPolicy - StrongFocus - - - toolTip - Units of width value - - - - QLineEdit - - name - widthED - - - toolTip - Width value - - - - QLabel - - name - widthLA - - - frameShape - MShape - - - frameShadow - MShadow - - - text - &Width: - - - buddy - widthED - - - - QButtonGroup - - name - alignmentBG - - - sizePolicy - - 5 - 7 - - - - frameShape - Box - - - frameShadow - Sunken - - - title - &Vertical alignment - - - toolTip - Alignment of minipage - - - - margin - 11 - - - spacing - 6 - - - QRadioButton - - name - topRB - - - text - &Top - - - toolTip - FIXME - - - - QRadioButton - - name - middleRB - - - text - &Middle - - - toolTip - FIXME - - - - QRadioButton - - name - bottomRB - - - text - &Bottom - - - toolTip - FIXME - - - - - + QLayoutWidget name - Layout1 + Layout17 - + margin 0 @@ -213,44 +52,33 @@ spacing 6 - + QPushButton name - okPB + restorePB text - &OK + &Restore default - true + false toolTip - - QPushButton - - name - closePB - - - text - &Close - - - + name - Spacer145 + Spacer1 orientation - Vertical + Horizontal sizeType @@ -264,7 +92,26 @@ - + + QPushButton + + name + okPB + + + text + &OK + + + default + false + + + toolTip + + + + QPushButton name @@ -276,29 +123,175 @@ default - true + false toolTip - + + QPushButton + + name + closePB + + + text + &Close + + + default + true + + + - - QLabel + + QLayoutWidget name - unitsLA - - - text - &Units: - - - buddy - unitsLC + Layout3 + + + margin + 0 + + + spacing + 6 + + + QLabel + + name + unitsLA + + + text + &Units: + + + buddy + unitsLC + + + + QLabel + + name + widthLA + + + frameShape + MShape + + + frameShadow + MShadow + + + text + &Width: + + + buddy + widthED + + + + LengthCombo + + name + unitsLC + + + sizePolicy + + 3 + 0 + + + + minimumSize + + 40 + 22 + + + + focusPolicy + StrongFocus + + + toolTip + Units of width value + + + + QLabel + + name + valignLA + + + text + A&lignment: + + + buddy + valignCO + + + + QLineEdit + + name + widthED + + + sizePolicy + + 1 + 0 + + + + toolTip + Width value + + + + QComboBox + + + text + Top + + + + + text + Middle + + + + + text + Bottom + + + + name + valignCO + + + toolTip + Vertical alignment + + + @@ -332,24 +325,6 @@ QMinipageDialogBase updateClicked() - - topRB - toggled(bool) - QMinipageDialogBase - change_adaptor() - - - middleRB - toggled(bool) - QMinipageDialogBase - change_adaptor() - - - bottomRB - clicked() - QMinipageDialogBase - change_adaptor() - widthED textChanged(const QString&) @@ -362,18 +337,22 @@ QMinipageDialogBase change_adaptor() + + valignCO + highlighted(const QString&) + QMinipageDialogBase + change_adaptor() + change_adaptor() updateClicked() widthED unitsLC - topRB - middleRB - bottomRB + valignCO restorePB - okPB applyPB + okPB closePB