From cbbf4f13808da13c146b371d439eb760453ce6da Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Sat, 26 Jan 2019 09:29:36 -0500 Subject: Fix up the minimum size of the shortcut buttons. Also add statusbar text for copying the image to the clipboard --- src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp | 10 ++++-- src-qt5/desktop-utils/lumina-screenshot/MainUI.h | 5 +-- src-qt5/desktop-utils/lumina-screenshot/MainUI.ui | 36 ++++++++++++++++++++-- 3 files changed, 44 insertions(+), 7 deletions(-) (limited to 'src-qt5') diff --git a/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp b/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp index 97042f9c..88192943 100644 --- a/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp +++ b/src-qt5/desktop-utils/lumina-screenshot/MainUI.cpp @@ -112,6 +112,11 @@ QRect MainUI::pointsToRect(QPoint pt1, QPoint pt2){ return rec; } +void MainUI::showSBMessage(QString msg, int secs){ + //Show statusbar message (for designated time) + ui->statusBar->showMessage("----> "+msg, secs*1000); +} + //============== // PRIVATE SLOTS //============== @@ -154,10 +159,11 @@ void MainUI::quicksave(){ } void MainUI::copyToClipboard(){ - qDebug() << "Copy Image to clipboard"; + //qDebug() << "Copy Image to clipboard"; QClipboard *clipboard = QApplication::clipboard(); clipboard->setImage(IMG->image()); - qDebug() << " - Success:" << !clipboard->image().isNull(); + showSBMessage(tr("Image copied to clipboard"), 10); + //qDebug() << " - Success:" << !clipboard->image().isNull(); } void MainUI::startScreenshot(){ diff --git a/src-qt5/desktop-utils/lumina-screenshot/MainUI.h b/src-qt5/desktop-utils/lumina-screenshot/MainUI.h index cd78dc3c..5ac0eb28 100644 --- a/src-qt5/desktop-utils/lumina-screenshot/MainUI.h +++ b/src-qt5/desktop-utils/lumina-screenshot/MainUI.h @@ -61,7 +61,8 @@ private: QRect pointsToRect(QPoint pt1, QPoint pt2); - QShortcut *quitShortcut, *openShortcut; + QShortcut *quitShortcut, *openShortcut; + void showSBMessage(QString msg, int secs); private slots: //Button Slots @@ -85,7 +86,7 @@ private slots: bool getWindow(); //set the "cwin" variable as appropriate void getPixmap(); //set the "cpic" variable to the new screenshot - void quitShortcut_activated(); + void quitShortcut_activated(); protected: void mousePressEvent(QMouseEvent *ev); diff --git a/src-qt5/desktop-utils/lumina-screenshot/MainUI.ui b/src-qt5/desktop-utils/lumina-screenshot/MainUI.ui index 69045f0c..1593c6cd 100644 --- a/src-qt5/desktop-utils/lumina-screenshot/MainUI.ui +++ b/src-qt5/desktop-utils/lumina-screenshot/MainUI.ui @@ -83,6 +83,12 @@ 0 + + + 75 + 0 + + Open screenshot with an application @@ -99,6 +105,18 @@ + + + 0 + 0 + + + + + 75 + 0 + + Copy screenshot to clipboard @@ -131,6 +149,12 @@ 0 + + + 75 + 0 + + Resize screenshot to selection @@ -153,6 +177,12 @@ 0 + + + 75 + 0 + + Crop screenshot to selection @@ -254,8 +284,8 @@ 0 0 - 439 - 230 + 64 + 24 @@ -496,7 +526,7 @@ Qt::CustomContextMenu - + false -- cgit