Browse Source

auto shrink x factor in block mode

master
Nils 2 years ago
parent
commit
26b84ce19a
  1. 10
      qtgui/scorescene.py
  2. 12
      qtgui/scoreview.py

10
qtgui/scorescene.py

@ -111,8 +111,8 @@ class GuiScore(QtWidgets.QGraphicsScene):
def updateModeSingleTrackRedraw(self, nameAsString:str, trackId:int, trackExport:tuple):
"""trackExport is a tuple of block export dicts"""
self.tracks[trackId].updateMode(nameAsString)
#if nameAsString == "block":
# self.tracks[trackId].stretchXCoordinates(0.25) #go into small scaling mode. 0.25 is hardcoded and the same as scoreView.updateMode
if nameAsString == "block":
self.tracks[trackId].stretchXCoordinates(0.25) #go into small scaling mode. 0.25 is hardcoded and the same as scoreView.updateMode
def maxTrackLength(self):
if self.tracks:
@ -403,6 +403,12 @@ class GuiScore(QtWidgets.QGraphicsScene):
block.mousePressEventCustom(event)
event.accept() #eat it
return
else: #CC mode but no modifiers
#implicit qt scene click detection was unreliable. In the end the manual route was the best option:
block = self.blockAt(event.scenePos())
if block and type(block) is CCGraphTransparentBlock:
block.parentCCPath.mousePressEventToAdd(event)
return
super().mousePressEvent(event)

12
qtgui/scoreview.py

@ -200,8 +200,8 @@ class ScoreView(QtWidgets.QGraphicsView):
if self.mainWindow.ui.actionCC_Mode.isChecked():
#if calledByMenu and self._lastSavedMode == "block":
# self.stretchXCoordinates(4.0) #return from half sized mode. If we do not come from block mode this is not needed. CC and Note mode have the same scaling
if calledByMenu and self._lastSavedMode == "block":
self.stretchXCoordinates(4.0) #return from half sized mode. If we do not come from block mode this is not needed. CC and Note mode have the same scaling
self.mainWindow.menuActionDatabase.ccEditMode()
self.mainWindow.menuActionDatabase.writeProtection(True)
@ -209,8 +209,8 @@ class ScoreView(QtWidgets.QGraphicsView):
self.mainWindow.menuActionDatabase.loadToolbarContext("cc")
elif self.mainWindow.ui.actionNotation_Mode.isChecked():
#if calledByMenu and self._lastSavedMode == "block":
# self.stretchXCoordinates(4.0) #return from half sized mode. If we do not come from block mode this is not needed. CC and Note mode have the same scaling
if calledByMenu and self._lastSavedMode == "block":
self.stretchXCoordinates(4.0) #return from half sized mode. If we do not come from block mode this is not needed. CC and Note mode have the same scaling
self.mainWindow.menuActionDatabase.noteEditMode()
self.mainWindow.menuActionDatabase.writeProtection(False)
@ -219,8 +219,8 @@ class ScoreView(QtWidgets.QGraphicsView):
elif self.mainWindow.ui.actionBlock_Mode.isChecked():
assert calledByMenu, "We currently assume that only the program start calls this function not via the menu, and that chooses notation mode"
#if not self._lastSavedMode == "block": #check that we don't go from block mode to block mode again, since XScaling is cumulative
# self.stretchXCoordinates(0.25) #go into small scaling mode. 0.25 is hardcoded and the same as scene.updateModeSingleTrackRedraw
if not self._lastSavedMode == "block": #check that we don't go from block mode to block mode again, since XScaling is cumulative
self.stretchXCoordinates(0.25) #go into small scaling mode. 0.25 is hardcoded and the same as scene.updateModeSingleTrackRedraw
self.mainWindow.menuActionDatabase.noteEditMode()
self.mainWindow.menuActionDatabase.writeProtection(True)
self.scoreScene.updateMode("block")

Loading…
Cancel
Save