def connection_add(self, col1, row1, col2, row2): # print ("CONNECTION", col1, row1, col2, row2) if col1 == col2: # a stright line l = Edje(self.evas, file=self.themef, size_hint_align=FILL_BOTH, group='egitu/graph/connection/vert', color=self.color_for_column(col1)) self.pack(l, col1, row1, col2 - col1 + 1, row2 - row1 + 1) elif col1 > col2: # a "fork" l = Edje(self.evas, file=self.themef, size_hint_align=FILL_BOTH, group='egitu/graph/connection/vert_fork', color=self.color_for_column(col1)) self.pack(l, col2, row1, col1 - col2 + 1, row2 - row1 + 1) else: # a "merge" l = Edje(self.evas, file=self.themef, size_hint_align=FILL_BOTH, group='egitu/graph/connection/vert_merge', color=self.color_for_column(col2)) self.pack(l, col1, row1, col2 - col1 + 1, row2 - row1 + 1) l.lower() l.show() return l
def draw_connection(self, commit1, commit2): col1, row1 = commit1.dag_data.col, commit1.dag_data.row col2, row2 = commit2.dag_data.col, commit2.dag_data.row # down-wards connections if row1 < row2: if col1 == col2: # a stright line line = Edje(self.evas, file=self.themef, group='egitu/graph/connection/stright', color=self._color_for_column(col1), size_hint_align=(0.5, 0.0)) elif col1 > col2: # a "fork" line = Edje(self.evas, file=self.themef, group='egitu/graph/connection/fork', color=self._color_for_column(col1), size_hint_align=(1.0, 0.0)) else: # a merge line = Edje(self.evas, file=self.themef, group='egitu/graph/connection/merge', color=self._color_for_column(col2), size_hint_align=(0.0, 0.0)) # delete the same (upwards) line from parent (if was created) upward = commit2.dag_data.upwards_lines.pop(commit1, None) if upward is not None: upward.delete() # up-wards connections else: if col1 == col2: # a stright line line = Edje(self.evas, file=self.themef, group='egitu/graph/connection/stright', color=self._color_for_column(col1), size_hint_align=(0.5, 1.0)) elif col1 < col2: # a "fork" line = Edje(self.evas, file=self.themef, group='egitu/graph/connection/fork', color=self._color_for_column(col2), size_hint_align=(0.0, 1.0)) else: # a merge line = Edje(self.evas, file=self.themef, group='egitu/graph/connection/merge', color=self._color_for_column(col1), size_hint_align=(1.0, 1.0)) # store the line for later deletion commit1.dag_data.upwards_lines[commit2] = line # calculate size, append to the connections box and show line.size_hint_min = (abs(col2 - col1) + 1) * self.COLW, \ (abs(row2 - row1) + 1) * self.ROWH commit1.dag_data.icon_obj.box_append('connections.box', line) line.show()
def wallSelected(self, obj, item): #self.previewBox.clear() #edjeObj = Layout(self.previewBox, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) edjeObj = Edje(self.previewBox.evas, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) filePath = item.data["filePath"] edjeObj.file_set(filePath, "e/desktop/background") edjeObj.show() self.previewBox.content_set(edjeObj) self.currentPreview = edjeObj self.selectedWall = filePath
def themeSelected(self, obj, item): #self.previewBox.clear() edjeObj = Edje(self.evas, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) filePath = item.data["filePath"] try: edjeObj.file_set(filePath, "moksha/preview") except: edjeObj.file_set(filePath, "e/desktop/background") edjeObj.show() self.previewBox.content_set(edjeObj) self.currentPreview = edjeObj self.selectedTheme = filePath
def addTheme(self, themeFile, ourPath): edjeObj = Edje(self.evas, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) try: edjeObj.file_set("%s/%s"%(ourPath, themeFile), "moksha/preview") except: edjeObj.file_set("%s/%s"%(ourPath, themeFile), "e/desktop/background") edjeObj.show() listItem = self.themeList.item_append("%s"%themeFile, edjeObj, callback=self.themeSelected) listItem.data["filePath"] = "%s%s"%(ourPath, themeFile) listItem.selected_set(True) self.foundThemes.append("%s%s"%(ourPath, themeFile)) self.themeSelected(None, listItem)
def addTheme(self, themeFile, ourPath): edjeObj = Edje(self.evas, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) try: edjeObj.file_set("%s/%s" % (ourPath, themeFile), "moksha/preview") except: edjeObj.file_set("%s/%s" % (ourPath, themeFile), "e/desktop/background") edjeObj.show() listItem = self.themeList.item_append("%s" % themeFile, edjeObj, callback=self.themeSelected) listItem.data["filePath"] = "%s%s" % (ourPath, themeFile) listItem.selected_set(True) self.foundThemes.append("%s%s" % (ourPath, themeFile)) self.themeSelected(None, listItem)