diff --git a/coretk/coretk/data/icons/markerclear.png b/coretk/coretk/data/icons/markerclear.png new file mode 100644 index 00000000..6f58c005 Binary files /dev/null and b/coretk/coretk/data/icons/markerclear.png differ diff --git a/coretk/coretk/dialogs/marker.py b/coretk/coretk/dialogs/marker.py index feb8bd09..5648a89b 100644 --- a/coretk/coretk/dialogs/marker.py +++ b/coretk/coretk/dialogs/marker.py @@ -24,10 +24,14 @@ class Marker(Dialog): def draw(self): button = ttk.Button(self.top, text="clear", command=self.clear_marker) - button.grid(row=0, column=0) + button.grid(row=0, column=0, sticky="nsew") frame = ttk.Frame(self.top) - frame.grid(row=1, column=0) + frame.columnconfigure(0, weight=1) + frame.columnconfigure(1, weight=4) + frame.grid(row=1, column=0, sticky="nsew") + label = ttk.Label(frame, text="Thickness: ") + label.grid(row=0, column=0, sticky="nsew") combobox = ttk.Combobox( frame, textvariable=self.marker_thickness, @@ -36,8 +40,14 @@ class Marker(Dialog): ) combobox.grid(row=0, column=1, sticky="nsew") combobox.bind("<>", self.change_thickness) - label = ttk.Label(self.top, background=self.color) - label.grid(row=2, column=0, sticky="nsew") + frame = ttk.Frame(self.top) + frame.columnconfigure(0, weight=1) + frame.columnconfigure(1, weight=4) + frame.grid(row=2, column=0, sticky="nsew") + label = ttk.Label(frame, text="Color: ") + label.grid(row=0, column=0, sticky="nsew") + label = ttk.Label(frame, background=self.color) + label.grid(row=0, column=1, sticky="nsew") label.bind("", self.change_color) def clear_marker(self): @@ -57,3 +67,7 @@ class Marker(Dialog): def close_marker(self, event): logging.debug("destroy marker dialog") self.app.toolbar.marker_tool = None + + def position(self): + print(self.winfo_width(), self.winfo_height()) + self.geometry("+{}+{}".format(self.app.master.winfo_x, self.app.master.winfo_y)) diff --git a/coretk/coretk/graph/graph.py b/coretk/coretk/graph/graph.py index e0878f20..996c85eb 100644 --- a/coretk/coretk/graph/graph.py +++ b/coretk/coretk/graph/graph.py @@ -499,7 +499,7 @@ class CanvasGraph(tk.Canvas): x, y = self.coords(selected) self.drawing_edge = CanvasEdge(x, y, x, y, selected, self) - if self.mode == GraphMode.ANNOTATION and selected is None: + if self.mode == GraphMode.ANNOTATION: if is_marker(self.annotation_type): r = self.app.toolbar.marker_tool.radius self.create_oval( @@ -511,7 +511,8 @@ class CanvasGraph(tk.Canvas): outline="", tags="marker", ) - else: + return + if selected is None: shape = Shape(self.app, self, self.annotation_type, x, y) self.selected = shape.id self.shape_drawing = True @@ -587,8 +588,7 @@ class CanvasGraph(tk.Canvas): shape = self.shapes[self.selected] shape.shape_motion(x, y) elif is_marker(self.annotation_type): - marker_tool = self.app.toolbar.marker_tool - r = marker_tool.radius + r = self.app.toolbar.marker_tool.radius self.create_oval( x - r, y - r, @@ -598,6 +598,7 @@ class CanvasGraph(tk.Canvas): outline="", tags="marker", ) + return if self.mode == GraphMode.EDGE: return diff --git a/coretk/coretk/toolbar.py b/coretk/coretk/toolbar.py index 0769380a..c32b0d75 100644 --- a/coretk/coretk/toolbar.py +++ b/coretk/coretk/toolbar.py @@ -420,6 +420,7 @@ class Toolbar(ttk.Frame): logging.debug("Click on marker button") dialog = Marker(self.master, self.app) dialog.show() + # dialog.position() def click_two_node_button(self): logging.debug("Click TWONODE button")