Browse Source

midipattern: use Esc key to close UI

Signed-off-by: falkTX <falktx@falktx.com>
tags/v2.3.0
falkTX 3 years ago
parent
commit
a17f139321
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
2 changed files with 9 additions and 2 deletions
  1. +4
    -1
      resources/ui/midipattern.ui
  2. +5
    -1
      source/frontend/widgets/pianoroll.py

+ 4
- 1
resources/ui/midipattern.ui View File

@@ -403,7 +403,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>755</width> <width>755</width>
<height>20</height>
<height>23</height>
</rect> </rect>
</property> </property>
<widget class="QMenu" name="menu_File"> <widget class="QMenu" name="menu_File">
@@ -428,6 +428,9 @@
<property name="text"> <property name="text">
<string>&amp;Quit</string> <string>&amp;Quit</string>
</property> </property>
<property name="shortcut">
<string>Esc</string>
</property>
</action> </action>
<action name="act_edit_insert"> <action name="act_edit_insert">
<property name="checkable"> <property name="checkable">


+ 5
- 1
source/frontend/widgets/pianoroll.py View File

@@ -24,7 +24,7 @@ from PyQt5.QtCore import Qt, QRectF, QPointF, pyqtSignal
from PyQt5.QtGui import QColor, QCursor, QFont, QPen, QPainter, QTransform from PyQt5.QtGui import QColor, QCursor, QFont, QPen, QPainter, QTransform
from PyQt5.QtWidgets import QGraphicsItem, QGraphicsLineItem, QGraphicsOpacityEffect, QGraphicsRectItem, QGraphicsSimpleTextItem from PyQt5.QtWidgets import QGraphicsItem, QGraphicsLineItem, QGraphicsOpacityEffect, QGraphicsRectItem, QGraphicsSimpleTextItem
from PyQt5.QtWidgets import QGraphicsScene, QGraphicsView from PyQt5.QtWidgets import QGraphicsScene, QGraphicsView
from PyQt5.QtWidgets import QWidget, QLabel, QComboBox, QHBoxLayout, QVBoxLayout, QStyle
from PyQt5.QtWidgets import QApplication, QComboBox, QHBoxLayout, QLabel, QStyle, QVBoxLayout, QWidget


# ------------------------------------------------------------------------------------------------------------ # ------------------------------------------------------------------------------------------------------------
# Imports (Custom) # Imports (Custom)
@@ -474,6 +474,10 @@ class PianoRoll(QGraphicsScene):
def keyPressEvent(self, event): def keyPressEvent(self, event):
QGraphicsScene.keyPressEvent(self, event) QGraphicsScene.keyPressEvent(self, event)


if event.key() == Qt.Key_Escape:
QApplication.instance().closeAllWindows()
return

if event.key() == Qt.Key_F: if event.key() == Qt.Key_F:
if not self.insert_mode: if not self.insert_mode:
# turn off velocity mode # turn off velocity mode


Loading…
Cancel
Save