Browse Source

Adjust GUI group rectangle after number of measures changed

master
Nils 2 years ago
parent
commit
dc62913e38
  1. 3
      engine/api.py
  2. 7
      qtgui/songeditor.py

3
engine/api.py

@ -215,6 +215,8 @@ class ClientCallbacks(Callbacks): #inherits from the templates api callbacks
callbacks._dataChanged()
def _numberOfMeasuresChanged(self):
"""The whole song got longer or shorter.
Number of measures is the same for all tracks."""
export = session.data.export()
for func in self.numberOfMeasuresChanged:
func(export)
@ -228,6 +230,7 @@ class ClientCallbacks(Callbacks): #inherits from the templates api callbacks
callbacks._dataChanged()
def _swingChanged(self):
"""Global for the whole song"""
export = session.data.swing
for func in self.swingChanged:
func(export)

7
qtgui/songeditor.py

@ -196,6 +196,13 @@ class SongEditor(QtWidgets.QGraphicsScene):
for l in self.barlines[requestAmountOfMeasures:]:
l.hide()
#Adjust Group Header Rectangles
for groupRect in self._groupRectangles:
r = groupRect.rect()
r.setWidth((requestAmountOfMeasures-1) * SIZE_UNIT)
groupRect.setRect(r)
#Guaranteed visible.
for l in self.barlines[:requestAmountOfMeasures]:
l.show()

Loading…
Cancel
Save