mirror of
https://github.com/aclist/dztui.git
synced 2026-10-25 12:12:31 +01:00
feat: add eventbox to offline mods page
This commit is contained in:
1 parent
525de56036
commit
ec7828df85
3 files changed
+20
-4
No files matched your search
@@ -1,4 +1,7 @@
|
|||||||
heading = "Play offline"
|
heading = "Play offline"
|
||||||
|
heading_disclaimer = (
|
||||||
|
"Not all mod combinations will function offline. Use at your own discretion."
|
||||||
|
)
|
||||||
|
|
||||||
mission_button = "Select mission folder"
|
mission_button = "Select mission folder"
|
||||||
mission_frame = "Mission"
|
mission_frame = "Mission"
|
||||||
|
|||||||
@@ -30,6 +30,9 @@ class InfoEventBox(Gtk.EventBox):
|
|||||||
self.connect("leave-notify-event", self._on_leave_tooltip)
|
self.connect("leave-notify-event", self._on_leave_tooltip)
|
||||||
self.add(box)
|
self.add(box)
|
||||||
|
|
||||||
|
def set_icon_yalign(self, offset: float) -> None:
|
||||||
|
self.icon.set_property("yalign", offset)
|
||||||
|
|
||||||
def _on_enter_tooltip(
|
def _on_enter_tooltip(
|
||||||
self, eventbox: Gtk.EventBox, eventcrossing: Gdk.EventCrossing
|
self, eventbox: Gtk.EventBox, eventcrossing: Gdk.EventCrossing
|
||||||
) -> None:
|
) -> None:
|
||||||
|
|||||||
@@ -41,9 +41,18 @@ class FolderError(Enum):
|
|||||||
FOLDER_CHANGED = 3
|
FOLDER_CHANGED = 3
|
||||||
|
|
||||||
|
|
||||||
class PageHeading(Gtk.Label):
|
class PageHeading(Gtk.Box):
|
||||||
def __init__(self, label: str) -> None:
|
def __init__(self, label: str, controller: "Controller") -> None:
|
||||||
super().__init__(label=label, halign=Gtk.Align.CENTER)
|
super().__init__(
|
||||||
|
halign=Gtk.Align.CENTER, orientation=Gtk.Orientation.HORIZONTAL
|
||||||
|
)
|
||||||
|
|
||||||
|
self.label = Gtk.Label(label=label)
|
||||||
|
self.eb = InfoEventBox(offline.heading_disclaimer, controller)
|
||||||
|
self.eb.set_icon_yalign(0.7)
|
||||||
|
|
||||||
|
for el in self.label, self.eb:
|
||||||
|
self.add(el)
|
||||||
|
|
||||||
css.add_class(self, "page-heading")
|
css.add_class(self, "page-heading")
|
||||||
|
|
||||||
@@ -434,7 +443,8 @@ class OfflineLoader(Gtk.Box):
|
|||||||
self.emitter = controller.get_emitter()
|
self.emitter = controller.get_emitter()
|
||||||
self.offline_man = OfflineManager(controller)
|
self.offline_man = OfflineManager(controller)
|
||||||
|
|
||||||
self.add(PageHeading(offline.heading))
|
heading = PageHeading(offline.heading, controller)
|
||||||
|
self.add(heading)
|
||||||
|
|
||||||
self.local_frame = ModFrame(self, controller, offline.local_frame)
|
self.local_frame = ModFrame(self, controller, offline.local_frame)
|
||||||
self.custom_frame = CustomModFrame(self, controller, offline.custom_frame)
|
self.custom_frame = CustomModFrame(self, controller, offline.custom_frame)
|
||||||
|
|||||||
Reference in new issue
Block a user