diff --git a/lib/Makefile.am b/lib/Makefile.am index 71cebde77e..61d6f1abce 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -564,7 +564,7 @@ dist_images_DATA1X = \ images/buffer-write-as.svgz \ images/buffer-write.svgz \ images/build-program.svgz \ - images/busy.gif \ + images/busy.svgz \ images/change-accept.svgz \ images/change-next.svgz \ images/change-reject.svgz \ diff --git a/lib/images/busy.gif b/lib/images/busy.gif deleted file mode 100644 index 5b33f7e54f..0000000000 Binary files a/lib/images/busy.gif and /dev/null differ diff --git a/lib/images/busy.svgz b/lib/images/busy.svgz new file mode 100644 index 0000000000..2a07dfa336 Binary files /dev/null and b/lib/images/busy.svgz differ diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp index 3a6a04c3bf..9f7531c1b3 100644 --- a/src/frontends/qt/GuiView.cpp +++ b/src/frontends/qt/GuiView.cpp @@ -96,7 +96,6 @@ #include #include #include -#include #include #include #include @@ -612,20 +611,19 @@ GuiView::GuiView(int id) setAcceptDrops(true); // add busy indicator to statusbar - GuiClickableLabel * busylabel = new GuiClickableLabel(statusBar()); - statusBar()->addPermanentWidget(busylabel); search_mode mode = theGuiApp()->imageSearchMode(); - QString fn = toqstr(lyx::libFileSearch("images", "busy", "gif", mode).absFileName()); - QMovie * busyanim = new QMovie(fn, QByteArray(), busylabel); - busylabel->setMovie(busyanim); - busyanim->start(); - busylabel->hide(); + QString fn = toqstr(lyx::libFileSearch("images", "busy", "svgz", mode).absFileName()); + PressableSvgWidget * busySVG = new PressableSvgWidget(fn); + statusBar()->addPermanentWidget(busySVG); + // make busy indicator square with 5px margins + busySVG->setMaximumSize(busySVG->height() - 5, busySVG->height() - 5); + busySVG->hide(); connect(&d.processing_thread_watcher_, SIGNAL(started()), - busylabel, SLOT(show())); + busySVG, SLOT(show())); connect(&d.processing_thread_watcher_, SIGNAL(finished()), - busylabel, SLOT(hide())); - connect(busylabel, SIGNAL(clicked()), this, SLOT(checkCancelBackground())); + busySVG, SLOT(hide())); + connect(busySVG, SIGNAL(pressed()), this, SLOT(checkCancelBackground())); QFontMetrics const fm(statusBar()->fontMetrics()); @@ -5130,6 +5128,14 @@ SEMenu::SEMenu(QWidget * parent) parent, SLOT(disableShellEscape())); } + +void PressableSvgWidget::mousePressEvent(QMouseEvent * event) +{ + if (event->button() == Qt::LeftButton) { + Q_EMIT pressed(); + } +} + } // namespace frontend } // namespace lyx diff --git a/src/frontends/qt/GuiView.h b/src/frontends/qt/GuiView.h index 47f5e4046e..657634c9fe 100644 --- a/src/frontends/qt/GuiView.h +++ b/src/frontends/qt/GuiView.h @@ -21,6 +21,7 @@ #include #include +#include class QCloseEvent; class QDragEnterEvent; @@ -534,6 +535,19 @@ public Q_SLOTS: void showMenu(QPoint const &) { exec(QCursor::pos()); } }; + +class PressableSvgWidget : public QSvgWidget +{ + Q_OBJECT +public: + explicit PressableSvgWidget(const QString &file, QWidget * parent = nullptr) + : QSvgWidget(file, parent) {}; +protected: + void mousePressEvent(QMouseEvent *event) override; +Q_SIGNALS: + void pressed(); +}; + } // namespace frontend } // namespace lyx