Changeset 2065 for trunk/libffado

Show
Ignore:
Timestamp:
03/05/12 04:51:56 (9 years ago)
Author:
jwoithe
Message:

matrixmixer: provide an option to use smaller fonts for column/row names and fader values, which is useful for devices with large matrix mixers.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/libffado/support/mixer-qt4/ffado/widgets/matrixmixer.py

    r2064 r2065  
    212212 
    213213class MixerChannel(QtGui.QWidget): 
    214     def __init__(self, number, parent=None, name=""): 
     214    def __init__(self, number, parent=None, name="", smallFont=False): 
    215215        QtGui.QWidget.__init__(self, parent) 
    216216        layout = QtGui.QGridLayout(self) 
     
    221221        self.lbl = QtGui.QLabel(self) 
    222222        self.lbl.setAlignment(Qt.Qt.AlignCenter) 
     223        if (smallFont): 
     224            font = self.lbl.font() 
     225            font.setPointSize(font.pointSize()/1.5) 
     226            self.lbl.setFont(font) 
    223227        layout.addWidget(self.lbl, 0, 0, 1, 2) 
    224228        self.hideChannel(False) 
     
    242246 
    243247class MatrixMixer(QtGui.QWidget): 
    244     def __init__(self, servername, basepath, parent=None, sliderMaxValue=-1, mutespath=None, invertspath=None): 
     248    def __init__(self, servername, basepath, parent=None, sliderMaxValue=-1, mutespath=None, invertspath=None, smallFont=False): 
    245249        QtGui.QWidget.__init__(self, parent) 
    246250        self.bus = dbus.SessionBus() 
     
    279283        if (cols > 1): 
    280284            for i in range(cols): 
    281                 ch = MixerChannel(i, self, self.interface.getColName(i)
     285                ch = MixerChannel(i, self, self.interface.getColName(i), smallFont
    282286                self.connect(ch, QtCore.SIGNAL("hide"), self.hideColumn) 
    283287                layout.addWidget(ch, 0, i+1) 
     
    287291        if (rows > 1): 
    288292            for i in range(rows): 
    289                 ch = MixerChannel(i, self, self.interface.getRowName(i)
     293                ch = MixerChannel(i, self, self.interface.getRowName(i), smallFont
    290294                self.connect(ch, QtCore.SIGNAL("hide"), self.hideRow) 
    291295                layout.addWidget(ch, i+1, 0) 
     
    303307                    inv_value = self.inverts_interface.getValue(i,j) 
    304308                node = MixerNode(j, i, self.interface.getValue(i,j), sliderMaxValue, mute_value, inv_value, self) 
     309                if (smallFont): 
     310                    font = node.font() 
     311                    font.setPointSize(font.pointSize()/1.5) 
     312                    node.setFont(font) 
    305313                self.connect(node, QtCore.SIGNAL("valueChanged"), self.valueChanged) 
    306314                layout.addWidget(node, i+1, j+1)