1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

change ChatLine::isVisible to false, rename Text::isVisible to

Text::keepInMemory
This commit is contained in:
krepa098 2015-01-31 18:12:51 +01:00
parent 2206db1406
commit 740d62ec49
4 changed files with 5 additions and 6 deletions

View File

@ -102,7 +102,7 @@ private:
qreal width = 100.0;
qreal columnSpacing = 15.0;
QRectF bbox;
bool isVisible = true;
bool isVisible = false;
};

View File

@ -28,7 +28,6 @@ Spinner::Spinner(const QString &img, QSize Size, qreal speed)
timer.setInterval(33); // 30Hz
timer.setSingleShot(false);
timer.start();
QObject::connect(&timer, &QTimer::timeout, this, &Spinner::timeout);
}

View File

@ -174,7 +174,7 @@ void Text::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWid
void Text::visibilityChanged(bool visible)
{
isVisible = visible;
keepInMemory = visible;
regenerate();
update();
@ -250,7 +250,7 @@ void Text::regenerate()
size = idealSize();
// if we are not visible -> free mem
if(!isVisible)
if(!keepInMemory)
freeResources();
}

View File

@ -46,7 +46,7 @@ public:
virtual QRectF boundingRect() const override;
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) override;
virtual void visibilityChanged(bool isVisible) override;
virtual void visibilityChanged(bool keepInMemory) override;
virtual qreal getAscent() const override;
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event) override;
@ -73,7 +73,7 @@ private:
QString elidedText;
QString selectedText;
QSizeF size;
bool isVisible = false;
bool keepInMemory = false;
bool elide = false;
bool dirty = false;
int selectionEnd = -1;