canvas size added to preferences and updated to dialog
This commit is contained in:
parent
15e484c8c2
commit
1ca9aec247
4 changed files with 16 additions and 5 deletions
|
@ -67,8 +67,15 @@ class Application(tk.Frame):
|
||||||
self.draw_status()
|
self.draw_status()
|
||||||
|
|
||||||
def draw_canvas(self):
|
def draw_canvas(self):
|
||||||
|
width = self.guiconfig["preferences"]["width"]
|
||||||
|
height = self.guiconfig["preferences"]["height"]
|
||||||
self.canvas = CanvasGraph(
|
self.canvas = CanvasGraph(
|
||||||
self, self.core, background="#cccccc", scrollregion=(0, 0, 1200, 1000)
|
self,
|
||||||
|
self.core,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
background="#cccccc",
|
||||||
|
scrollregion=(0, 0, 1200, 1000),
|
||||||
)
|
)
|
||||||
self.canvas.pack(fill=tk.BOTH, expand=True)
|
self.canvas.pack(fill=tk.BOTH, expand=True)
|
||||||
scroll_x = ttk.Scrollbar(
|
scroll_x = ttk.Scrollbar(
|
||||||
|
|
|
@ -78,6 +78,8 @@ def check_directory():
|
||||||
"editor": editor,
|
"editor": editor,
|
||||||
"terminal": terminal,
|
"terminal": terminal,
|
||||||
"gui3d": "/usr/local/bin/std3d.sh",
|
"gui3d": "/usr/local/bin/std3d.sh",
|
||||||
|
"width": 1000,
|
||||||
|
"height": 750,
|
||||||
},
|
},
|
||||||
"location": {
|
"location": {
|
||||||
"x": 0.0,
|
"x": 0.0,
|
||||||
|
|
|
@ -14,8 +14,8 @@ class PreferencesDialog(Dialog):
|
||||||
self.theme = tk.StringVar(value=preferences["theme"])
|
self.theme = tk.StringVar(value=preferences["theme"])
|
||||||
self.terminal = tk.StringVar(value=preferences["terminal"])
|
self.terminal = tk.StringVar(value=preferences["terminal"])
|
||||||
self.gui3d = tk.StringVar(value=preferences["gui3d"])
|
self.gui3d = tk.StringVar(value=preferences["gui3d"])
|
||||||
self.width = tk.StringVar(value="1000")
|
self.width = tk.StringVar(value=preferences["width"])
|
||||||
self.height = tk.StringVar(value="800")
|
self.height = tk.StringVar(value=preferences["height"])
|
||||||
self.draw()
|
self.draw()
|
||||||
|
|
||||||
def draw(self):
|
def draw(self):
|
||||||
|
@ -93,5 +93,7 @@ class PreferencesDialog(Dialog):
|
||||||
preferences["editor"] = self.editor.get()
|
preferences["editor"] = self.editor.get()
|
||||||
preferences["gui3d"] = self.gui3d.get()
|
preferences["gui3d"] = self.gui3d.get()
|
||||||
preferences["theme"] = self.theme.get()
|
preferences["theme"] = self.theme.get()
|
||||||
|
preferences["width"] = self.width.get()
|
||||||
|
preferences["height"] = self.height.get()
|
||||||
self.app.save_config()
|
self.app.save_config()
|
||||||
self.destroy()
|
self.destroy()
|
||||||
|
|
|
@ -39,7 +39,7 @@ class ScaleOption(enum.Enum):
|
||||||
|
|
||||||
|
|
||||||
class CanvasGraph(tk.Canvas):
|
class CanvasGraph(tk.Canvas):
|
||||||
def __init__(self, master, core, cnf=None, **kwargs):
|
def __init__(self, master, core, width, height, cnf=None, **kwargs):
|
||||||
if cnf is None:
|
if cnf is None:
|
||||||
cnf = {}
|
cnf = {}
|
||||||
kwargs["highlightthickness"] = 0
|
kwargs["highlightthickness"] = 0
|
||||||
|
@ -54,7 +54,7 @@ class CanvasGraph(tk.Canvas):
|
||||||
self.grid = None
|
self.grid = None
|
||||||
self.canvas_management = CanvasComponentManagement(self, core)
|
self.canvas_management = CanvasComponentManagement(self, core)
|
||||||
self.setup_bindings()
|
self.setup_bindings()
|
||||||
self.draw_grid()
|
self.draw_grid(width, height)
|
||||||
self.core = core
|
self.core = core
|
||||||
self.helper = GraphHelper(self, core)
|
self.helper = GraphHelper(self, core)
|
||||||
self.throughput_draw = Throughput(self, core)
|
self.throughput_draw = Throughput(self, core)
|
||||||
|
|
Loading…
Reference in a new issue