Cleanup and default to scale fit window
This commit is contained in:
		@@ -42,7 +42,6 @@ class ImageListScroll(Gtk.ScrolledWindow):
 | 
				
			|||||||
        self.image_list_widget = ImageList()
 | 
					        self.image_list_widget = ImageList()
 | 
				
			||||||
        self.add(self.image_list_widget)
 | 
					        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
 | 
					    # NOTE: Must align with ImageList start/end limits too
 | 
				
			||||||
    def _update_list_size_constraints(self, size):
 | 
					    def _update_list_size_constraints(self, size):
 | 
				
			||||||
        self.size  = size
 | 
					        self.size  = size
 | 
				
			||||||
@@ -77,4 +76,4 @@ class ImageListScroll(Gtk.ScrolledWindow):
 | 
				
			|||||||
    def _unload_image(self, child):
 | 
					    def _unload_image(self, child):
 | 
				
			||||||
        child.hide()
 | 
					        child.hide()
 | 
				
			||||||
        # child.image.clear()
 | 
					        # child.image.clear()
 | 
				
			||||||
        child.is_loaded = False
 | 
					        child.is_loaded = False
 | 
				
			||||||
@@ -35,16 +35,13 @@ class ButtonControls(Gtk.ButtonBox):
 | 
				
			|||||||
        zoomout_button = Gtk.Button()
 | 
					        zoomout_button = Gtk.Button()
 | 
				
			||||||
        lrotate_button = Gtk.Button()
 | 
					        lrotate_button = Gtk.Button()
 | 
				
			||||||
        vflip_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.one2one_button = Gtk.Button()
 | 
				
			||||||
        self.fit_button     = Gtk.Button()
 | 
					        self.fit_button     = Gtk.Button()
 | 
				
			||||||
        hflip_button   = Gtk.Button()
 | 
					        hflip_button   = Gtk.Button()
 | 
				
			||||||
        rrotate_button = Gtk.Button()
 | 
					        rrotate_button = Gtk.Button()
 | 
				
			||||||
        zoomin_button  = Gtk.Button()
 | 
					        zoomin_button  = Gtk.Button()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # TODO: add if check against settings pull to set 1:1 or fit
 | 
					        self._set_class(self.fit_button)
 | 
				
			||||||
        self._set_class(self.one2one_button)
 | 
					 | 
				
			||||||
        # self._set_class(self.fit_button)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        zoomout_button.set_tooltip_text("Zoom Out")
 | 
					        zoomout_button.set_tooltip_text("Zoom Out")
 | 
				
			||||||
        lrotate_button.set_tooltip_text("Rotate Left")
 | 
					        lrotate_button.set_tooltip_text("Rotate Left")
 | 
				
			||||||
@@ -76,8 +73,8 @@ class ButtonControls(Gtk.ButtonBox):
 | 
				
			|||||||
        zoomout_button.connect("clicked", self._zoom_out)
 | 
					        zoomout_button.connect("clicked", self._zoom_out)
 | 
				
			||||||
        lrotate_button.connect("clicked", self._rotate_left)
 | 
					        lrotate_button.connect("clicked", self._rotate_left)
 | 
				
			||||||
        vflip_button.connect("clicked", self._vertical_flip)
 | 
					        vflip_button.connect("clicked", self._vertical_flip)
 | 
				
			||||||
        self.one2one_button.connect("button-release-event", self._scale_1_two_1)
 | 
					        self.one2one_button.connect("clicked", self._scale_1_two_1)
 | 
				
			||||||
        self.fit_button.connect("button-release-event", self._fit_to_container)
 | 
					        self.fit_button.connect("clicked", self._fit_to_container)
 | 
				
			||||||
        hflip_button.connect("clicked", self._horizontal_flip)
 | 
					        hflip_button.connect("clicked", self._horizontal_flip)
 | 
				
			||||||
        rrotate_button.connect("clicked", self._rotate_right)
 | 
					        rrotate_button.connect("clicked", self._rotate_right)
 | 
				
			||||||
        zoomin_button.connect("clicked", self._zoom_in)
 | 
					        zoomin_button.connect("clicked", self._zoom_in)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -67,7 +67,6 @@ class ImageList(Gtk.Box):
 | 
				
			|||||||
        event_system.emit("update_list_size_constraints", (len(paths),))
 | 
					        event_system.emit("update_list_size_constraints", (len(paths),))
 | 
				
			||||||
        self.show_range()
 | 
					        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()):
 | 
					    def show_range(self, i = 0, j = settings.get_max_ring_thumbnail_list()):
 | 
				
			||||||
        children = self.get_children()
 | 
					        children = self.get_children()
 | 
				
			||||||
        if len(children) <= j:
 | 
					        if len(children) <= j:
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -19,7 +19,7 @@ class ImageView(Gtk.Image):
 | 
				
			|||||||
        self.pixbuf      = None
 | 
					        self.pixbuf      = None
 | 
				
			||||||
        self.work_pixbuf = None
 | 
					        self.work_pixbuf = None
 | 
				
			||||||
        self.animation   = None
 | 
					        self.animation   = None
 | 
				
			||||||
        self.fit_to_win  = False
 | 
					        self.fit_to_win  = True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        self._setup_styling()
 | 
					        self._setup_styling()
 | 
				
			||||||
        self._setup_signals()
 | 
					        self._setup_signals()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user