2022-10-13 20:58:44 -05:00
|
|
|
# Python imports
|
|
|
|
|
|
2023-01-29 00:06:52 -06:00
|
|
|
# Lib imports
|
2022-10-13 20:58:44 -05:00
|
|
|
import gi
|
|
|
|
|
gi.require_version('Gtk', '3.0')
|
|
|
|
|
from gi.repository import Gtk
|
|
|
|
|
|
|
|
|
|
# Application imports
|
2023-11-19 15:37:11 -06:00
|
|
|
from .header_container import HeaderContainer
|
|
|
|
|
from .body_container import BodyContainer
|
2025-11-29 23:22:03 -06:00
|
|
|
from .footer_container import FooterContainer
|
2022-10-13 20:58:44 -05:00
|
|
|
|
|
|
|
|
|
2023-01-29 00:06:52 -06:00
|
|
|
|
2023-04-23 10:57:12 -05:00
|
|
|
class BaseContainer(Gtk.Box):
|
2022-10-13 20:58:44 -05:00
|
|
|
def __init__(self):
|
2023-04-23 10:57:12 -05:00
|
|
|
super(BaseContainer, self).__init__()
|
2022-10-13 20:58:44 -05:00
|
|
|
|
2023-10-21 18:58:20 -05:00
|
|
|
self.ctx = self.get_style_context()
|
|
|
|
|
|
2022-10-13 20:58:44 -05:00
|
|
|
self._setup_styling()
|
|
|
|
|
self._setup_signals()
|
2023-10-21 18:58:20 -05:00
|
|
|
self._subscribe_to_events()
|
2022-10-13 20:58:44 -05:00
|
|
|
self._load_widgets()
|
|
|
|
|
|
2024-08-31 22:27:11 -05:00
|
|
|
self.show()
|
2022-10-13 20:58:44 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def _setup_styling(self):
|
2023-04-27 23:27:53 -05:00
|
|
|
self.set_orientation(Gtk.Orientation.VERTICAL)
|
2023-10-21 18:58:20 -05:00
|
|
|
self.ctx.add_class("base-container")
|
2022-10-13 20:58:44 -05:00
|
|
|
|
|
|
|
|
def _setup_signals(self):
|
|
|
|
|
...
|
|
|
|
|
|
2023-10-21 18:58:20 -05:00
|
|
|
def _subscribe_to_events(self):
|
2024-02-25 16:19:14 -06:00
|
|
|
event_system.subscribe("update-transparency", self._update_transparency)
|
|
|
|
|
event_system.subscribe("remove-transparency", self._remove_transparency)
|
2023-10-21 18:58:20 -05:00
|
|
|
|
2022-10-13 20:58:44 -05:00
|
|
|
def _load_widgets(self):
|
2023-11-19 15:37:11 -06:00
|
|
|
self.add(HeaderContainer())
|
|
|
|
|
self.add(BodyContainer())
|
2025-11-29 23:22:03 -06:00
|
|
|
self.add(FooterContainer())
|
2023-10-21 18:58:20 -05:00
|
|
|
|
|
|
|
|
def _update_transparency(self):
|
|
|
|
|
self.ctx.add_class(f"mw_transparency_{settings.theming.transparency}")
|
|
|
|
|
|
|
|
|
|
def _remove_transparency(self):
|
2023-11-19 15:37:11 -06:00
|
|
|
self.ctx.remove_class(f"mw_transparency_{settings.theming.transparency}")
|