Browse Source

remove auto adjust of block sizes. that was a silly idea

master
Nils 2 years ago
parent
commit
a685fe7ad4
  1. 2
      qtgui/musicstructures.py
  2. 2
      qtgui/scorescene.py
  3. 8
      qtgui/scoreview.py

2
qtgui/musicstructures.py

@ -143,6 +143,8 @@ class GuiBlockHandle(QtWidgets.QGraphicsRectItem):
We do not use event parameter. This is for compatibility.
"""
if self.startLabel.isVisible(): #block mode
print (self.staticExportItem["name"], event)
listOfLabelsAndFunctions = [
(translate("musicstructures", "edit properties"), lambda: BlockPropertiesEdit(self.scene().parentView.mainWindow, staticExportItem = self.staticExportItem)),
("separator", None),

2
qtgui/scorescene.py

@ -111,8 +111,6 @@ 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
def maxTrackLength(self):
if self.tracks:

8
qtgui/scoreview.py

@ -108,6 +108,7 @@ class ScoreView(QtWidgets.QGraphicsView):
def stretchXCoordinates(self, factor):
"""Cumulative factor, multiplication"""
self.scoreScene.stretchXCoordinates(factor)
if not self.mode() == "block":
self.centerOnCursor(None)
def zoom(self, scaleFactor:float):
@ -200,17 +201,12 @@ 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
self.mainWindow.menuActionDatabase.ccEditMode()
self.mainWindow.menuActionDatabase.writeProtection(True)
self.scoreScene.updateMode("cc")
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
self.mainWindow.menuActionDatabase.noteEditMode()
self.mainWindow.menuActionDatabase.writeProtection(False)
@ -219,8 +215,6 @@ 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
self.mainWindow.menuActionDatabase.noteEditMode()
self.mainWindow.menuActionDatabase.writeProtection(True)
self.scoreScene.updateMode("block")

Loading…
Cancel
Save