diff --git a/src/utils/configshortcuts.cpp b/src/utils/configshortcuts.cpp index d01d6a48..5736bdb7 100644 --- a/src/utils/configshortcuts.cpp +++ b/src/utils/configshortcuts.cpp @@ -39,6 +39,10 @@ const QVector& ConfigShortcuts::captureShortcutsDefault( << QObject::tr("Resize selection down 1px") << QKeySequence(Qt::SHIFT + Qt::Key_Down).toString()); + m_shortcuts << (QStringList() + << "TYPE_SELECT_ALL" << QObject::tr("Select entire screen") + << QKeySequence(Qt::CTRL + Qt::Key_A).toString()); + m_shortcuts << (QStringList() << "TYPE_MOVE_LEFT" << QObject::tr("Move selection left 1px") << QKeySequence(Qt::Key_Left).toString()); diff --git a/src/widgets/capture/capturewidget.cpp b/src/widgets/capture/capturewidget.cpp index 6475a279..a811f05a 100644 --- a/src/widgets/capture/capturewidget.cpp +++ b/src/widgets/capture/capturewidget.cpp @@ -1036,6 +1036,19 @@ void CaptureWidget::resizeDown() adjustSelection(QMargins(0, 0, 0, 1)); } +void CaptureWidget::selectAll() +{ + QRect newGeometry = rect(); + m_selection->setGeometry(newGeometry); + m_context.selection = extendedRect(&newGeometry); + m_selection->setVisible(true); + m_showInitialMsg = false; + m_buttonHandler->updatePosition(m_selection->geometry()); + updateSizeIndicator(); + m_buttonHandler->show(); + update(); +} + void CaptureWidget::initShortcuts() { QString shortcut = ConfigHandler().shortcut( @@ -1097,6 +1110,10 @@ void CaptureWidget::initShortcuts() this, SLOT(commitCurrentTool())); + new QShortcut(QKeySequence(ConfigHandler().shortcut("TYPE_SELECT_ALL")), + this, + SLOT(selectAll())); + new QShortcut(Qt::Key_Escape, this, SLOT(deleteToolwidgetOrClose())); } diff --git a/src/widgets/capture/capturewidget.h b/src/widgets/capture/capturewidget.h index c0f406b5..735f7769 100644 --- a/src/widgets/capture/capturewidget.h +++ b/src/widgets/capture/capturewidget.h @@ -83,6 +83,8 @@ private slots: void childEnter(); void childLeave(); + void selectAll(); + void resizeLeft(); void resizeRight(); void resizeUp();