def __init__(self, parent, editable, popup_hide_object_signal_list=[]): FloaterOpener.__init__(self, popup_hide_object_signal_list) WidgetEntry.__init__(self, parent) self.validator_set(validator_rgba) self._edit_grp = editable self.color = (255, 255, 255, 255) self.parent = parent self.entry.callback_activated_add(self._entry_activate_cb) self.entry.callback_changed_add(self._entry_changed_cb) self.entry.callback_double_clicked_add(self._dblclick_cb) ed = parent.edje_get() file = ed.file_get()[0] self.rect = edje.Edje(ed.evas, file=file, group="colorpreviewer") self.rect.size_hint_align_set(-1.0, -1.0) self.rect.size_hint_min_set(*self.rect.size_min_get()) self.rect.on_mouse_down_add(self._sample_clicked_cb) self.rect.show() self.box = elementary.Box(parent) self.box.horizontal_set(True) self.box.size_hint_weight_set(1.0, 0.0) self.box.size_hint_align_set(-1.0, -1.0) self.box.pack_end(self.entry) self.box.pack_end(self.rect) self.box.show() self.obj = self.box self._delayed_callback = False
def __init__(self, parent, bt_icon=None): WidgetEntry.__init__(self, parent) self.selection_list = [] self.button = elementary.Button(parent) self.button.size_hint_align_set(-1.0, -1.0) self.button.callback_clicked_add(self._open) self.button.style_set("editje.details") self.button.show() self.theme_file = sysconfig.theme_file_get("default") ico = elementary.Icon(self.button) if bt_icon: ico.file_set(self.theme_file, bt_icon) else: ico.file_set(self.theme_file, "editje/icon/entry_button") ico.size_hint_min_set(18, 18) ico.show() self.button.content_set(ico) self.button.size_hint_min_set(20, 20) self.box = elementary.Box(parent) self.box.horizontal_set(True) self.box.size_hint_weight_set(1.0, 0.0) self.box.size_hint_align_set(-1.0, -1.0) self.box.pack_end(self.entry) self.box.pack_end(self.button) self.box.show() self.obj = self.box