pygui: changes to leverage common icon scaling function, fix issue with scaling toolbar

This commit is contained in:
Blake Harnden 2020-05-18 23:25:42 -07:00
parent cde053da73
commit 773f733cb8
5 changed files with 20 additions and 28 deletions

View file

@ -6,7 +6,7 @@ import grpc
from core.api.grpc.mobility_pb2 import MobilityAction
from core.gui.dialogs.dialog import Dialog
from core.gui.images import ImageEnum, Images
from core.gui.images import ImageEnum
from core.gui.themes import PADX, PADY
if TYPE_CHECKING:
@ -89,17 +89,17 @@ class MobilityPlayerDialog(Dialog):
for i in range(3):
frame.columnconfigure(i, weight=1)
image = Images.get(ImageEnum.START, width=int(ICON_SIZE * self.app.app_scale))
image = self.app.get_icon(ImageEnum.START, ICON_SIZE)
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=int(ICON_SIZE * self.app.app_scale))
image = self.app.get_icon(ImageEnum.PAUSE, ICON_SIZE)
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=int(ICON_SIZE * self.app.app_scale))
image = self.app.get_icon(ImageEnum.STOP, ICON_SIZE)
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

@ -17,6 +17,8 @@ if TYPE_CHECKING:
from core.gui.app import Application
from core.gui.graph.node import CanvasNode
ICON_SIZE = 16
class ServiceConfigDialog(Dialog):
def __init__(
@ -51,10 +53,8 @@ class ServiceConfigDialog(Dialog):
self.directory_entry = None
self.default_directories = []
self.temp_directories = []
self.documentnew_img = Images.get(
ImageEnum.DOCUMENTNEW, int(16 * app.app_scale)
)
self.editdelete_img = Images.get(ImageEnum.EDITDELETE, int(16 * app.app_scale))
self.documentnew_img = self.app.get_icon(ImageEnum.DOCUMENTNEW, ICON_SIZE)
self.editdelete_img = self.app.get_icon(ImageEnum.EDITDELETE, ICON_SIZE)
self.notebook = None
self.metadata_entry = None
self.filename_combobox = None