Skip to content

Commit

Permalink
Import fixes from main branch
Browse files Browse the repository at this point in the history
Signed-off-by: falkTX <falktx@falktx.com>
  • Loading branch information
falkTX authored and falkTX committed Aug 19, 2024
1 parent 2f5bd5c commit c16c8ed
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 8 deletions.
1 change: 1 addition & 0 deletions source/bridges-plugin/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ NATIVE_LINK_FLAGS += $(LIBLO_LIBS)
NATIVE_BUILD_FLAGS += $(FLUIDSYNTH_FLAGS)
NATIVE_LINK_FLAGS += $(FLUIDSYNTH_LIBS)

NATIVE_BUILD_FLAGS += $(MAGIC_FLAGS)
NATIVE_LINK_FLAGS += $(MAGIC_LIBS)

LIBS_native += $(MODULEDIR)/audio_decoder.a
Expand Down
11 changes: 10 additions & 1 deletion source/frontend/patchcanvas/canvasport.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,16 @@ def setPortType(self, port_type):
self.update()

def setPortName(self, port_name):
if QFontMetrics(self.m_port_font).width(port_name) < QFontMetrics(self.m_port_font).width(self.m_port_name):
metrics = QFontMetrics(self.m_port_font)

if QT_VERSION >= 0x50b00:
width1 = metrics.horizontalAdvance(port_name)
width2 = metrics.horizontalAdvance(self.m_port_name)
else:
width1 = metrics.width(port_name)
width2 = metrics.width(self.m_port_name)

if width1 < width2:
QTimer.singleShot(0, canvas.scene.update)

self.m_port_name = port_name
Expand Down
4 changes: 2 additions & 2 deletions source/frontend/widgets/canvaspreviewframe.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def mouseReleaseEvent(self, event):
if event.button() == Qt.LeftButton:
event.accept()
self.fMouseLeftDown = False
self._updateMouseMode()
self._updateMouseMode(event)
return
if event.button() == Qt.RightButton:
event.accept()
Expand Down Expand Up @@ -386,7 +386,7 @@ def _scaleViewRect(self, globalY: int):

self.cursor().setPos(self.fMouseInitialZoomPos)

def _updateMouseMode(self, event = None):
def _updateMouseMode(self, event):
if self.fMouseLeftDown and self.fMouseRightDown:
self.fMouseInitialZoomPos = event.globalPos()
self.setCursor(self.fZoomCursors[self._kCursorZoom])
Expand Down
5 changes: 3 additions & 2 deletions source/frontend/widgets/pixmapdial.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ def updateSizes(self):
self.fLabelWidth = 0
return

self.fLabelWidth = QFontMetrics(self.fLabelFont).width(self.fLabel)
self.fLabelHeight = QFontMetrics(self.fLabelFont).height()
metrics = QFontMetrics(self.fLabelFont)
self.fLabelWidth = fontMetricsHorizontalAdvance(metrics, self.fLabel)
self.fLabelHeight = metrics.height()

self.fLabelPos.setX(float(self.fPixmapBaseSize)/2.0 - float(self.fLabelWidth)/2.0)

Expand Down
6 changes: 3 additions & 3 deletions source/frontend/widgets/scalabledial.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,9 @@ def updateSizes(self):
self.fLabelWidth = 0
return

self.fLabelWidth = QFontMetrics(self.fLabelFont).width(self.fLabel)
self.fLabelHeight = QFontMetrics(self.fLabelFont).height()
metrics = QFontMetrics(self.fLabelFont)
self.fLabelWidth = fontMetricsHorizontalAdvance(metrics, self.fLabel)
self.fLabelHeight = metrics.height()

self.fLabelPos.setX(float(self.fImageBaseSize)/2.0 - float(self.fLabelWidth)/2.0)

Expand Down Expand Up @@ -281,7 +282,6 @@ def paintDial(self, painter):

# Custom knobs
else:
painter.restore()
return

if self.HOVER_MIN < self.fHoverStep < self.HOVER_MAX:
Expand Down

0 comments on commit c16c8ed

Please sign in to comment.