Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions BlocksScreen/lib/panels/mainWindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from lib.ui.resources.main_menu_resources_rc import *
from lib.ui.resources.top_bar_resources_rc import *
from lib.updater_worker import UpdaterWorker
from lib.utils.fonts import register_momcake
from PyQt6 import QtCore, QtGui, QtWidgets
from screensaver import ScreenSaver

Expand Down Expand Up @@ -121,6 +122,8 @@ def __init__(self):
"""Set up UI, instantiate subsystems, and wire all inter-component signals."""
super(MainWindow, self).__init__()
self.config: BlocksScreenConfig = get_configparser()
# Before setupUi: the topbar .svg icons carry text and paint on first show.
register_momcake()
self.ui = Ui_MainWindow()
self.ui.setupUi(self)
self.screensaver = ScreenSaver(self)
Expand Down
6 changes: 2 additions & 4 deletions BlocksScreen/lib/panels/widgets/inputshaperPage.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from lib.utils.blocks_button import BlocksCustomButton
from lib.utils.blocks_frame import BlocksCustomFrame
from lib.utils.fonts import register_momcake
from lib.utils.icon_button import IconButton
from lib.utils.list_model import EntryDelegate, EntryListModel, ListItem
from PyQt6 import QtCore, QtGui, QtWidgets
Expand Down Expand Up @@ -135,10 +136,7 @@ def add_type_entry(self, cli_name: str, recommended: str = "") -> None:

def _setupUI(self) -> None:
"""Setup UI for updatePage"""
font_id = QtGui.QFontDatabase.addApplicationFont(
":/font/media/fonts for text/Momcake-Bold.ttf"
)
font_family = QtGui.QFontDatabase.applicationFontFamilies(font_id)[0]
font_family = register_momcake()
sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Policy.MinimumExpanding,
QtWidgets.QSizePolicy.Policy.MinimumExpanding,
Expand Down
6 changes: 2 additions & 4 deletions BlocksScreen/lib/panels/widgets/sensorsPanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from lib.panels.widgets.sensorWidget import SensorWidget
from lib.utils.blocks_frame import BlocksCustomFrame
from lib.utils.fonts import register_momcake
from lib.utils.icon_button import IconButton
from lib.utils.list_model import EntryDelegate, EntryListModel, ListItem
from PyQt6 import QtCore, QtGui, QtWidgets
Expand Down Expand Up @@ -130,10 +131,7 @@ def create_sensor_widget(self, name: str) -> SensorWidget:

def _setupUi(self) -> None:
"""Setup UI for updatePage"""
font_id = QtGui.QFontDatabase.addApplicationFont(
":/font/media/fonts for text/Momcake-Bold.ttf"
)
font_family = QtGui.QFontDatabase.applicationFontFamilies(font_id)[0]
font_family = register_momcake()
sizePolicy = QtWidgets.QSizePolicy(
QtWidgets.QSizePolicy.Policy.MinimumExpanding,
QtWidgets.QSizePolicy.Policy.MinimumExpanding,
Expand Down
14 changes: 5 additions & 9 deletions BlocksScreen/lib/panels/widgets/updatePage.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import typing
from types import MappingProxyType

from lib.utils.fonts import register_momcake
from PyQt6 import QtCore, QtGui, QtWidgets

from BlocksScreen.lib.panels.widgets.basePopup import BasePopup
Expand Down Expand Up @@ -492,15 +493,10 @@ def show_loading(self, loading: bool = False) -> None:
self.disable_popups.emit(loading)

def _setupUI(self) -> None:
bold_id = QtGui.QFontDatabase.addApplicationFont(
":/font/media/fonts for text/Momcake-Bold.ttf"
)
self._font_family = QtGui.QFontDatabase.applicationFontFamilies(bold_id)[0]
thin_id = QtGui.QFontDatabase.addApplicationFont(
":/font/media/fonts for text/Momcake-Thin.ttf"
)
thin_families = QtGui.QFontDatabase.applicationFontFamilies(thin_id)
_title_family = thin_families[0] if thin_families else ""
# Qt files the Thin and Bold faces under one family, so both ids gave the
# same name here; the weight is chosen per QFont, not per family.
self._font_family = register_momcake()
_title_family = self._font_family

self.setObjectName("updatePage")
self.setStyleSheet(
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading