D17742: Clean up content rect in TerminalDisplay

Mariusz Glebocki noreply at phabricator.kde.org
Sat Mar 2 20:49:08 GMT 2019


mglb added inline comments.

INLINE COMMENTS

> sandsmark wrote in TerminalDisplay.cpp:1614
> hmm, the only difference between rect() and contentsRect() should be whether it takes into account the margins, I think? Not sure why it would impact the scrollbar.

`rect()` returns whole widget's area, including scrollbar (it is drawn inside `rect()`). `_contentRect` (now `contentsRect()`) represents the actual terminal contents (characters), so scrollbar width is added to one of the margins (see line 2248).
Both `contentsRect()` and `rect()` (and even nothing but `pe->region()`) will work, but limiting the region to `contentsRect()` cuts out not important rects where characters could not exist.

> sandsmark wrote in TerminalDisplay.cpp:2035
> yeah, I think it worked mostly by accident (I don't think many people use explicit extra margin), and I can't see why you would want to remove it twice.

It was a mistake. `_contentRect`'s margins were including possible `contentsMargins()`.

REPOSITORY
  R319 Konsole

REVISION DETAIL
  https://phabricator.kde.org/D17742

To: sandsmark, hindenburg, #konsole
Cc: mglb, konsole-devel, #konsole, gennad, maciejn, thsurrel, ngraham, maximilianocuria, hindenburg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/konsole-devel/attachments/20190302/f1107132/attachment.html>


More information about the konsole-devel mailing list