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. 10
      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. We do not use event parameter. This is for compatibility.
""" """
if self.startLabel.isVisible(): #block mode if self.startLabel.isVisible(): #block mode
print (self.staticExportItem["name"], event)
listOfLabelsAndFunctions = [ listOfLabelsAndFunctions = [
(translate("musicstructures", "edit properties"), lambda: BlockPropertiesEdit(self.scene().parentView.mainWindow, staticExportItem = self.staticExportItem)), (translate("musicstructures", "edit properties"), lambda: BlockPropertiesEdit(self.scene().parentView.mainWindow, staticExportItem = self.staticExportItem)),
("separator", None), ("separator", None),

2
qtgui/scorescene.py

@ -111,8 +111,6 @@ class GuiScore(QtWidgets.QGraphicsScene):
def updateModeSingleTrackRedraw(self, nameAsString:str, trackId:int, trackExport:tuple): def updateModeSingleTrackRedraw(self, nameAsString:str, trackId:int, trackExport:tuple):
"""trackExport is a tuple of block export dicts""" """trackExport is a tuple of block export dicts"""
self.tracks[trackId].updateMode(nameAsString) 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): def maxTrackLength(self):
if self.tracks: if self.tracks:

10
qtgui/scoreview.py

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

Loading…
Cancel
Save