projects
/
quassel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
209c692
)
More wordwrap fixes.
author
Manuel Nickschas
<sputnick@quassel-irc.org>
Thu, 19 Jun 2008 10:35:33 +0000
(12:35 +0200)
committer
Manuel Nickschas
<sputnick@quassel-irc.org>
Sat, 2 Aug 2008 13:17:09 +0000
(15:17 +0200)
src/qtui/chatitem.cpp
patch
|
blob
|
history
diff --git
a/src/qtui/chatitem.cpp
b/src/qtui/chatitem.cpp
index
ff81259
..
c9724e2
100644
(file)
--- a/
src/qtui/chatitem.cpp
+++ b/
src/qtui/chatitem.cpp
@@
-76,8
+76,9
@@
int ChatItem::heightForWidth(int width) {
// and also apply formats in this step...)
// Just using width should be a good estimate, but since a character can't be split in the middle, we
// subtract averageCharWidth as well... sometimes this won't be enough, but meh.
// and also apply formats in this step...)
// Just using width should be a good estimate, but since a character can't be split in the middle, we
// subtract averageCharWidth as well... sometimes this won't be enough, but meh.
- w -= width -
4*
fontMetrics()->averageCharWidth();
+ w -= width - fontMetrics()->averageCharWidth();
}
}
+ w += wrapList.at(i).trailing;
}
return _lines * fontMetrics()->lineSpacing();
}
}
return _lines * fontMetrics()->lineSpacing();
}
@@
-126,7
+127,6
@@
void ChatItem::updateLayout() {
line.setLineWidth(width());
word.width -= line.naturalTextWidth();
word.start = line.textStart() + line.textLength();
line.setLineWidth(width());
word.width -= line.naturalTextWidth();
word.start = line.textStart() + line.textLength();
- //qDebug() << "setting width: " << width();
} else {
int w = 0;
while((w += word.width) <= width() && wordidx < wrapList.count()) {
} else {
int w = 0;
while((w += word.width) <= width() && wordidx < wrapList.count()) {
@@
-136,7
+136,7
@@
void ChatItem::updateLayout() {
// last word (and it fits), but if we expected an extra line, wrap anyway here
// yeah, this is cheating, but much cheaper than computing widths ourself
if(_layout->lineCount() < _lines) {
// last word (and it fits), but if we expected an extra line, wrap anyway here
// yeah, this is cheating, but much cheaper than computing widths ourself
if(_layout->lineCount() < _lines) {
- wordidx--;
qDebug() << "trigger!" << _lines << _layout->text();
+ wordidx--;
break;
}
}
break;
}
}