def createTimeSignatureWidget(self): self.timeSignatureLabel = QLabel() self.timeSignature = QComboBox(editable=True) icons = {"(4/4)": symbols.icon("time_c44"), "(2/2)": symbols.icon("time_c22")} self.timeSignature.setModel(listmodel.ListModel(timeSignaturePresets, self.timeSignature, icon=icons.get)) self.timeSignature.setCompleter(None) self.timeSignatureLabel.setBuddy(self.timeSignature)
def createTimeSignatureWidget(self): self.timeSignatureLabel = QLabel() self.timeSignature = QComboBox(editable=True) icons = { '(4/4)': symbols.icon('time_c44'), '(2/2)': symbols.icon('time_c22'), } self.timeSignature.setModel(listmodel.ListModel(timeSignaturePresets, self.timeSignature, icon=icons.get)) self.timeSignature.setCompleter(None) self.timeSignatureLabel.setBuddy(self.timeSignature)
def createWidgets(self, layout): self.systemStartLabel = QLabel() self.systemStart = QComboBox() self.systemStartLabel.setBuddy(self.systemStart) self.systemStart.setModel( listmodel.ListModel( ( # L10N: Brace like a piano staff (lambda: _("Brace"), 'system_start_brace'), # L10N: Bracket like a choir staff (lambda: _("Bracket"), 'system_start_bracket'), # L10N: Square bracket like a sub-group (lambda: _("Square"), 'system_start_square'), ), self.systemStart, display=listmodel.translate_index(0), icon=lambda item: symbols.icon(item[1]))) self.systemStart.setIconSize(QSize(64, 64)) self.connectBarLines = QCheckBox(checked=True) box = QHBoxLayout() box.addWidget(self.systemStartLabel) box.addWidget(self.systemStart) layout.addLayout(box) layout.addWidget(self.connectBarLines)
def createMetronomeWidget(self): self.metronomeLabel = QLabel() self.metronomeNote = QComboBox() self.metronomeNote.setModel( listmodel.ListModel( durations, display=None, icon=lambda item: symbols.icon('note_{0}'.format( item.replace('.', 'd'))))) self.metronomeNote.setCurrentIndex(durations.index('4')) self.metronomeNote.view().setIconSize(QSize(22, 22)) self.metronomeEqualSign = QLabel('=') self.metronomeEqualSign.setFixedWidth( self.metronomeEqualSign.minimumSizeHint().width()) self.metronomeValue = QComboBox(editable=True) self.metronomeValue.setModel( listmodel.ListModel(metronomeValues, self.metronomeValue, display=format)) self.metronomeValue.setCompleter(None) self.metronomeValue.setValidator( QIntValidator(0, 999, self.metronomeValue)) self.metronomeValue.setCurrentIndex(metronomeValues.index(100)) self.metronomeTempo = widgets.tempobutton.TempoButton() self.metronomeTempo.tempo.connect(self.setMetronomeValue) self.metronomeLabel.setBuddy(self.metronomeNote) self.metronomeRound = QCheckBox()
def createWidgets(self, layout): self.systemStartLabel = QLabel() self.systemStart = QComboBox() self.systemStartLabel.setBuddy(self.systemStart) self.systemStart.setModel( listmodel.ListModel( ( # L10N: Brace like a piano staff (lambda: _("Brace"), "system_start_brace"), # L10N: Bracket like a choir staff (lambda: _("Bracket"), "system_start_bracket"), # L10N: Square bracket like a sub-group (lambda: _("Square"), "system_start_square"), ), self.systemStart, display=listmodel.translate_index(0), icon=lambda item: symbols.icon(item[1]), ) ) self.systemStart.setIconSize(QSize(64, 64)) self.connectBarLines = QCheckBox(checked=True) box = QHBoxLayout() box.addWidget(self.systemStartLabel) box.addWidget(self.systemStart) layout.addLayout(box) layout.addWidget(self.connectBarLines)
def icon(name): """Returns an icon if defined.""" d = get(name).variables icon = d.get('icon') if icon: return icons.get(icon) icon = d.get('symbol') if icon: return symbols.icon(icon)
def createPickupWidget(self): self.pickupLabel = QLabel() self.pickup = QComboBox() pickups = [''] pickups.extend(durations) self.pickup.setModel(listmodel.ListModel(pickups, self.pickup, display = lambda item: item or _("None"), icon = lambda item: symbols.icon('note_{0}'.format(item.replace('.', 'd'))) if item else None)) self.pickup.view().setIconSize(QSize(22, 22)) self.pickupLabel.setBuddy(self.pickup)
def createMetronomeWidget(self): self.metronomeLabel = QLabel() self.metronomeNote = QComboBox() self.metronomeNote.setModel(listmodel.ListModel(durations, display=None, icon = lambda item: symbols.icon('note_{0}'.format(item.replace('.', 'd'))))) self.metronomeNote.setCurrentIndex(durations.index('4')) self.metronomeNote.view().setIconSize(QSize(22, 22)) self.metronomeEqualSign = QLabel('=') self.metronomeEqualSign.setFixedWidth(self.metronomeEqualSign.minimumSizeHint().width()) self.metronomeValue = QComboBox(editable=True) self.metronomeValue.setModel(listmodel.ListModel(metronomeValues, self.metronomeValue, display=format)) self.metronomeValue.setCompleter(None) self.metronomeValue.setValidator(QIntValidator(0, 999, self.metronomeValue)) self.metronomeValue.setCurrentIndex(metronomeValues.index(100)) self.metronomeTempo = widgets.tempobutton.TempoButton() self.metronomeTempo.tempo.connect(self.setMetronomeValue) self.metronomeLabel.setBuddy(self.metronomeNote)
def actionData(self): """Should yield name, icon, function (may be None) for every action.""" for name, title in self.actionTexts(): yield name, symbols.icon(name), None
def icon(self): """Should return an icon for our tab.""" return symbols.icon("spanner_phrasingslur")
def actionData(self): for name, title in self.actionTexts(): yield name, symbols.icon(name), None
def actionData(self): self._barlines = {} for name, ly_text, ly_text_2_18, title in self.barlines(): yield name, symbols.icon(name), None self._barlines[name] = ly_text, ly_text_2_18
def icon(self): """Should return an icon for our tab.""" return symbols.icon("dynamic_f")
def actionData(self): for name, title in self.actionTexts(): yield name, symbols.icon('articulation_' + name), None
def actionData(self): self._barlines = {} for name, ly_text, title in self.barlines(): yield name, symbols.icon(name), None self._barlines[name] = ly_text
def actionData(self): """Should yield name, icon, function (may be None) for every action.""" for m in dynamic_marks: name = 'dynamic_' + m yield name, symbols.icon(name), None
def icon(self): """Should return an icon for our tab.""" return symbols.icon("articulation_prall")
def icon(self): """Should return an icon for our tab.""" return symbols.icon("bar_single")