mirror of
https://github.com/vicr123/theshell.git
synced 2025-01-23 04:11:49 -05:00
Merge branch 'blueprint' of https://github.com/vicr123/theshell into blueprint
This commit is contained in:
commit
85ebddae75
2 changed files with 24 additions and 1 deletions
|
@ -77,6 +77,28 @@ screenshotWindow::~screenshotWindow()
|
||||||
delete ui;
|
delete ui;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void screenshotWindow::keyPressEvent( QKeyEvent* event ) {
|
||||||
|
switch ( event->key() ) {
|
||||||
|
case Qt::Key_Escape:
|
||||||
|
//on ESC, close ui
|
||||||
|
on_discardButton_clicked();
|
||||||
|
break;
|
||||||
|
case Qt::Key_Enter: //We need to capture both Enter and Return since it can vary between keyboards
|
||||||
|
on_saveButton_clicked();
|
||||||
|
break;
|
||||||
|
case Qt::Key_Return:
|
||||||
|
on_saveButton_clicked();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if(Qt::Key_C && modifiers() & Qt::ControlModifier) {
|
||||||
|
on_copyButton_clicked();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
event->ignore();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void screenshotWindow::paintEvent(QPaintEvent *event) {
|
void screenshotWindow::paintEvent(QPaintEvent *event) {
|
||||||
QPainter painter(this);
|
QPainter painter(this);
|
||||||
painter.setBrush(QColor(0, 0, 0, 150));
|
painter.setBrush(QColor(0, 0, 0, 150));
|
||||||
|
|
|
@ -78,7 +78,8 @@ private:
|
||||||
QRubberBand* band;
|
QRubberBand* band;
|
||||||
QPoint bandOrigin;
|
QPoint bandOrigin;
|
||||||
QRectF originalGeometry;
|
QRectF originalGeometry;
|
||||||
|
|
||||||
|
void keyPressEvent(QKeyEvent* event);
|
||||||
void paintEvent(QPaintEvent* event);
|
void paintEvent(QPaintEvent* event);
|
||||||
bool eventFilter(QObject *object, QEvent *event);
|
bool eventFilter(QObject *object, QEvent *event);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue