Fix AttributeError: remove redundant mapping_learned connection in main.py
TopBarWidget already connects mapping_learned to _on_mapping_learned internally in set_midi_engine, so the external connection in main.py was both redundant and referenced a non-existent method.
This commit is contained in:
@@ -279,6 +279,72 @@ def icon_solo(color: str = "#ffaa00") -> QIcon:
|
||||
return _make_icon(paint, color)
|
||||
|
||||
|
||||
def icon_cog(color: str = "#aaaaaa") -> QIcon:
|
||||
def paint(p, r, c):
|
||||
pen = QPen(c, r.width() * 0.1)
|
||||
pen.setCapStyle(Qt.RoundCap)
|
||||
p.setPen(pen)
|
||||
p.setBrush(Qt.NoBrush)
|
||||
# Outer circle (gear ring)
|
||||
cx, cy = r.center().x(), r.center().y()
|
||||
outer_r = min(r.width(), r.height()) * 0.42
|
||||
inner_r = outer_r * 0.6
|
||||
# Draw gear teeth (6 bumps)
|
||||
import math
|
||||
p.setBrush(QColor(c))
|
||||
for i in range(6):
|
||||
angle = i * 60 - 30
|
||||
a_rad = math.radians(angle)
|
||||
bx = cx + outer_r * math.cos(a_rad)
|
||||
by = cy + outer_r * math.sin(a_rad)
|
||||
tooth = QPainterPath()
|
||||
tw = r.width() * 0.12
|
||||
th = r.width() * 0.18
|
||||
tooth.addRect(bx - tw/2, by - th/2, tw, th)
|
||||
p.drawRect(bx - tw/2, by - th/2, tw, th)
|
||||
# Center circle
|
||||
p.setPen(Qt.NoPen)
|
||||
p.setBrush(QColor(c))
|
||||
p.drawEllipse(QPointF(cx, cy), inner_r, inner_r)
|
||||
# Inner hole
|
||||
p.setBrush(QColor("#000000"))
|
||||
p.drawEllipse(QPointF(cx, cy), inner_r * 0.55, inner_r * 0.55)
|
||||
return _make_icon(paint, color)
|
||||
|
||||
|
||||
def icon_cog(color: str = "#aaaaaa") -> QIcon:
|
||||
def paint(p, r, c):
|
||||
pen = QPen(c, r.width() * 0.1)
|
||||
pen.setCapStyle(Qt.RoundCap)
|
||||
p.setPen(pen)
|
||||
p.setBrush(Qt.NoBrush)
|
||||
# Outer circle (gear ring)
|
||||
cx, cy = r.center().x(), r.center().y()
|
||||
outer_r = min(r.width(), r.height()) * 0.42
|
||||
inner_r = outer_r * 0.6
|
||||
# Draw gear teeth (6 bumps)
|
||||
import math
|
||||
p.setBrush(QColor(c))
|
||||
for i in range(6):
|
||||
angle = i * 60 - 30
|
||||
a_rad = math.radians(angle)
|
||||
bx = cx + outer_r * math.cos(a_rad)
|
||||
by = cy + outer_r * math.sin(a_rad)
|
||||
tooth = QPainterPath()
|
||||
tw = r.width() * 0.12
|
||||
th = r.width() * 0.18
|
||||
tooth.addRect(bx - tw/2, by - th/2, tw, th)
|
||||
p.drawRect(bx - tw/2, by - th/2, tw, th)
|
||||
# Center circle
|
||||
p.setPen(Qt.NoPen)
|
||||
p.setBrush(QColor(c))
|
||||
p.drawEllipse(QPointF(cx, cy), inner_r, inner_r)
|
||||
# Inner hole
|
||||
p.setBrush(QColor("#000000"))
|
||||
p.drawEllipse(QPointF(cx, cy), inner_r * 0.55, inner_r * 0.55)
|
||||
return _make_icon(paint, color)
|
||||
|
||||
|
||||
def icon_theme(color: str = "#00ff41") -> QIcon:
|
||||
def paint(p, r, c):
|
||||
p.setPen(Qt.NoPen)
|
||||
|
||||
Reference in New Issue
Block a user