refactor: remove InfoBarWidget in favor of plugin-based one
- Replace direct InfoBarWidget with set_info_labels command that emits events to plugins - Replace mini view widget in favor of plugin-based one - Add widget registry exposure for code-container and editors-container - Fix DND mixin exec_with_args call (tuple args issue) - Add break statements in tabs_widget loops for efficiency - Add _update_transparency call to BaseContainer
This commit is contained in:
@@ -29,6 +29,7 @@ class BaseContainer(Gtk.Box):
|
||||
self.ctx.add_class("base-container")
|
||||
|
||||
self.set_orientation(Gtk.Orientation.VERTICAL)
|
||||
self._update_transparency()
|
||||
|
||||
def _setup_signals(self):
|
||||
...
|
||||
|
||||
@@ -6,7 +6,6 @@ gi.require_version('Gtk', '3.0')
|
||||
from gi.repository import Gtk
|
||||
|
||||
# Application imports
|
||||
from ..widgets.code.info_bar_widget import InfoBarWidget
|
||||
from .code.code_container import CodeContainer
|
||||
from ..widgets.save_file_dialog import SaveFileDialog
|
||||
from ..widgets.controls.open_files_button import OpenFilesButton
|
||||
@@ -43,9 +42,7 @@ class CenterContainer(Gtk.Box):
|
||||
def _load_widgets(self):
|
||||
widget_registery.expose_object("center-container", self)
|
||||
|
||||
|
||||
SaveFileDialog()
|
||||
OpenFilesButton()
|
||||
|
||||
self.add( InfoBarWidget() )
|
||||
self.add( CodeContainer() )
|
||||
|
||||
@@ -9,7 +9,6 @@ from gi.repository import Gtk
|
||||
from ...widgets.code.code_base import CodeBase
|
||||
|
||||
from ...widgets.separator_widget import Separator
|
||||
from ...widgets.code.mini_view_widget import MiniViewWidget
|
||||
|
||||
from .editors_container import EditorsContainer
|
||||
|
||||
@@ -48,9 +47,11 @@ class CodeContainer(Gtk.Box):
|
||||
def _create_editor_widget(self, code_base: CodeBase):
|
||||
editors_container = Gtk.Box()
|
||||
|
||||
widget_registery.expose_object("code-container", self)
|
||||
widget_registery.expose_object("editors-container", editors_container)
|
||||
|
||||
editors_container.add( Separator("separator_left") )
|
||||
editors_container.add( EditorsContainer(code_base) )
|
||||
editors_container.add( Separator("separator_right") )
|
||||
editors_container.add( code_base.get_mini_view_widget() )
|
||||
|
||||
return editors_container
|
||||
|
||||
@@ -7,7 +7,6 @@ from gi.repository import Gtk
|
||||
|
||||
# Application imports
|
||||
from ..widgets.separator_widget import Separator
|
||||
from ..widgets.controls.transparency_scale import TransparencyScale
|
||||
|
||||
|
||||
|
||||
@@ -20,6 +19,8 @@ class HeaderContainer(Gtk.Box):
|
||||
self._subscribe_to_events()
|
||||
self._load_widgets()
|
||||
|
||||
self.show()
|
||||
|
||||
|
||||
def _setup_styling(self):
|
||||
self.ctx = self.get_style_context()
|
||||
@@ -32,13 +33,9 @@ class HeaderContainer(Gtk.Box):
|
||||
...
|
||||
|
||||
def _subscribe_to_events(self):
|
||||
event_system.subscribe("tggl-top-main-menubar", self.tggl_top_main_menubar)
|
||||
...
|
||||
|
||||
def _load_widgets(self):
|
||||
widget_registery.expose_object("header-container", self)
|
||||
|
||||
self.add( Separator("separator-header", 0) )
|
||||
self.add( TransparencyScale() )
|
||||
|
||||
def tggl_top_main_menubar(self):
|
||||
self.hide() if self.is_visible() else self.show_all()
|
||||
Reference in New Issue
Block a user