diff --git a/README.md b/README.md index a08b7e1..37893e2 100644 --- a/README.md +++ b/README.md @@ -35,6 +35,8 @@ Geolocation records from [DB-IP](https://db-ip.com) under [CC 4.0 license](https Executable versions of DZGUI published as release binaries ship with various runtime dependencies and the Python interpreter built in. Users wishing to review the licenses to these components can inspect the `LICENSE` file located in the release tarball. +Steam and the Steam logo are trademarks and/or registered trademarks of Valve Corporation in the U.S. and/or other countries. + ## Disclaimer DZGUI is beta-quality software and is provided as-is. diff --git a/dzgui/app_init.py b/dzgui/app_init.py index 77d076f..dbd01ea 100644 --- a/dzgui/app_init.py +++ b/dzgui/app_init.py @@ -2,17 +2,12 @@ import logging import os import shutil +from importlib import resources from pathlib import Path from typing import TYPE_CHECKING -from warnings import deprecated -from dzgui.const.constants import ( - APP_NAME, - FLATPAK_ROOT_PATH, - STEAM_ICON, - STEAM_ICONS_PATH, -) +from dzgui.const.constants import APP_NAME, APP_NAME_LOWER, FLATPAK_ROOT_PATH, ICONS_PATH from dzgui.const.enum import Preferences from dzgui.config.query import lookup from dzgui.config.userprefs import UserPrefs @@ -31,7 +26,7 @@ from dzgui.util.dirs import make_parents from dzgui.util.localize import set_locale from dzgui.util.map_count import test_map_count from dzgui.util.redact import RedactionFilter, REDACTION_PATTERNS -from dzgui.util.strings import init, steam_icon_missing +from dzgui.util.strings import init from dzgui.views.base import App from dzgui.views.dialogs.boot import BootWindow @@ -104,26 +99,20 @@ def copy_bare_configs(config: "Path", resolution: "Path") -> tuple[bool, bool]: return (config_changed, state_changed) -@deprecated("Currently unused") -def load_steam_icon(config: Path) -> None: +def load_steam_icon() -> None: import gi gi.require_version("Gtk", "3.0") - from gi.repository import Gtk # noqa - - default = lookup(config, Preferences.DEFAULT) - icon_path = Path(default).joinpath(STEAM_ICONS_PATH) + from gi.repository import Gtk # noqa try: + traversable = resources.files(APP_NAME_LOWER).joinpath(ICONS_PATH) + icons = Path(str(traversable)) + theme = Gtk.IconTheme.get_default() paths = theme.get_search_path() - theme.set_search_path(paths + [str(icon_path)]) - paths = theme.get_search_path() - icons = theme.list_icons(None) - if STEAM_ICON not in icons: - logger.warning(steam_icon_missing) + theme.set_search_path(paths + [str(icons)]) except Exception as e: - print(e) - logger.warning(e) + logger.critical(e) def load_gui(version: str, is_debug: bool) -> None: @@ -189,5 +178,6 @@ def load_gui(version: str, is_debug: bool) -> None: use_miles=use_miles, ) print(boot.all_ok) + load_steam_icon() app = App(prefs) app.run(None) diff --git a/dzgui/const/constants.py b/dzgui/const/constants.py index 02061ea..6d062cd 100644 --- a/dzgui/const/constants.py +++ b/dzgui/const/constants.py @@ -51,7 +51,7 @@ INPUT_KEYBOARD = "input-keyboard-symbolic" LIST_ADD = "list-add-symbolic" REFRESH_ICON = "view-refresh-symbolic" SEARCH_ICON = "system-search-symbolic" -STEAM_ICON = "steam_tray_mono" +STEAM_ICON = "steam-tray-symbolic" VIEW_CONCEAL = "view-conceal-symbolic" VIEW_REVEAL = "view-reveal-symbolic" WARNING = "dialog-warning-symbolic" @@ -80,6 +80,7 @@ DEBUG_LOG = f"{APP_NAME}_DEBUG.LOG" SYSTEM_LOG = f"{APP_NAME}_SYSTEM.LOG" CHANGELOG_PATH = "data/CHANGELOG.md" IMAGES_PATH = "data/images" +ICONS_PATH = "data/images/gtk" HERO_PATH = "data/images/_hero.png" CSS_PATH = "data/app.css" @@ -89,7 +90,6 @@ FLATPAK_ROOT_PATH = ".var/app/com.valvesoftware.Steam" FLATPAK_STEAM_PATH = FLATPAK_ROOT_PATH + "/data/Steam" UBUNTU_STEAM_PATH = ".steam/steam" DEBIAN_STEAM_PATH = ".steam/debian-installation" -STEAM_ICONS_PATH = "public" LOG_FILTERS = ("CRITICAL", "WARNING", "INFO", "DEBUG") diff --git a/dzgui/data/images/gtk/steam-tray-symbolic.svg b/dzgui/data/images/gtk/steam-tray-symbolic.svg new file mode 100644 index 0000000..8f1c790 --- /dev/null +++ b/dzgui/data/images/gtk/steam-tray-symbolic.svg @@ -0,0 +1 @@ + \ No newline at end of file