From 44983a3ef6aeaa618c8355f96c285a5ee94eeed9 Mon Sep 17 00:00:00 2001 From: John Levon Date: Sun, 8 Sep 2002 05:00:37 +0000 Subject: [PATCH] god DAMN ! git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5232 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt2/ChangeLog | 6 ++++++ src/frontends/qt2/QMathDialog.C | 5 +++++ src/frontends/qt2/iconpalette.C | 37 +++++++++++++++++++-------------- 3 files changed, 32 insertions(+), 16 deletions(-) diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index c915492fce..a48adee6e0 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,9 @@ +2002-09-08 John Levon + + * QMathDialog.C: + * iconpalette.h: + * iconpalette.C: make sizing work properly + 2002-09-08 John Levon * QMathDialog.h: diff --git a/src/frontends/qt2/QMathDialog.C b/src/frontends/qt2/QMathDialog.C index 9ab38c8ba5..e8cd01577b 100644 --- a/src/frontends/qt2/QMathDialog.C +++ b/src/frontends/qt2/QMathDialog.C @@ -140,7 +140,12 @@ void QMathDialog::expandClicked() { int const id = symbolsWS->id(symbolsWS->visibleWidget()); IconPalette * p = makePanel(0, panels[id]); + string s = "LyX: "; + s += symbolsCO->text(id).latin1(); + p->setCaption(s.c_str()); + p->resize(40 * 5, p->height()); p->show(); + p->setMaximumSize(p->width(), p->height()); } diff --git a/src/frontends/qt2/iconpalette.C b/src/frontends/qt2/iconpalette.C index 724aff44b5..6141bfbdce 100644 --- a/src/frontends/qt2/iconpalette.C +++ b/src/frontends/qt2/iconpalette.C @@ -61,15 +61,23 @@ void IconPalette::clicked() void IconPalette::resizeEvent(QResizeEvent * e) { - lyxerr << "resize panel to " << e->size().width() << "," << e->size().height() << endl; + QWidget::resizeEvent(e); + + lyxerr[Debug::GUI] << "resize panel to " + << e->size().width() << "," << e->size().height() << endl; int maxcol = e->size().width() / button_size; if (!layout_->isEmpty() && maxcol == maxcol_) return; - lyxerr << "doing layout !" << maxcol << " " << width() << endl; - lyxerr << "before is " << maxcol_ << endl; + int cols(width() / button_size); + int rows = max(buttons_.size() / cols, 1U); + if (buttons_.size() % cols) + ++rows; + + lyxerr[Debug::GUI] << "Laying out " << buttons_.size() << " widgets in a " + << cols << "x" << rows << " grid." << endl; setUpdatesEnabled(false); @@ -84,24 +92,21 @@ void IconPalette::resizeEvent(QResizeEvent * e) vector