def __init__(self): # main widget 'pointers' self.tasks_list = None self.filters = None self.task_note = None self.search_entry = None self.main_panes = None # the window StandardWindow.__init__(self, "edone", "Edone") self.callback_delete_request_add(lambda o: self.safe_quit()) # self.focus_highlight_enabled = True # main vertical box vbox = Box(self, size_hint_weight=EXPAND_BOTH) self.resize_object_add(vbox) vbox.show() ### Header ### hbox1 = Box(vbox, horizontal=True) fr = Frame(vbox, style='outdent_bottom', content=hbox1, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) vbox.pack_end(fr) fr.show() # menu button m = OptionsMenu(hbox1) hbox1.pack_end(m) m.show() # new task button b = Button(hbox1, text='New Task', focus_allow=False) b.content = Icon(hbox1, standard='add') b.callback_clicked_add(lambda b: self.task_add()) hbox1.pack_end(b) b.show() # title title = Label(hbox1, text="Getting Things Done", scale=2.0, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) hbox1.pack_end(title) title.show() # search entry en = Entry(hbox1, single_line=True, scrollable=True, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) en.part_text_set('guide', 'search') en.callback_changed_user_add(self._search_changed_user_cb) en.content_set('end', Icon(en, standard='find', size_hint_min=(20,20))) hbox1.pack_end(en) en.show() self.search_entry = en ### Main horizontal box ### hbox = Box(vbox, horizontal=True, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) vbox.pack_end(hbox) hbox.show() # the filters box widget (inside a padding frame) self.filters = Filters(hbox) fr = Frame(hbox, style='pad_medium', content=self.filters, size_hint_weight=EXPAND_VERT, size_hint_align=FILL_VERT) hbox.pack_end(fr) fr.show() ### the main panes (horiz or vert) panes = Panes(hbox, horizontal=not options.horiz_layout, content_left_min_relative_size=0.3, content_right_min_relative_size=0.1, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) panes.content_left_size = 1.0 hbox.pack_end(panes) panes.show() self.main_panes = panes ### the tasks list ### self.tasks_list = TasksList(panes) panes.part_content_set("left", self.tasks_list) ### the single task view ### self.task_note = TaskNote(panes) panes.part_content_set("right", self.task_note) # show the window self.resize(800, 600) self.show()
def __init__(self): self.repo = None self.branch_selector = None self.caption_label = None self.status_label = None self.graph = None self.diff_view = None StandardWindow.__init__(self, "egitu", "Efl GIT gUi - Egitu") self.autodel_set(True) self.callback_delete_request_add(lambda o: elm.exit()) # main vertical box box = Box(self, size_hint_weight = EXPAND_BOTH) self.resize_object_add(box) box.show() # header fr = Frame(self, style="outdent_bottom", size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH) box.pack_end(fr) fr.show() tb = Table(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_BOTH) fr.content = tb tb.show() # main menu button bt = Button(self, text='Menu') bt.content = Icon(self, standard='home') bt.callback_clicked_add(lambda b: EgituMenu(self, b)) tb.pack(bt, 0, 0, 1, 1) bt.show() # editable description entry self.caption_label = EditableDescription(self) tb.pack(self.caption_label, 1, 0, 1, 1) self.caption_label.show() # branch selector lb = Label(self, text='On branch') tb.pack(lb, 2, 0, 1, 1) lb.show() self.branch_selector = Hoversel(self, text='none') self.branch_selector.callback_selected_add(self.branch_selected_cb) tb.pack(self.branch_selector, 3, 0, 1, 1) self.branch_selector.show() # status label + button self.status_label = lb = Entry(self, single_line=True, editable=False) tb.pack(lb, 4, 0, 1, 1) lb.show() ### Main content (left + right panes) panes = Panes(self, content_left_size = 0.5, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) box.pack_end(panes) panes.show() # the dag graph inside a scroller on the left self.graph = DagGraph(self, self.repo) fr = Frame(self, style="pad_medium", content=self.graph) scr = Scroller(self, content=fr, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) scr.bounce_set(0, 1) panes.part_content_set("left", scr) # the diff viewer on the right self.diff_view = DiffViewer(self, self.repo) self.diff_view.size_hint_weight = EXPAND_BOTH self.diff_view.size_hint_align = 0.0, 0.0 panes.part_content_set("right", self.diff_view) self.resize(800, 600) self.show()