diff options
Diffstat (limited to 'src-qt5')
-rw-r--r-- | src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp | 11 | ||||
-rw-r--r-- | src-qt5/desktop-utils/lumina-screenshot/MainUI.h | 2 |
2 files changed, 12 insertions, 1 deletions
diff --git a/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp b/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp index 9dd6c9d3..ac17ee3e 100644 --- a/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp @@ -26,6 +26,9 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ ui->spin_monitor->setEnabled(false); ui->radio_monitor->setEnabled(false); } + scaleTimer = new QTimer(this); + scaleTimer->setSingleShot(true); + scaleTimer->setInterval(200); //~1/5 second //Setup the connections connect(ui->tool_save, SIGNAL(clicked()), this, SLOT(saveScreenshot()) ); @@ -38,7 +41,8 @@ MainUI::MainUI() : QMainWindow(), ui(new Ui::MainUI){ connect(ui->tool_crop, SIGNAL(clicked()), IMG, SLOT(cropImage()) ); connect(IMG, SIGNAL(selectionChanged(bool)), this, SLOT(imgselchanged(bool)) ); connect(IMG, SIGNAL(scaleFactorChanged(int)), this, SLOT(imgScalingChanged(int)) ); - connect(ui->slider_zoom, SIGNAL(valueChanged(int)), this, SLOT(imgScalingChanged()) ); + connect(ui->slider_zoom, SIGNAL(valueChanged(int)), this, SLOT(sliderChanged()) ); + connect(scaleTimer, SIGNAL(timeout()), this, SLOT(imgScalingChanged()) ); settings = new QSettings("lumina-desktop", "lumina-screenshot",this); if(settings->value("screenshot-target", "window").toString() == "window") { @@ -130,6 +134,11 @@ void MainUI::imgScalingChanged(int percent){ ui->label_zoom_percent->setText( QString::number(ui->slider_zoom->value())+"%"); } +void MainUI::sliderChanged(){ + ui->label_zoom_percent->setText( QString::number(ui->slider_zoom->value())+"%"); + scaleTimer->start(); +} + bool MainUI::getWindow(){ //Use this function to set cwin cwin = 0; diff --git a/src-qt5/desktop-utils/lumina-screenshot/MainUI.h b/src-qt5/desktop-utils/lumina-screenshot/MainUI.h index f7319541..bb1b61df 100644 --- a/src-qt5/desktop-utils/lumina-screenshot/MainUI.h +++ b/src-qt5/desktop-utils/lumina-screenshot/MainUI.h @@ -46,6 +46,7 @@ private: WId cwin; //current window to screenshot QSettings *settings; LXCB *XCB; //Library access to window subsystems + QTimer *scaleTimer; //Image Editor widget ImageEditor *IMG; @@ -65,6 +66,7 @@ private slots: void imgselchanged(bool hassel); void imgScalingChanged(int percent = -1); + void sliderChanged(); //Utility functions to perform a screenshot bool getWindow(); //set the "cwin" variable as appropriate |