|
1 |
| -"""SC-Controller - App. |
| 1 | +"""SC Controller - App. |
2 | 2 |
|
3 | 3 | Main application window
|
4 | 4 | """
|
|
40 | 40 | class App(Gtk.Application, UserDataManager, BindingEditor):
|
41 | 41 | """Main application / window."""
|
42 | 42 |
|
43 |
| - HILIGHT_COLOR = "#FF00FF00" # ARGB |
44 |
| - OBSERVE_COLOR = "#FF60A0FF" # ARGB |
| 43 | + HILIGHT_COLOR = "#FF00FF00" # ARGB |
| 44 | + OBSERVE_COLOR = "#FF60A0FF" # ARGB |
45 | 45 | CONFIG = "scc.config.json"
|
46 | 46 | RELEASE_URL = "https://github.com/C0rn3j/sc-controller/releases/tag/v%s"
|
47 | 47 | OSD_MODE_PROF_NAME = ".scc-osd.profile_editor"
|
@@ -276,14 +276,15 @@ def apply_ui_layout(self, layout):
|
276 | 276 | btLGRIP.get_parent().reorder_child(btDPAD, 5)
|
277 | 277 |
|
278 | 278 |
|
279 |
| - def setup_statusicon(self): |
| 279 | + def setup_statusicon(self) -> None: |
280 | 280 | menu = self.builder.get_object("mnuTray")
|
281 | 281 | self.statusicon = get_status_icon(self.imagepath, menu)
|
282 |
| - self.statusicon.connect('clicked', self.on_statusicon_clicked) |
283 |
| - if not self.statusicon.is_clickable(): |
284 |
| - self.builder.get_object("mnuShowWindowTray").set_visible(True) |
285 |
| - GLib.idle_add(self.statusicon.set, "scc-%s" % (self.status,), _("SC Controller")) |
286 |
| - |
| 282 | + self.statusicon.connect("clicked", self.on_statusicon_clicked) |
| 283 | +# if not self.statusicon.is_clickable(): |
| 284 | +# self.builder.get_object("mnuShowWindowTray").set_visible(True) |
| 285 | + # Workaround - always add it to the menu, see https://github.com/C0rn3j/sc-controller/issues/53 |
| 286 | + self.builder.get_object("mnuShowWindowTray").set_visible(True) |
| 287 | + GLib.idle_add(self.statusicon.set, f"scc-{self.status}", _("SC Controller")) |
287 | 288 |
|
288 | 289 | def destroy_statusicon(self):
|
289 | 290 | self.statusicon.destroy()
|
@@ -454,8 +455,8 @@ def save_config(self):
|
454 | 455 | self.enable_test_mode()
|
455 | 456 |
|
456 | 457 |
|
457 |
| - def on_statusicon_clicked(self, *a): |
458 |
| - """ Handler for user clicking on tray icon button """ |
| 458 | + def on_statusicon_clicked(self, *a) -> None: |
| 459 | + """Handler for user clicking on tray icon button.""" |
459 | 460 | self.window.set_visible(not self.window.get_visible())
|
460 | 461 |
|
461 | 462 |
|
@@ -865,7 +866,7 @@ def on_mnuExit_activate(self, *a):
|
865 | 866 | self.quit()
|
866 | 867 |
|
867 | 868 |
|
868 |
| - def on_mnuAbout_activate(self, *a): |
| 869 | + def on_mnuAbout_activate(self, *a) -> None: |
869 | 870 | from scc.gui.aboutdialog import AboutDialog
|
870 | 871 | AboutDialog(self).show(self.window)
|
871 | 872 |
|
@@ -1354,7 +1355,7 @@ def on_mnuEmulationEnabled_toggled(self, cb):
|
1354 | 1355 | self.dm.stop()
|
1355 | 1356 |
|
1356 | 1357 |
|
1357 |
| - def do_startup(self, *a): |
| 1358 | + def do_startup(self, *a) -> None: |
1358 | 1359 | Gtk.Application.do_startup(self, *a)
|
1359 | 1360 | self.load_profile_list()
|
1360 | 1361 | self.setup_widgets()
|
|
0 commit comments