Skip to content

Commit

Permalink
advanced and help panel should now have equal width
Browse files Browse the repository at this point in the history
  • Loading branch information
Steffenhir committed May 7, 2022
1 parent 330acc3 commit 66683e0
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/help_panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def __init__(self, master, canvas, app):
self.button_frame = tk.Frame(self.canvas)

scaling = get_scaling_factor(master)

s = ttk.Style(master)

# Help Button
Expand Down Expand Up @@ -219,19 +219,19 @@ def __init__(self, master, canvas, app):
self.advanced_panel_window = tk.Frame(self.advanced_canvas, borderwidth=0)

text = tk.Message(self.advanced_panel_window, text=_("Advanced Settings"), width=240 * scaling, font=heading_font, anchor="center")
text.grid(column=0, row=0, padx=(40*scaling,30*scaling), pady=(20*scaling,10*scaling), sticky="ew")
text.grid(column=0, row=0, padx=(40,30), pady=(20*scaling,10*scaling), sticky="ew")

text = tk.Message(self.advanced_panel_window, text=_("Sample Points"), width=240 * scaling, font=heading_font2, anchor="center")
text.grid(column=0, row=1, padx=(5*scaling,10*scaling), pady=(20*scaling,10*scaling), sticky="ew")
text.grid(column=0, row=1, padx=(40,30), pady=(20*scaling,10*scaling), sticky="ew")

self.app.sample_size = tk.IntVar()
self.app.sample_size.set(25)
if "sample_size" in self.app.prefs:
self.app.sample_size.set(self.app.prefs["sample_size"])

self.sample_size_text = tk.Message(self.advanced_panel_window, text=_("Sample size: {}").format(self.app.sample_size.get()))
self.sample_size_text.config(width=500 * scaling)
self.sample_size_text.grid(column=0, row=2, pady=(5*scaling,5*scaling), padx=15*scaling, sticky="ews")
self.sample_size_text.config(width=240 * scaling)
self.sample_size_text.grid(column=0, row=2, pady=(5*scaling,5*scaling), padx=(40,30), sticky="ews")

def on_sample_size_slider(sample_size):
self.app.sample_size.set(float("{:.2f}".format(float(sample_size))))
Expand All @@ -245,9 +245,9 @@ def on_sample_size_slider(sample_size):
to=50,
var=self.app.sample_size,
command=on_sample_size_slider,
length=150
length=240 * scaling,
)
self.sample_size_slider.grid(column=0, row=3, pady=(0,10*scaling), padx=15*scaling, sticky="ew")
self.sample_size_slider.grid(column=0, row=3, pady=(0,10*scaling), padx=(40,30), sticky="ew")


self.app.sample_color = tk.IntVar()
Expand All @@ -257,7 +257,7 @@ def on_sample_size_slider(sample_size):

self.sample_color_text = tk.Message(self.advanced_panel_window, text=_("Sample color: {}").format(self.app.sample_color.get()))
self.sample_color_text.config(width=500 * scaling)
self.sample_color_text.grid(column=0, row=4, pady=(5*scaling,5*scaling), padx=15*scaling, sticky="ews")
self.sample_color_text.grid(column=0, row=4, pady=(5*scaling,5*scaling), padx=(40,30), sticky="ews")

def on_sample_color_slider(sample_color):
self.app.sample_color.set(float("{:.2f}".format(float(sample_color))))
Expand All @@ -273,13 +273,13 @@ def on_sample_color_slider(sample_color):
command=on_sample_color_slider,
length=150
)
self.sample_color_slider.grid(column=0, row=5, pady=(0,10*scaling), padx=15*scaling, sticky="ew")
self.sample_color_slider.grid(column=0, row=5, pady=(0,10*scaling), padx=(40,30), sticky="ew")

text = tk.Message(self.advanced_panel_window, text=_("Interpolation"), width=240 * scaling, font=heading_font2, anchor="center")
text.grid(column=0, row=6, padx=(10*scaling,10*scaling), pady=(20*scaling,10*scaling), sticky="ew")

text = tk.Message(self.advanced_panel_window, text=_("RBF Kernel"), width=240*scaling, anchor="center")
text.grid(column=0, row=7, pady=(5*scaling,5*scaling), padx=15*scaling, sticky="ews")
text.grid(column=0, row=7, pady=(5*scaling,5*scaling), padx=(40,30), sticky="ews")

self.app.RBF_kernels = ["thin_plate", "quintic", "cubic", "linear"]
self.app.RBF_kernel = tk.StringVar()
Expand All @@ -288,11 +288,11 @@ def on_sample_color_slider(sample_color):
self.app.RBF_kernel.set(self.app.prefs["RBF_kernel"])

self.kernel_menu = ttk.OptionMenu(self.advanced_panel_window, self.app.RBF_kernel, self.app.RBF_kernel.get(), *self.app.RBF_kernels)
self.kernel_menu.grid(column=0, row=8, pady=(5*scaling,5*scaling), padx=15*scaling, sticky="ews")
self.kernel_menu.grid(column=0, row=8, pady=(5*scaling,5*scaling), padx=(40,30), sticky="ews")


text = tk.Message(self.advanced_panel_window, text=_("Spline order"), width=240*scaling, anchor="center")
text.grid(column=0, row=9, pady=(5*scaling,5*scaling), padx=15*scaling, sticky="ews")
text.grid(column=0, row=9, pady=(5*scaling,5*scaling), padx=(40,30), sticky="ews")

self.app.spline_orders = [1,2,3,4,5]
self.app.spline_order = tk.IntVar()
Expand All @@ -301,11 +301,11 @@ def on_sample_color_slider(sample_color):
self.app.spline_order.set(self.app.prefs["spline_order"])

self.spline_order_menu = ttk.OptionMenu(self.advanced_panel_window, self.app.spline_order, self.app.spline_order.get(), *self.app.spline_orders)
self.spline_order_menu.grid(column=0, row=10, pady=(5*scaling,5*scaling), padx=15*scaling, sticky="ews")
self.spline_order_menu.grid(column=0, row=10, pady=(5*scaling,5*scaling), padx=(40,30), sticky="ews")


text = tk.Message(self.advanced_panel_window, text=_("Language"), width=240 * scaling, font=heading_font2, anchor="center")
text.grid(column=0, row=11, padx=(10*scaling,10*scaling), pady=(20*scaling,10*scaling), sticky="ew")
text.grid(column=0, row=11, padx=(40,30), pady=(20*scaling,10*scaling), sticky="ew")

def lang_change(lang):
messagebox.showerror("", _("Please restart the program to change the language."))
Expand All @@ -319,7 +319,7 @@ def lang_change(lang):
self.app.lang.set("English")

self.lang_menu = ttk.OptionMenu(self.advanced_panel_window, self.app.lang, self.app.lang.get(), *self.app.langs, command=lang_change)
self.lang_menu.grid(column=0, row=12, pady=(5*scaling,5*scaling), padx=15*scaling, sticky="ews")
self.lang_menu.grid(column=0, row=12, pady=(5*scaling,5*scaling), padx=(40,30), sticky="ews")


self.advanced_canvas.create_window((0,0), window=self.advanced_panel_window)
Expand Down

0 comments on commit 66683e0

Please sign in to comment.