feat: shortcuts for zoom in and out
This also fix maximize shortcut on Windows.
This commit is contained in:
parent
858c9e0ccf
commit
50170eb4aa
|
@ -57,10 +57,11 @@ void ActionManager::retranslateUi(MainWindow *mainWindow)
|
||||||
|
|
||||||
void ActionManager::setupShortcuts()
|
void ActionManager::setupShortcuts()
|
||||||
{
|
{
|
||||||
|
actionZoomIn->setShortcut(QKeySequence(QKeySequence::ZoomIn));
|
||||||
|
actionZoomOut->setShortcut(QKeySequence(QKeySequence::ZoomOut));
|
||||||
actionQuitApp->setShortcuts({
|
actionQuitApp->setShortcuts({
|
||||||
QKeySequence(Qt::Key_Space),
|
QKeySequence(Qt::Key_Space),
|
||||||
QKeySequence(Qt::Key_Escape)
|
QKeySequence(Qt::Key_Escape)
|
||||||
});
|
});
|
||||||
actionQuitApp->setShortcutContext(Qt::ApplicationShortcut);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,10 @@ FramelessWindow::FramelessWindow(QWidget *parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, m_centralLayout(new QVBoxLayout(this))
|
, m_centralLayout(new QVBoxLayout(this))
|
||||||
{
|
{
|
||||||
this->setWindowFlags(Qt::Window | Qt::FramelessWindowHint | Qt::WindowMinimizeButtonHint);
|
// A frameless window has the Qt::WindowTitleHint flag seems wrong,
|
||||||
|
// but it's a workaround of the following bug (also see the focused comment):
|
||||||
|
// https://bugreports.qt.io/browse/QTBUG-8361?focusedCommentId=542002#comment-542002
|
||||||
|
this->setWindowFlags(Qt::Window | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::FramelessWindowHint);
|
||||||
|
|
||||||
m_centralLayout->setMargin(0);
|
m_centralLayout->setMargin(0);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user