Compare commits

...

2 Commits

Author SHA1 Message Date
MaurycyLiebner
b240c39cb2
Merge pull request #258 from AlexKiryanov/AlexKiryanov-branch
Add and change Hot Keys. Closes #254.
2021-06-14 19:08:38 +02:00
AlexKiryanov
4a62db771a
Add and change Hot Keys
Add Hot Key to Brush tool (B)
Add Hot Key to Erase tool (E)
Change Hot Key to Brush Dock (Ctrl + B)
Change Hot Key to Fill and Stroke Dock (Ctrl + E)
2021-06-14 18:04:56 +03:00
3 changed files with 8 additions and 4 deletions

View File

@ -537,6 +537,10 @@ bool CanvasWindow::KFT_keyPressEvent(QKeyEvent *event) {
if(canvasMode == CanvasMode::paint) mDocument.incBrushRadius();
} else if(e.fKey == Qt::Key_Q) {
if(canvasMode == CanvasMode::paint) mDocument.decBrushRadius();
} else if(e.fKey == Qt::Key_E) {
if(canvasMode == CanvasMode::paint) mDocument.setPaintMode(PaintMode::erase);
} else if(e.fKey == Qt::Key_B) {
if(canvasMode == CanvasMode::paint) mDocument.setPaintMode(PaintMode::normal);
} else if((e.fKey == Qt::Key_Enter || e.fKey == Qt::Key_Return) &&
canvasMode == CanvasMode::drawPath) {
const bool manual = mDocument.fDrawPathManual;

View File

@ -785,7 +785,7 @@ void MainWindow::setupMenuBar() {
tr("Fill and Stroke", "MenuBar_View_Docks"));
mFillAndStrokeDockAct->setCheckable(true);
mFillAndStrokeDockAct->setChecked(true);
mFillAndStrokeDockAct->setShortcut(QKeySequence(Qt::Key_E));
mFillAndStrokeDockAct->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_E));
connect(mFillStrokeSettingsDock, &CloseSignalingDockWidget::madeVisible,
mFillAndStrokeDockAct, &QAction::setChecked);
@ -796,7 +796,7 @@ void MainWindow::setupMenuBar() {
tr("Paint Brush", "MenuBar_View_Docks"));
mBrushDockAction->setCheckable(true);
mBrushDockAction->setChecked(false);
mBrushDockAction->setShortcut(QKeySequence(Qt::Key_B));
mBrushDockAction->setShortcut(QKeySequence(Qt::CTRL + Qt::Key_B));
connect(mBrushSettingsDock, &CloseSignalingDockWidget::madeVisible,
mBrushDockAction, &QAction::setChecked);

View File

@ -188,7 +188,7 @@ TimelineDockWidget::TimelineDockWidget(Document& document,
mPaintNormalMode = SwitchButton::sCreate2Switch(
"toolbarButtons/paintChecked.png",
"toolbarButtons/paintUnchecked.png",
gSingleLineTooltip("Paint"), this);
gSingleLineTooltip("Paint", "B"), this);
connect(mPaintNormalMode, &SwitchButton::toggled,
this, [this](const int state) {
if(state == 0) {
@ -199,7 +199,7 @@ TimelineDockWidget::TimelineDockWidget(Document& document,
mPaintEraseMode = SwitchButton::sCreate2Switch(
"toolbarButtons/eraseChecked.png",
"toolbarButtons/eraseUnchecked.png",
gSingleLineTooltip("Erase"), this);
gSingleLineTooltip("Erase", "E"), this);
mPaintEraseMode->setState(1);
connect(mPaintEraseMode, &SwitchButton::toggled,
this, [this](const int state) {