scale antenna and mobility player buttons

This commit is contained in:
Huy Pham 2020-02-17 15:14:52 -08:00
parent 1d911a763f
commit 87c9492d32
9 changed files with 52 additions and 40 deletions

View file

@ -100,17 +100,17 @@ class MobilityPlayerDialog(Dialog):
for i in range(3):
frame.columnconfigure(i, weight=1)
image = Images.get(ImageEnum.START, width=ICON_SIZE)
image = Images.get(ImageEnum.START, width=int(ICON_SIZE * self.app.app_scale))
self.play_button = ttk.Button(frame, image=image, command=self.click_play)
self.play_button.image = image
self.play_button.grid(row=0, column=0, sticky="ew", padx=PADX)
image = Images.get(ImageEnum.PAUSE, width=ICON_SIZE)
image = Images.get(ImageEnum.PAUSE, width=int(ICON_SIZE * self.app.app_scale))
self.pause_button = ttk.Button(frame, image=image, command=self.click_pause)
self.pause_button.image = image
self.pause_button.grid(row=0, column=1, sticky="ew", padx=PADX)
image = Images.get(ImageEnum.STOP, width=ICON_SIZE)
image = Images.get(ImageEnum.STOP, width=int(ICON_SIZE * self.app.app_scale))
self.stop_button = ttk.Button(frame, image=image, command=self.click_stop)
self.stop_button.image = image
self.stop_button.grid(row=0, column=2, sticky="ew", padx=PADX)

View file

@ -38,7 +38,7 @@ class NodeServiceDialog(Dialog):
if len(services) == 0:
# not custom node type and node's services haven't been modified before
if not NodeUtils.is_custom(
canvas_node.core_node.model
canvas_node.core_node.type, canvas_node.core_node.model
) and not self.app.core.service_been_modified(self.node_id):
services = set(self.app.core.default_services[model])
# services of default type nodes were modified to be empty

View file

@ -129,16 +129,9 @@ class PreferencesDialog(Dialog):
self.app.icon_text_font.config(size=int(12 * app_scale))
self.app.edge_font.config(size=int(8 * app_scale))
# scale application widow size
screen_width = self.app.master.winfo_screenwidth()
screen_height = self.app.master.winfo_screenheight()
scaled_width = WIDTH * app_scale
scaled_height = HEIGHT * app_scale
x = int(screen_width / 2 - scaled_width / 2)
y = int(screen_height / 2 - scaled_height / 2)
self.app.master.geometry(f"{int(scaled_width)}x{int(scaled_height)}+{x}+{y}")
# scale application window
self.app.center()
# scale toolbar icons and picker icons
# scale toolbar and canvas items
self.app.toolbar.scale()
self.app.canvas.scale_graph()