From 319036d197f189d87bf174558d47e6817da86657 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Tue, 12 Apr 2011 22:38:32 +0000 Subject: [PATCH] [GB.QT4] * BUG: TextLabel with AutoResize set takes the WordWrap property into account correctly now. git-svn-id: svn://localhost/gambas/trunk@3759 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- TODO | 4 ++++ gb.qt4/src/CLabel.cpp | 27 +++++++++++++++++---------- gb.qt4/src/ext/gview.cpp | 2 +- 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/TODO b/TODO index 147b14c90..b15a2702b 100644 --- a/TODO +++ b/TODO @@ -27,6 +27,10 @@ INTERPRETER - select() system call can fail if a watched file descriptor is in error. But how can I know the offending file descritor? Maybe by using poll() instead. +DEBUGGER + +- Add/Remove a breakpoint without pausing the program! + DEVELOPMENT ENVIRONMENT - Bookmarks in editor. diff --git a/gb.qt4/src/CLabel.cpp b/gb.qt4/src/CLabel.cpp index 667977e3b..1330bf9c6 100644 --- a/gb.qt4/src/CLabel.cpp +++ b/gb.qt4/src/CLabel.cpp @@ -265,23 +265,30 @@ void MyLabel::calcMinimumHeight(bool adjust) doc.setDocumentMargin(0); doc.setHtml(text()); - w = width() - f * 2; - - if (adjust) + if (wordWrap()) { - //doc.adjustSize(); + w = width() - f * 2; doc.setTextWidth(w); - nw = doc.idealWidth(); - doc.setTextWidth(nw); - nh = doc.size().height(); // Why (- 6) ? Don't know... - nw = doc.size().width(); + if (adjust) + { + //doc.adjustSize(); + nw = doc.idealWidth(); + doc.setTextWidth(nw); + nh = doc.size().height(); // Why (- 6) ? Don't know... + nw = doc.size().width(); + + } + else + { + nh = doc.size().height(); // Why (- 6) ? Don't know... + nw = w; + } } else { - doc.setTextWidth(w); nh = doc.size().height(); // Why (- 6) ? Don't know... - nw = w; + nw = doc.size().width(); } } else diff --git a/gb.qt4/src/ext/gview.cpp b/gb.qt4/src/ext/gview.cpp index 4b08d796f..a56220f43 100644 --- a/gb.qt4/src/ext/gview.cpp +++ b/gb.qt4/src/ext/gview.cpp @@ -129,7 +129,7 @@ GEditor::GEditor(QWidget *parent) setKeyCompression(true); setFocusPolicy(Qt::WheelFocus); setAttribute(Qt::WA_InputMethodEnabled, true); - //setAttribute(Qt::WA_StaticContents, true); + setAttribute(Qt::WA_StaticContents, true); setMouseTracking(true); viewport()->setMouseTracking(true);