Browse Source

ChatLine: cell spacing

pull/974/head
krepa098 11 years ago
parent
commit
d04a79a599
  1. 7
      src/chatlog/chatline.cpp

7
src/chatlog/chatline.cpp

@ -22,6 +22,8 @@
#include <QDebug> #include <QDebug>
#include <QGraphicsScene> #include <QGraphicsScene>
#define CELL_SPACING 15
ChatLine::ChatLine(QGraphicsScene* grScene) ChatLine::ChatLine(QGraphicsScene* grScene)
: scene(grScene) : scene(grScene)
{ {
@ -148,7 +150,7 @@ void ChatLine::layout(qreal w, QPointF scenePos)
width = w; width = w;
pos = scenePos; pos = scenePos;
qreal fixedWidth = 0.0; qreal fixedWidth = (content.size()-1) * CELL_SPACING;
qreal varWidth = 0.0; // used for normalisation qreal varWidth = 0.0; // used for normalisation
for(int i = 0; i < format.size(); ++i) for(int i = 0; i < format.size(); ++i)
@ -183,6 +185,7 @@ void ChatLine::layout(qreal w, QPointF scenePos)
// calculate horizontal alignment // calculate horizontal alignment
qreal xAlign = 0.0; qreal xAlign = 0.0;
switch(format[i].hAlign) switch(format[i].hAlign)
{ {
case ColumnFormat::Right: case ColumnFormat::Right:
@ -198,7 +201,7 @@ void ChatLine::layout(qreal w, QPointF scenePos)
// reposition // reposition
content[i]->setPos(pos.x() + xOffset + xAlign, pos.y()); content[i]->setPos(pos.x() + xOffset + xAlign, pos.y());
xOffset += width; xOffset += width + CELL_SPACING;
} }
for(int i = 0; i < content.size(); ++i) for(int i = 0; i < content.size(); ++i)

Loading…
Cancel
Save