Refactor the markerline into a proper QGraphicsWidget
authorManuel Nickschas <sputnick@quassel-irc.org>
Wed, 16 Jun 2010 15:21:21 +0000 (17:21 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 16 Jun 2010 16:13:51 +0000 (18:13 +0200)
commit6e73ba4a19fd92038e1ea749125767661fb34e27
tree2d7b032e980d2378249548b084e799dc48972b69
parent7ce58ac01ce9f67c13bce15ff0db7b15872a7657
Refactor the markerline into a proper QGraphicsWidget

Unitl now, ChatLines would check if they're the one supposed to display the markerline
for every paintEvent, and the one appropriate would draw it then. Besides being inefficient,
this also caused trouble with the more flexible markerline stuff introduced recently.

Now the markerline is a proper QGraphicsWidget. It can be fully styled via a brush property:

Palette {
  marker-line: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop:0 red, stop: 0.1 transparent);
}

This lets it look identical to the "old" markerline and is hence the default now. Note that the
height of the markerline object is equal to a single line of text (so this is the area you get
to play in), unless the brush is set to a solid color, in which case it's a simple line 1px wide.
This makes it look acceptable when using an older stylesheet.

This commit also fixes a crash introduced with the markerline rewrite a few weeks ago.
src/qtui/CMakeLists.txt
src/qtui/bufferwidget.cpp
src/qtui/bufferwidget.h
src/qtui/chatline.cpp
src/qtui/chatscene.cpp
src/qtui/chatscene.h
src/qtui/chatview.cpp
src/qtui/chatview.h
src/qtui/markerlineitem.cpp [new file with mode: 0644]
src/qtui/markerlineitem.h [new file with mode: 0644]