diff --git a/ui/widgets/messageline.cpp b/ui/widgets/messageline.cpp index ea07145..168e56b 100644 --- a/ui/widgets/messageline.cpp +++ b/ui/widgets/messageline.cpp @@ -19,6 +19,7 @@ #include "messageline.h" #include #include +#include const QRegExp urlReg("^(?!addStretch(); - busyLabel.setPixmap(Shared::icon("view-refresh", true).pixmap(50)); + busyScene.addItem(busyPixmap); busyLayout.addStretch(); busyLayout.addWidget(&busyLabel); busyLayout.addStretch(); + busyLabel.setMaximumSize(70, 70); + busyLabel.setMinimumSize(70, 70); + busyLabel.setSceneRect(0, 0, 70, 70); + busyLabel.setFrameStyle(0); + busyLabel.setContentsMargins(0, 0, 0, 0); + busyLabel.setInteractive(false); + busyPixmap->setTransformOriginPoint(35, 35); + busyPixmap->setTransformationMode(Qt::SmoothTransformation); + busyPixmap->setOffset(0, 0);; - busyLabel.hide(); rotation.setDuration(500); rotation.setStartValue(0.0f); rotation.setEndValue(180.0f); @@ -227,11 +238,5 @@ void MessageLine::hideBusyIndicator() void MessageLine::onAnimationValueChanged(const QVariant& value) { - QTransform r; - r.rotate(value.toReal()); - QPixmap pxm = Shared::icon("view-refresh", true).pixmap(50).transformed(r, Qt::SmoothTransformation); - int dw = pxm.width() - 50; - int dh = pxm.height() - 50; - pxm = pxm.copy(dw/2, dh/2, 50, 50); - busyLabel.setPixmap(pxm); + busyPixmap->setRotation(value.toReal()); } diff --git a/ui/widgets/messageline.h b/ui/widgets/messageline.h index 1cd294c..59f971e 100644 --- a/ui/widgets/messageline.h +++ b/ui/widgets/messageline.h @@ -25,6 +25,9 @@ #include #include #include +#include +#include +#include #include #include "../global.h" @@ -73,7 +76,9 @@ private: std::map palNames; std::deque views; bool room; - QLabel busyLabel; + QGraphicsPixmapItem* busyPixmap; + QGraphicsScene busyScene; + QGraphicsView busyLabel; QHBoxLayout busyLayout; bool busyShown; QVariantAnimation rotation;