def __init__(self, aux): super(QlayerBlend, self).__init__() # - Init self.aux = aux self.currentTime = .0 self.timeStep = .01 # - Interface # -- Blend active layer to single selected layer self.lay_blend = QtGui.QHBoxLayout() self.btn_minus = QtGui.QPushButton(' - ') self.btn_plus = QtGui.QPushButton(' + ') self.btn_minus.setMinimumWidth(75) self.btn_plus.setMinimumWidth(75) self.btn_minus.clicked.connect(self.blendMinus) self.btn_plus.clicked.connect(self.blendPlus) self.edt_timeStep = QtGui.QLineEdit() self.edt_timeStep.setText(self.timeStep) self.btn_minus.setToolTip( 'Blend Active Layer to selected Layer.\nOriginal Active layer is lost!' ) self.btn_plus.setToolTip( 'Blend Active Layer to selected Layer.\nOriginal Active layer is lost!' ) self.edt_timeStep.setToolTip('Blend time (0.0 - 1.0) Step.') self.lay_blend.addWidget(self.btn_minus) self.lay_blend.addWidget(QtGui.QLabel('T:')) self.lay_blend.addWidget(self.edt_timeStep) self.lay_blend.addWidget(self.btn_plus) self.addLayout(self.lay_blend) # -- Build Axis from current selected layers and send result to active layer self.lay_opt = QtGui.QHBoxLayout() self.chk_multi = QtGui.QCheckBox('Use Selected Layers as Axis') self.chk_multi.stateChanged.connect(self.setCurrentTime) self.chk_width = QtGui.QCheckBox('Fixed Width') self.chk_multi.setToolTip( 'Blend selected layers to Active layer.\nUSAGE:\n- Create blank new layer;\n- Select two layers to build Interpolation Axis;\n- Use [+][-] to blend along axis.\nNote:\n- Selection order is important!\n- Checking/unchecking resets the blend position!' ) self.chk_width.setToolTip('Keep current Advance Width') self.lay_opt.addWidget(self.chk_multi) self.lay_opt.addWidget(self.chk_width) self.addLayout(self.lay_opt)
def __init__(self): super(QlayerSelect, self).__init__() # - Init # -- Head self.lay_head = QtGui.QHBoxLayout() self.edt_glyphName = QtGui.QLineEdit() self.btn_refresh = QtGui.QPushButton('&Refresh') self.btn_refresh.clicked.connect(self.refresh) self.lay_head.addWidget(QtGui.QLabel('G:')) self.lay_head.addWidget(self.edt_glyphName) self.lay_head.addWidget(self.btn_refresh) self.addLayout(self.lay_head) # -- Layer List self.lst_layers = QtGui.QListWidget() self.lst_layers.setAlternatingRowColors(True) self.lst_layers.setMinimumHeight(100) #self.lst_layers.setMaximumHeight(100) self.lst_layers.setSelectionMode( QtGui.QAbstractItemView.ExtendedSelection ) # Select multiple items call .selectedItems() to get a QList self.addWidget(self.lst_layers) self.refresh()
def __init__(self): super(QlayerSelect, self).__init__() # - Init # -- Head self.columns = ('Glyph', 'Anchors') self.lay_head = QtGui.QHBoxLayout() self.btn_refresh = QtGui.QPushButton('&Refresh') self.btn_refresh.clicked.connect(self.refresh) # -- Layer List self.tree_anchors = trTreeView((self.columns, [('A', 'Dummy')])) self.addWidget(self.btn_refresh) self.addWidget(self.tree_anchors) self.refresh()
def __init__(self): super(QTextBlockSelect, self).__init__() # -- Head self.lay_head = QtGui.QHBoxLayout() self.btn_refresh = QtGui.QPushButton('&Refresh') self.btn_refresh.clicked.connect(self.refresh) self.lay_head.addWidget(self.btn_refresh) self.addLayout(self.lay_head) # -- TextBlock List self.lst_textBlocks = QtGui.QListWidget() self.lst_textBlocks.setAlternatingRowColors(True) self.lst_textBlocks.setMinimumHeight(100) self.lst_textBlocks.setSelectionMode( QtGui.QAbstractItemView.ExtendedSelection) self.addWidget(self.lst_textBlocks)
def __init__(self): super(tool_tab, self).__init__() # - Init layoutV = QtGui.QVBoxLayout() layoutH = QtGui.QHBoxLayout() # - Build panel if sysReady: self.head = mixerHead() self.tail = mixerTail() self.head.btn_refresh.clicked.connect(self.refresh) self.head.btn_set_axis.clicked.connect(self.set_axis) self.head.btn_getVstem.clicked.connect(self.get_v_stems) self.head.btn_getHstem.clicked.connect(self.get_h_stems) layoutV.addLayout(self.head) layoutV.addSpacing(15) # -- Set Sliders # --- Mixer layoutV.addWidget(QtGui.QLabel('Interpolate: X (Vertical Stems)')) self.mixer_dx = trSliderCtrl('1', '1000', '0', 10) self.mixer_dx.sld_axis.valueChanged.connect( lambda: self.process_scale(self.head.chk_single.isChecked(), self.head.chk_preview.isChecked())) layoutV.addLayout(self.mixer_dx) layoutV.addWidget( QtGui.QLabel('Interpolate: Y (Horizontal Stems)')) self.mixer_dy = trSliderCtrl('1', '1000', '0', 10) self.mixer_dy.sld_axis.valueChanged.connect( lambda: self.process_scale(self.head.chk_single.isChecked(), self.head.chk_preview.isChecked())) layoutV.addLayout(self.mixer_dy) # - Constant width Button #self.btn_revWidth = QtGui.QPushButton('Constant width for weight') #self.btn_revWidth.setCheckable(True) #layoutV.addWidget(self.btn_revWidth) layoutV.addSpacing(15) # --- Scaler layoutV.addWidget(QtGui.QLabel('Compensative scaler: Width')) self.scaler_dx = trSliderCtrl('1', '200', '100', 10) self.scaler_dx.sld_axis.valueChanged.connect( lambda: self.process_scale(self.head.chk_single.isChecked(), self.head.chk_preview.isChecked())) layoutV.addLayout(self.scaler_dx) layoutV.addSpacing(15) layoutV.addWidget(QtGui.QLabel('Compensative scaler: Height')) self.scaler_dy = trSliderCtrl('1', '200', '100', 10) self.scaler_dy.sld_axis.valueChanged.connect( lambda: self.process_scale(self.head.chk_single.isChecked(), self.head.chk_preview.isChecked())) layoutV.addLayout(self.scaler_dy) layoutV.addSpacing(25) layoutV.addLayout(self.tail) # - Process Button self.btn_process = QtGui.QPushButton('Process Transformation') self.btn_process.clicked.connect(lambda: self.process_scale( self.head.chk_single.isChecked(), True, True)) layoutV.addWidget(self.btn_process) # -- Initialize self.refresh() # -- Finish layoutV.addStretch() else: # - Throw an error layoutV.addLayout(trMsgSimple(warnMessage)) # - Set panel self.setLayout(layoutV)