Skip to content

Commit

Permalink
fix: Scale all components based on dpi
Browse files Browse the repository at this point in the history
  • Loading branch information
tomlin7 committed Jul 12, 2023
1 parent 108976b commit df61777
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 23 deletions.
8 changes: 4 additions & 4 deletions biscuit/core/components/editors/misc/welcome.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
class Welcome(BaseEditor):
def __init__(self, master, exists=False, editable=False, *args, **kwargs):
super().__init__(master, exists=exists, editable=editable, *args, **kwargs)
self.config(padx=100, pady=100, **self.base.theme.editors)
self.config(padx=100, pady=50, **self.base.theme.editors)

self.left = Frame(self, **self.base.theme.editors)
self.left.pack(expand=True, side=tk.LEFT, fill=tk.BOTH, anchor=tk.CENTER)

self.right = Frame(self, **self.base.theme.editors)
self.right.pack(expand=True, fill=tk.BOTH, anchor=tk.CENTER)

self.title = Label(self.left, text="Biscuit", font=("Segoe UI", 45), fg=self.base.theme.biscuit, **self.base.theme.editors.biscuit_labels)
self.title = Label(self.left, text="Biscuit", font=("Segoe UI", 50), fg=self.base.theme.biscuit, **self.base.theme.editors.biscuit_labels)
self.title.grid(row=0, column=0, sticky=tk.W)

self.description = Label(self.left, text="Made with ❤", font=("Segoe UI", 20), fg=self.base.theme.biscuit_light, **self.base.theme.editors.biscuit_labels)
self.description = Label(self.left, text="Made with ❤", font=("Segoe UI", 20), fg=self.base.theme.biscuit_dark, **self.base.theme.editors.biscuit_labels)
self.description.grid(row=1, column=0, sticky=tk.W, pady=5)

self.create_start_group()
Expand All @@ -27,7 +27,7 @@ def __init__(self, master, exists=False, editable=False, *args, **kwargs):
self.logo.grid(row=0, column=0, sticky=tk.NSEW)

def create_start_group(self):
Label(self.left, text="Start", font=("Segoe UI", 15), **self.base.theme.editors.labels).grid(row=2, column=0, sticky=tk.W, pady=(30, 0))
Label(self.left, text="Start", font=("Segoe UI", 15), **self.base.theme.editors.labels).grid(row=2, column=0, sticky=tk.W, pady=(40, 0))
start_group = Frame(self.left, **self.base.theme.editors)
start_group.grid(row=3, column=0, sticky=tk.EW)

Expand Down
2 changes: 1 addition & 1 deletion biscuit/core/components/floating/menu/separator.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ def __init__(self, master, *args, **kwargs):
self.master = master

self.config(
text="———————————————————————", pady=0,
text="—"*round((18*self.base.scale)), pady=0,
height=1, **self.base.theme.menu, fg=self.base.theme.border
)
2 changes: 1 addition & 1 deletion biscuit/core/components/floating/notifications/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(self, base):
self.overrideredirect(True)

self.offset = 10
self.minsize(width=400, height=20)
self.minsize(width=round(300*self.base.scale), height=round(15*self.base.scale))

self.icon = Icon(self, 'info', padx=5, **self.base.theme.notifications.text)
self.icon.pack(side=tk.LEFT, fill=tk.BOTH)
Expand Down
2 changes: 1 addition & 1 deletion biscuit/core/components/utils/bubble.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def __init__(self, master, text, bd=1, *args, **kw):
super().__init__(master, *args, **kw)
self.overrideredirect(True)
self.config(bg=self.base.theme.border)
Label(self, text=text, padx=5, pady=5, **self.base.theme.utils.bubble).pack(padx=bd, pady=bd)
Label(self, text=text, padx=5, pady=5, font=("Segoi UI", 10), **self.base.theme.utils.bubble).pack(padx=bd, pady=bd)
self.withdraw()

