def __init__(self, meters_count): w = SLOT_W * meters_count h = METER_SLOT_H self.widget = CairoDrawableArea(w, h, self._draw) self.audio_meters = [] # displays both l_Value and r_value for i in range(0, meters_count): meter = AudioMeter(METER_HEIGHT) if i != meters_count - 1: meter.right_channel.draw_dB = True self.audio_meters.append(meter)
def __init__(self): self.meter = AudioMeter(METER_HEIGHT + 40) self.meter.x_pad_l = 6 self.meter.x_pad_r = 14 self.meter.right_channel.draw_dB = True self.meter.right_channel.dB_x_pad = -14 self.meter.meter_width = 5 self.top_pad = 14 self.meter.right_channel.y_top_pad = self.top_pad self.meter.left_channel.y_top_pad = self.top_pad w = SLOT_W - 40 h = METER_SLOT_H + 2 + 40 self.canvas = CairoDrawableArea(w, h, self._draw) self.widget = gtk.VBox(False, 0) self.widget.pack_start(self.canvas, False, False, 0)
def __init__(self, button_width, button_height, button_y, widget_width, widget_height): # Create widget and connect listeners self.widget = CairoDrawableArea(widget_width, widget_height, self._draw) self.widget.press_func = self._press_event self.widget.motion_notify_func = self._motion_notify_event self.widget.release_func = self._release_event self.pressed_callback_funcs = None # set later self.released_callback_funcs = None # set later self.pressed_button = -1 self.degrees = M_PI / 180.0 self.button_width = button_width self.button_height = button_height self.button_y = button_y self.button_x = 0 # set when first allocation known by extending class self.icons = [] self.image_x = [] self.image_y = [] self.sensitive = [] if editorpersistance.prefs.buttons_style == editorpersistance.GLASS_STYLE: self.glass_style = True else: self.glass_style = False # Dark theme comes with flat buttons self.dark_theme = False if editorpersistance.prefs.dark_theme == True: self.glass_style = False self.dark_theme = True self.draw_button_gradients = True # set False at object creation site to kill all gradients