From 869247b6179cd820840153b41028e66a123a210f Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Mon, 21 Nov 2022 18:56:28 +0100 Subject: [PATCH] Add button to stop processing (rather than having it stop by clicking on the spinner) --- lib/Makefile.am | 1 + lib/images/process-stop.svgz | Bin 0 -> 1255 bytes src/frontends/qt/GuiView.cpp | 23 ++++++++++++++++------- 3 files changed, 17 insertions(+), 7 deletions(-) create mode 100644 lib/images/process-stop.svgz diff --git a/lib/Makefile.am b/lib/Makefile.am index bff08ade78..81cf05ee2b 100644 --- a/lib/Makefile.am +++ b/lib/Makefile.am @@ -661,6 +661,7 @@ dist_images_DATA1X = \ images/outline-out+rtl.svgz \ images/outline-up.svgz \ images/paste.svgz \ + images/process-stop.svgz \ images/redo.svgz \ images/reload.svgz \ images/search-case-sensitive.svgz \ diff --git a/lib/images/process-stop.svgz b/lib/images/process-stop.svgz new file mode 100644 index 0000000000000000000000000000000000000000..013e4a4721ba69bf418e2c7534df4fceb347f146 GIT binary patch literal 1255 zcmV3 zP9XX9+Y;E=;E+t1sWnv~b+=mjzV4P}#@{xN8G4D!DlPI!KrsnWoX?9znlC58-S!*N#ula87d23W8FjXrQn-*;+fb~fNtv`)vPKAI09CTBoQ29~1F!j~MXil=Cv*023#G;`Un z!;XJ3YX zS7*zxB)lU7OQA8>fiD1hu8Q}-KLK&pgShHJWE@*7t&u&50#0F}4evu_1XCh8*FBJ2V{o859{v}Q^B%~o z50YZt2gn5GgfZCv{9+e!88o>D&)n&T5qKLo;ODmax1{K(7`8!a@J=70<)Q1uDxcPyw^o7}%B}1c= zq0uKp9a4pjlFUNLflK#XqiP;y@fF3&a%+AEB}tEx`yM5<7eB`bC0HrNh3FCj)o{Q@ ze_%2=@cncUm`Y)lPYRByHJYJNGHisD9LRy~l2}H6j*aoi-G_baDXLf7p-Gx$U|(ie zm&?YTlZEAT1}_HjOPm*rrc{8QzXfrriF{&5z6OwmEm^v(MKt6T`{tnnZ53}jPt8HJ zKWf|C1y-CWLk({f@Wzp3#d;FFq*Xf0nhdV$SGU5)sCX*h+iS%)(;OUb>-)9I`57kCx!`De)H7w7$q}SYo^&DN_7(D!>7~Sn`Z|Z z;jS0+=xGv^#dE$m*4-CrKB(NK5?rC&BTYY(w1NZyG6`%Z?t17>%B?KZSaL}~*)*o! zfLUy~=1gV+%HEIOHB@UE?izauY9)3003K!QfontMetrics()); + int const iconheight = max(int(d.normalIconSize), fm.height()); + QSize const iconsize(iconheight, iconheight); + // add busy indicator to statusbar search_mode mode = theGuiApp()->imageSearchMode(); QString fn = toqstr(lyx::libFileSearch("images", "busy", "svgz", mode).absFileName()); @@ -641,12 +645,23 @@ GuiView::GuiView(int id) // make busy indicator square with 5px margins busySVG->setMaximumSize(busySVG->height() - 5, busySVG->height() - 5); busySVG->hide(); + // Add cancel button + QPixmap ps = QIcon(getPixmap("images/", "process-stop", "svgz")).pixmap(iconsize); + GuiClickableLabel * processStop = new GuiClickableLabel(statusBar()); + processStop->setPixmap(ps); + processStop->setToolTip(qt_("Click here to stop export/output process")); + processStop->hide(); + statusBar()->addPermanentWidget(processStop); connect(&d.processing_thread_watcher_, SIGNAL(started()), busySVG, SLOT(show())); connect(&d.processing_thread_watcher_, SIGNAL(finished()), busySVG, SLOT(hide())); - connect(busySVG, SIGNAL(pressed()), this, SLOT(checkCancelBackground())); + connect(&d.processing_thread_watcher_, SIGNAL(started()), + processStop, SLOT(show())); + connect(&d.processing_thread_watcher_, SIGNAL(finished()), + processStop, SLOT(hide())); + connect(processStop, SIGNAL(pressed()), this, SLOT(checkCancelBackground())); stat_counts_ = new GuiClickableLabel(statusBar()); stat_counts_->setAlignment(Qt::AlignCenter); @@ -656,9 +671,6 @@ GuiView::GuiView(int id) connect(stat_counts_, SIGNAL(clicked()), this, SLOT(statsPressed())); - - QFontMetrics const fm(statusBar()->fontMetrics()); - zoom_slider_ = new QSlider(Qt::Horizontal, statusBar()); // Small size slider for macOS to prevent the status bar from enlarging zoom_slider_->setAttribute(Qt::WA_MacSmallSize); @@ -730,9 +742,6 @@ GuiView::GuiView(int id) // enable pinch to zoom grabGesture(Qt::PinchGesture); - int const iconheight = max(int(d.normalIconSize), fm.height()); - QSize const iconsize(iconheight, iconheight); - QPixmap shellescape = QIcon(getPixmap("images/", "emblem-shellescape", "svgz,png")).pixmap(iconsize); shell_escape_ = new QLabel(statusBar()); shell_escape_->setPixmap(shellescape); -- 2.39.5