Presentation problems with long expressions
Originally reported on Google Code with ID 4
From: Achim Bohnet
when one enters a longer than than the window width and presses
'evaluate' a scrollbar appears in the history window that is
aligned left. One has to move the scrollbar to the right so
one can see the result :(
When the next expresion is entered the scollbar jumps to the left
and one has again scroll to the right to see the result :( :(
Mow one better stops and restarts speedcrunch ;)
solutions I can imagine:
a) move the scrollbar to right instead of left after
each expression evaluation
b) Use linewrap instead of scrollbar (my favorite)
Reported by e8johan
on 2006-08-01 09:35:08
Comments (12)
-
Account Deleted -
Account Deleted ``` OK, I have implemented solution (a) for trunk, branches/0.7 and branches/0.6.
Johan, if you feel this is sufficient, then could you please close this issue? As for solution (b), I guess we can just file a new issue (Enhancement or feature wish) for that as it is rather a new feature than just a fix. ```
Reported by `ariya.hidayat` on 2006-10-08 17:22:01
-
Account Deleted Reported by `helder.pereira.correia` on 2007-05-13 11:25:57 - Status changed: `Fixed`
-
Account Deleted ``` Ariya, in trunk the scroll bar is still aligned to left. I haven't checked the branches though. ```
Reported by `helder.pereira.correia` on 2007-05-18 23:42:13 - Status changed: `Started`
-
Account Deleted Reported by `helder.pereira.correia` on 2007-05-18 23:43:10 - Labels added: Milestone-0.8
-
Account Deleted Reported by `helder.pereira.correia` on 2007-05-18 23:44:36
-
Account Deleted ``` Hmm, this fix is gone in trunk because the move to pure Qt 4 classes. I have to find another hack for this. ```
Reported by `ariya.hidayat` on 2007-06-27 08:22:29
-
Account Deleted ``` Should we move this for 0.9? ```
Reported by `helder.pereira.correia` on 2007-07-23 22:53:15
-
Account Deleted ``` Have a look at this patch:
Index: result.cpp
--- result.cpp (revision 608) +++ result.cpp (working copy) @@ -26,6 +26,7 @@
- include <QApplication>
- include <QClipboard>
- include <QResizeEvent> +#include <QScrollBar>
- include <QTimer>
class ResultPrivate @@ -196,7 +197,7 @@ new ExprItem( this, d->count, expr ); new ResultItem( this, d->count, value );
- scrollToItem( item(count()-1) ); + QTimer::singleShot(0, this, SLOT(scrollEnd())); }
void Result::appendError( const QString& expr, const QString& msg ) @@ -206,7 +207,7 @@ new ExprItem( this, d->count, expr ); new ErrorItem( this, d->count, msg );
- scrollToItem( item(count()-1) ); + QTimer::singleShot(0, this, SLOT(scrollEnd())); }
QString Result::asText() const @@ -285,6 +286,15 @@ dynamic_cast<BaseItem*>(item(c))->updateItem(); }
+void Result::scrollEnd() +{ + scrollToItem( item(count()-1) ); + + this should work even on right-to-left layout + QScrollBar* bar = horizontalScrollBar(); + bar->setValue( bar->maximum() ); +} + void Result::setCustomAppearance( bool custom ) { d->customAppearance = custom; Index: result.h
--- result.h (revision 608) +++ result.h (working copy) @@ -72,6 +72,7 @@ private slots: void copyToClipboard( QListWidgetItem* ); void triggerUpdate(); + void scrollEnd();
private: ResultPrivate* d;
```
Reported by `ariya.hidayat` on 2007-07-24 08:28:10
-
Account Deleted ``` It works, thank you! This was the oldest open issue :)
" this should work even on right-to-left layout"
Indeed, even because we don't touch the math screen for RTL.
Fixed in branches/0.8, will be merged into trunk later. ```
Reported by `helder.pereira.correia` on 2007-07-24 23:44:01 - Status changed: `Fixed`
-
repo owner -
repo owner - changed status to closed
- Log in to comment
``` For 0.7 branch, I vote for solution (a) in order not to introduce big change in the user interface.
For future version, solution (b) is also good. But we must keep in mind that sometimes (now always) it does not make sense to "word wrap" math expression. ```
Reported by `ariya.hidayat` on 2006-10-08 10:43:23 - Status changed: `Started`