Implement selectAll and keyboard shortcut (#1106)
This commit is contained in:
@@ -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()));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user