Skip to content

Commit

Permalink
Init Gdk, fixes #32
Browse files Browse the repository at this point in the history
  • Loading branch information
berarma committed Sep 16, 2020
1 parent d257e70 commit be2dddb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion oversteer/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def run(self, argv):
self.device_manager = device_manager
self.device = device
from oversteer.gui import Gui
Gui(self)
Gui(self, argv)

device_manager.stop()

Expand Down
3 changes: 2 additions & 1 deletion oversteer/gtk_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@

class GtkUi:

def __init__(self, gui):
def __init__(self, gui, argv):
self.gui = gui
self.ffbmeter_timer = False
self.overlay_window_pos = (20, 20)

Gdk.init(argv)
style_provider = Gtk.CssProvider()
style_provider.load_from_path(os.path.join(os.path.dirname(os.path.realpath(__file__)), 'main.css'))
Gtk.StyleContext.add_provider_for_screen(
Expand Down
4 changes: 2 additions & 2 deletions oversteer/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

class Gui:

def __init__(self, application):
def __init__(self, application, argv):
self.app = application
self.locale = ''
self.device_manager = self.app.device_manager
Expand Down Expand Up @@ -67,7 +67,7 @@ def __init__(self, application):
if not os.path.isdir(self.profile_path):
os.makedirs(self.profile_path, 0o700)

self.ui = GtkUi(self)
self.ui = GtkUi(self, argv)
self.ui.set_app_version(self.app.version)
self.ui.set_app_icon(os.path.join(self.app.icondir, 'org.berarma.Oversteer.svg'))
self.ui.set_languages(self.languages)
Expand Down

0 comments on commit be2dddb

Please sign in to comment.