Skip to content

Commit

Permalink
Fix color icon loading, relocate gi_composites shim
Browse files Browse the repository at this point in the history
  • Loading branch information
strycore committed Jul 26, 2020
1 parent 50a7ad2 commit d3c1a64
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 21 deletions.
11 changes: 4 additions & 7 deletions lutris/gui/lutriswindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from lutris.gui.views.list import GameListView
from lutris.gui.views.menu import ContextualMenu
from lutris.gui.views.store import GameStore
from lutris.gui.widgets.gi_composites import GtkTemplate
from lutris.gui.widgets.services import SyncServiceWindow
from lutris.gui.widgets.sidebar import SidebarListBox
from lutris.gui.widgets.utils import IMAGE_SIZES, open_uri
Expand All @@ -31,7 +32,6 @@
from lutris.util import datapath, http
from lutris.util.jobs import AsyncCall
from lutris.util.log import logger
from lutris.vendor.gi_composites import GtkTemplate

# from lutris.util.steam.watcher import SteamWatcher

Expand Down Expand Up @@ -196,12 +196,9 @@ def _init_actions(self):
Action(self.on_add_game_button_clicked),
"preferences":
Action(self.on_preferences_activate),
"manage-runners":
Action(self.on_manage_runners),
"about":
Action(self.on_about_clicked),
"show-installed-only":
Action(
"manage-runners": Action(self.on_manage_runners, ),
"about": Action(self.on_about_clicked),
"show-installed-only": Action(
self.on_show_installed_state_change,
type="b",
default=self.filter_installed,
Expand Down
File renamed without changes.
11 changes: 2 additions & 9 deletions lutris/gui/widgets/sidebar.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
"""Sidebar for the main window"""
import os
from gettext import gettext as _

from gi.repository import GObject, Gtk, Pango

from lutris import pga, platforms, runners, settings
from lutris import pga, platforms, runners
from lutris.gui.widgets.utils import load_icon_theme
from lutris.game import Game
from lutris.gui.config.runner import RunnerConfigDialog
from lutris.gui.dialogs.runner_install import RunnerInstallDialog
Expand All @@ -17,13 +17,6 @@
GAMECOUNT = 4


def load_icon_theme():
"""Add the lutris icon folder to the default theme"""
icon_theme = Gtk.IconTheme.get_default()
local_theme_path = os.path.join(settings.RUNTIME_DIR, "icons")
if local_theme_path not in icon_theme.get_search_path():
icon_theme.prepend_search_path(local_theme_path)


class SidebarRow(Gtk.ListBoxRow):

Expand Down
10 changes: 9 additions & 1 deletion lutris/gui/widgets/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def get_icon(icon_name, icon_format="image", size=None, icon_type="runner"):
icon_type -- Retrieve either a 'runner' or 'platform' icon (default 'runner')
"""
filename = icon_name.lower().replace(" ", "") + ".png"
icon_path = os.path.join(datapath.get(), "media/" + icon_type + "_icons", filename)
icon_path = os.path.join(settings.RUNTIME_DIR, "icons/hicolor/64x64/apps", filename)
if not os.path.exists(icon_path):
logger.error("Unable to find icon '%s'", icon_path)
return None
Expand Down Expand Up @@ -214,3 +214,11 @@ def get_link_button(text):
button.get_style_context().add_class("panel-button")
button.set_size_request(-1, 24)
return button


def load_icon_theme():
"""Add the lutris icon folder to the default theme"""
icon_theme = Gtk.IconTheme.get_default()
local_theme_path = os.path.join(settings.RUNTIME_DIR, "icons")
if local_theme_path not in icon_theme.get_search_path():
icon_theme.prepend_search_path(local_theme_path)
5 changes: 1 addition & 4 deletions lutris/util/resources.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
"""Utility module to handle media resources"""
# Standard Library
import os

# Third Party Libraries
from gi.repository import GLib
from gi.repository import GLib, Gtk

# Lutris Modules
from lutris import settings
from lutris.util import system
from lutris.util.http import HTTPError, Request
Expand Down

0 comments on commit d3c1a64

Please sign in to comment.