Browse Source

Get working UI templates import

unifiedWindowUI
Luke Murphy 4 years ago
parent
commit
7631bfe02a
No known key found for this signature in database GPG Key ID: 5E2EF5A63E3718CC
  1. 9
      dropship/dropship.py
  2. 7
      dropship/ui_templates.py

9
dropship/dropship.py

@ -11,7 +11,9 @@ require_version("Gdk", "3.0")
from gi.repository import Gdk, GLib, Gtk from gi.repository import Gdk, GLib, Gtk
from dropship.templates import pendingTransferRow from dropship.ui_templates import pendingTransferRow
CWD = Path(__file__).absolute().parent
class DropShip: class DropShip:
@ -19,9 +21,8 @@ class DropShip:
def __init__(self, nursery): def __init__(self, nursery):
"""Object initialisation.""" """Object initialisation."""
self.CWD = Path(__file__).absolute().parent self.GLADE_FILE = f"{CWD}/ui/dropship.ui"
self.GLADE_FILE = f"{self.CWD}/ui/dropship.ui" self.CSS_FILE = f"{CWD}/ui/dropship.css"
self.CSS_FILE = f"{self.CWD}/ui/dropship.css"
self.clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD) self.clipboard = Gtk.Clipboard.get(Gdk.SELECTION_CLIPBOARD)
self.nursery = nursery self.nursery = nursery

7
dropship/ui_templates.py

@ -1,10 +1,15 @@
from pathlib import Path
import gi import gi
gi.require_version("Gtk", "3.0") gi.require_version("Gtk", "3.0")
from gi.repository import Gdk, GLib, Gtk from gi.repository import Gdk, GLib, Gtk
CWD = Path(__file__).absolute().parent
@Gtk.Template.from_file("pendingTransferRow.ui") @Gtk.Template.from_file(f"{CWD}/ui/pendingTransferRow.ui")
class pendingTransferRow(Gtk.ListBoxRow): class pendingTransferRow(Gtk.ListBoxRow):
__gtype_name__ = "PendingTransferRow" __gtype_name__ = "PendingTransferRow"

Loading…
Cancel
Save