mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-16 11:19:18 +01:00
Ctrl+W and Esc close the visualisation window
This commit is contained in:
parent
2a77a1070d
commit
93cb686f08
@ -192,6 +192,19 @@ void VisualisationContainer::contextMenuEvent(QContextMenuEvent *event) {
|
||||
ShowPopupMenu(event->pos());
|
||||
}
|
||||
|
||||
void VisualisationContainer::keyReleaseEvent(QKeyEvent *event) {
|
||||
if (event->matches(QKeySequence::Close) ||
|
||||
event->key() == Qt::Key_Escape) {
|
||||
if (isFullScreen())
|
||||
ToggleFullscreen();
|
||||
else
|
||||
hide();
|
||||
event->accept();
|
||||
}
|
||||
|
||||
QGraphicsView::keyReleaseEvent(event);
|
||||
}
|
||||
|
||||
void VisualisationContainer::ToggleFullscreen() {
|
||||
setWindowState(windowState() ^ Qt::WindowFullScreen);
|
||||
}
|
||||
|
@ -60,6 +60,7 @@ protected:
|
||||
void leaveEvent(QEvent* e);
|
||||
void mouseDoubleClickEvent(QMouseEvent* e);
|
||||
void contextMenuEvent(QContextMenuEvent *event);
|
||||
void keyReleaseEvent(QKeyEvent *event);
|
||||
|
||||
private:
|
||||
void SizeChanged();
|
||||
|
Loading…
Reference in New Issue
Block a user