def get_pos(self):
Expand Down
2 changes: 1 addition & 1 deletion biscuit/core/components/utils/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ class Button(Menubutton):
"""
def __init__(self, master, text, command=lambda _: None, *args, **kwargs):
super().__init__(master, text=text, *args, **kwargs)
self.config(pady=5, **self.base.theme.utils.button)
self.config(pady=5, font=("Segoi UI", 10), **self.base.theme.utils.button)
self.bind('<Button-1>', command)
2 changes: 1 addition & 1 deletion biscuit/core/components/utils/buttonsentry.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, master, hint="", buttons=(), textvariable=None, *args, **kwar
self.grid_columnconfigure(0, weight=1)
self.grid_rowconfigure(0, weight=1)

self.entry = HintedEntry(self, relief=tk.FLAT, bd=5, hint=hint, **self.base.theme.utils.buttonsentry, textvariable=textvariable)
self.entry = HintedEntry(self, relief=tk.FLAT, font=("Segoi UI", 10), bd=5, hint=hint, **self.base.theme.utils.buttonsentry, textvariable=textvariable)
self.entry.grid(row=0, column=0, sticky=tk.NSEW)

self.column = 1
Expand Down
2 changes: 1 addition & 1 deletion biscuit/core/components/utils/entry.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def __init__(self, master, hint="", *args, **kwargs):
self.config(padx=1, pady=1, bg=self.base.theme.border)
self.grid_columnconfigure(0, weight=1)

self.entry = HintedEntry(self, relief=tk.FLAT, **self.base.theme.utils.entry, bd=5, hint=hint)
self.entry = HintedEntry(self, relief=tk.FLAT, font=("Segoi UI", 10), **self.base.theme.utils.entry, bd=5, hint=hint)
self.entry.config(*args, **kwargs)
self.entry.grid(row=0, column=0, sticky=tk.NSEW)

Expand Down
2 changes: 1 addition & 1 deletion biscuit/core/components/utils/icon.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Icon(Label):
"""
Button with only an icon
"""
def __init__(self, master, icon, iconsize=12, *args, **kwargs):
def __init__(self, master, icon, iconsize=14, *args, **kwargs):
super().__init__(master, *args, **kwargs)
self.icon = icon
self.config(text=get_codicon(icon), font=("codicon", iconsize))
Expand Down
4 changes: 2 additions & 2 deletions biscuit/core/components/utils/iconlabelbutton.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ def __init__(self, master, text=None, icon=None, function=lambda *_: None, padx=

if icon:
self.icon_label = tk.Label(self, text=get_codicon(self.icon), anchor=tk.CENTER,
bg=self.bg, fg=self.fg, font=("codicon", 12))
bg=self.bg, fg=self.fg, font=("codicon", 14))
self.icon_label.pack(side=tk.LEFT, fill=tk.BOTH, expand=True)

if text:
self.text_label = tk.Label(self, text=self.text, anchor=tk.CENTER, pady=2,
bg=self.bg, fg=self.fg, font=("Segoe UI", 9))
bg=self.bg, fg=self.fg, font=("Segoe UI", 10))
self.text_label.pack(side=tk.LEFT, fill=tk.BOTH, expand=True)

self.config_bindings()
Expand Down
2 changes: 1 addition & 1 deletion biscuit/core/components/utils/shortcut.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ def add_separator(self):
def add_shortcut(self, shortcut):
tk.Label(
self, text=shortcut, bg=self.base.theme.border, fg=self.base.theme.biscuit_dark,
font=("Consolas", 8)).pack(padx=2, side=tk.LEFT)
font=("Consolas", 10)).pack(padx=2, side=tk.LEFT)
2 changes: 1 addition & 1 deletion biscuit/core/components/views/sidebar/itembar.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def __init__(self, master, title=None, buttons=(), *args, **kwargs):
self.toggle = IconButton(self, icon='chevron-down', event=self.toggle_content, width=1)
self.toggle.grid(row=0, column=0)

self.label_title = tk.Label(self, anchor=tk.W, textvariable=self.title, **self.base.theme.views.sidebar.itembar.title)
self.label_title = tk.Label(self, anchor=tk.W, textvariable=self.title, font=("Segoi UI", 9, "bold"), **self.base.theme.views.sidebar.itembar.title)
self.label_title.grid(row=0, column=1, sticky=tk.EW)

self.buttoncolumn = 0
Expand Down
4 changes: 2 additions & 2 deletions biscuit/core/components/views/sidebar/sidebarview.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ def __init__(self, master, *args, **kwargs):
self.config(width=300, **self.base.theme.views.sidebar)

top = Frame(self, **self.base.theme.views.sidebar)
top.pack(fill=X, padx=(15, 10), pady=5)
top.pack(fill=X, padx=(15, 10), pady=7)
top.grid_columnconfigure(0, weight=1)

tk.Label(top, text=self.__class__.__name__.upper(), anchor=W,
tk.Label(top, text=self.__class__.__name__.upper(), anchor=W, font=("Segoi UI", 8),
**self.base.theme.views.sidebar.title).grid(row=0, column=0, sticky=EW)

column = 1
Expand Down
2 changes: 1 addition & 1 deletion biscuit/core/layout/base/sidebar/slot.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def __init__(self, master, view, *args, **kwargs):
self.bind('<Leave>', self.bubble.hide)

self.config(text=get_codicon(view.__icon__), relief=tk.FLAT, font=("codicon", 20),
padx=10, pady=10, **self.base.theme.layout.base.sidebar.slots.slot)
padx=13, pady=11, **self.base.theme.layout.base.sidebar.slots.slot)
self.pack(fill=tk.X, side=tk.TOP)

self.bind('<Button-1>', self.toggle)
Expand Down
8 changes: 4 additions & 4 deletions biscuit/core/layout/statusbar/utils/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ def __init__(self, master, text=None, icon=None, function=lambda *_: None, descr
if icon:
self.icon_label = tk.Label(self, text=get_codicon(self.icon), anchor=tk.CENTER,
bg=self.bg, fg=self.fg, font=("codicon", 12))
self.icon_label.pack(side=tk.LEFT, fill=tk.BOTH, expand=True)
self.icon_label.pack(side=tk.LEFT, fill=tk.Y, expand=True)

if text:
self.text_label = tk.Label(self, text=self.text, anchor=tk.CENTER, pady=2,
bg=self.bg, fg=self.fg, font=("Segoe UI", 9))
self.text_label.pack(side=tk.LEFT, fill=tk.BOTH, expand=True)
self.text_label = tk.Label(self, text=self.text, anchor=tk.CENTER,
bg=self.bg, fg=self.fg, pady=2, font=("Segoe UI", 9))
self.text_label.pack(side=tk.LEFT, fill=tk.Y, expand=True)

self.config_bindings()
self.visible = False
Expand Down
2 changes: 1 addition & 1 deletion biscuit/core/settings/config/theme/theme.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ def __init__(self, *args, **kwargs):
self.base = BasePane(self)

self.statusbar = FrameThemeObject(self)
self.statusbar.button = HighlightableThemeObject(self.statusbar).remove_bg_highlight()
self.statusbar.button = HighlightableThemeObject(self.statusbar)

class SidebarViews(FrameThemeObject):
def __init__(self, *args, **kwargs):
Expand Down

0 comments on commit df61777

Please sign in to comment.