From 02597277844f9c49c891a4d77525ba4b9eafd21b Mon Sep 17 00:00:00 2001 From: itdominator <1itdominator@gmail.com> Date: Wed, 26 Apr 2023 22:00:13 -0500 Subject: [PATCH] Cleanup and default to scale fit window --- src/core/containers/image_list_scroll.py | 3 +-- src/core/widgets/button_controls.py | 9 +++------ src/core/widgets/image_list.py | 1 - src/core/widgets/image_view.py | 2 +- 4 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/core/containers/image_list_scroll.py b/src/core/containers/image_list_scroll.py index 232b358..a39a62d 100644 --- a/src/core/containers/image_list_scroll.py +++ b/src/core/containers/image_list_scroll.py @@ -42,7 +42,6 @@ class ImageListScroll(Gtk.ScrolledWindow): self.image_list_widget = ImageList() self.add(self.image_list_widget) - # TODO: Setup to load range start/end values from settings, # NOTE: Must align with ImageList start/end limits too def _update_list_size_constraints(self, size): self.size = size @@ -77,4 +76,4 @@ class ImageListScroll(Gtk.ScrolledWindow): def _unload_image(self, child): child.hide() # child.image.clear() - child.is_loaded = False + child.is_loaded = False \ No newline at end of file diff --git a/src/core/widgets/button_controls.py b/src/core/widgets/button_controls.py index 82d911d..20726f2 100644 --- a/src/core/widgets/button_controls.py +++ b/src/core/widgets/button_controls.py @@ -35,16 +35,13 @@ class ButtonControls(Gtk.ButtonBox): zoomout_button = Gtk.Button() lrotate_button = Gtk.Button() vflip_button = Gtk.Button() - # NOTE: Toggle Buttons are acting broken for me so workaround ith regular buttons self.one2one_button = Gtk.Button() self.fit_button = Gtk.Button() hflip_button = Gtk.Button() rrotate_button = Gtk.Button() zoomin_button = Gtk.Button() - # TODO: add if check against settings pull to set 1:1 or fit - self._set_class(self.one2one_button) - # self._set_class(self.fit_button) + self._set_class(self.fit_button) zoomout_button.set_tooltip_text("Zoom Out") lrotate_button.set_tooltip_text("Rotate Left") @@ -76,8 +73,8 @@ class ButtonControls(Gtk.ButtonBox): zoomout_button.connect("clicked", self._zoom_out) lrotate_button.connect("clicked", self._rotate_left) vflip_button.connect("clicked", self._vertical_flip) - self.one2one_button.connect("button-release-event", self._scale_1_two_1) - self.fit_button.connect("button-release-event", self._fit_to_container) + self.one2one_button.connect("clicked", self._scale_1_two_1) + self.fit_button.connect("clicked", self._fit_to_container) hflip_button.connect("clicked", self._horizontal_flip) rrotate_button.connect("clicked", self._rotate_right) zoomin_button.connect("clicked", self._zoom_in) diff --git a/src/core/widgets/image_list.py b/src/core/widgets/image_list.py index 4a856bd..9c16c6d 100644 --- a/src/core/widgets/image_list.py +++ b/src/core/widgets/image_list.py @@ -67,7 +67,6 @@ class ImageList(Gtk.Box): event_system.emit("update_list_size_constraints", (len(paths),)) self.show_range() - # TODO: Setup to load range start/end values from settings def show_range(self, i = 0, j = settings.get_max_ring_thumbnail_list()): children = self.get_children() if len(children) <= j: diff --git a/src/core/widgets/image_view.py b/src/core/widgets/image_view.py index 3c8f7b7..cc7b4dc 100644 --- a/src/core/widgets/image_view.py +++ b/src/core/widgets/image_view.py @@ -19,7 +19,7 @@ class ImageView(Gtk.Image): self.pixbuf = None self.work_pixbuf = None self.animation = None - self.fit_to_win = False + self.fit_to_win = True self._setup_styling() self._setup_signals()