  
      def set_layout(self):
          """ Set initial layout """
          self.update_idletasks()
          root = get_config().root
          config = get_config().user_config_dict
          r_width = root.winfo_width()
          r_height = root.winfo_height()
          w_ratio = config["options_panel_width"] / 100.0
          h_ratio = 1 - (config["console_panel_height"] / 100.0)
          width = round(r_width * w_ratio)
          height = round(r_height * h_ratio)
          logger.debug("Setting Initial Layout: (root_width: %s, root_height: %s, width_ratio: %s, "
                       "height_ratio: %s, width: %s, height: %s", r_width, r_height, w_ratio,
                       h_ratio, width, height)
 
</s> remove         self.objects["containers"]["top"].sash_place(0, width, 1)
        self.objects["containers"]["main"].sash_place(0, 1, height)
 </s> add         self.objects["container_top"].sash_place(0, width, 1)
        self.objects["container_main"].sash_place(0, 1, height) </s> remove         start_idx = len(imagefiles) - num_images if len(imagefiles) > num_images else 0
        show_files = sorted(imagefiles, key=os.path.getctime)[start_idx:]
 </s> add         start_idx = len(image_files) - num_images if len(image_files) > num_images else 0
        show_files = sorted(image_files, key=os.path.getctime)[start_idx:] </s> remove                 scale = framesize[0] / float(displayimg.size[0])
                size = (framesize[0], int(displayimg.size[1] * scale))
 </s> add                 scale = frame_dims[0] / float(displayimg.size[0])
                size = (frame_dims[0], int(displayimg.size[1] * scale)) </s> remove         self.previewcache["images"] = cache
        logger.debug("Cache shape: %s", self.previewcache["images"].shape)

    @staticmethod
    def get_preview_samples(imagefiles, num_images, thumbnail_size):
        """ Return a subset of the imagefiles images
            Exclude final file so we don't accidentally load a file that is being saved """
        logger.debug("num_images: %s", num_images)
        samples = list()
        start_idx = len(imagefiles) - (num_images + 1)
        end_idx = len(imagefiles) - 1
        logger.debug("start_idx: %s, end_idx: %s", start_idx, end_idx)
        show_files = sorted(imagefiles, key=os.path.getctime)[start_idx: end_idx]
        for fname in show_files:
            img = Image.open(fname)
            width, height = img.size
            scaling = thumbnail_size / max(width, height)
            logger.debug("image width: %s, height: %s, scaling: %s", width, height, scaling)
            img = img.resize((int(width * scaling), int(height * scaling)))
            if img.size[0] != img.size[1]:
                # Pad to square
                new_img = Image.new("RGB", (thumbnail_size, thumbnail_size))
                new_img.paste(img, ((thumbnail_size - img.size[0])//2,
                                    (thumbnail_size - img.size[1])//2))
                img = new_img
            draw = ImageDraw.Draw(img)
            draw.rectangle(((0, 0), (thumbnail_size, thumbnail_size)), outline="#E5E5E5", width=1)
            samples.append(np.array(img))
        samples = np.array(samples)
        logger.debug("Samples shape: %s", samples.shape)
        return show_files, samples

    def place_previews(self, frame_dims):
        """ Stack the preview images to fit display """
        if self.previewcache.get("images", None) is None:
 </s> add         self._previewcache["images"] = cache
        logger.debug("Cache shape: %s", self._previewcache["images"].shape)

    def _place_previews(self, frame_dims):
        """ Format the preview thumbnails stored in the cache into a grid fitting the display
        panel.

        Parameters
        ----------
        frame_dims: tuple
            The (width (`int`), height (`int`)) of the display panel that will display the preview

        Returns
        :class:`PIL.Image`:
            The final preview display image
        """
        if self._previewcache.get("images", None) is None: </s> remove         tabs = config.command_tabs
        if tab in tabs:
            config.command_notebook.select(tabs[tab])
        else:
            tool_tabs = config.tools_command_tabs
            if tab in tool_tabs:
                config.command_notebook.select(tabs["tools"])
                config.command_notebook.tools_notebook.select(tool_tabs[tab])
 </s> add         self._config.set_active_tab_by_name(tab)
        config_opts = self._config.user_config_dict
        r_width = self.winfo_width()
        r_height = self.winfo_height()
        w_ratio = config_opts["options_panel_width"] / 100.0
        h_ratio = 1 - (config_opts["console_panel_height"] / 100.0)
  
      def set_layout(self):
          """ Set initial layout """
          self.update_idletasks()
        config_opts = self._config.user_config_dict
        r_width = self.winfo_width()
        r_height = self.winfo_height()
        w_ratio = config_opts["options_panel_width"] / 100.0
        h_ratio = 1 - (config_opts["console_panel_height"] / 100.0)
        config_opts = self._config.user_config_dict
        r_width = self.winfo_width()
        r_height = self.winfo_height()
        w_ratio = config_opts["options_panel_width"] / 100.0
        h_ratio = 1 - (config_opts["console_panel_height"] / 100.0)
        config_opts = self._config.user_config_dict
        r_width = self.winfo_width()
        r_height = self.winfo_height()
        w_ratio = config_opts["options_panel_width"] / 100.0
        h_ratio = 1 - (config_opts["console_panel_height"] / 100.0)
        config_opts = self._config.user_config_dict
        r_width = self.winfo_width()
        r_height = self.winfo_height()
        w_ratio = config_opts["options_panel_width"] / 100.0
        h_ratio = 1 - (config_opts["console_panel_height"] / 100.0)
        config_opts = self._config.user_config_dict
        r_width = self.winfo_width()
        r_height = self.winfo_height()
        w_ratio = config_opts["options_panel_width"] / 100.0
        h_ratio = 1 - (config_opts["console_panel_height"] / 100.0)
        config_opts = self._config.user_config_dict
        r_width = self.winfo_width()
        r_height = self.winfo_height()
        w_ratio = config_opts["options_panel_width"] / 100.0
        h_ratio = 1 - (config_opts["console_panel_height"] / 100.0)
          width = round(r_width * w_ratio)
          height = round(r_height * h_ratio)
          logger.debug("Setting Initial Layout: (root_width: %s, root_height: %s, width_ratio: %s, "
                       "height_ratio: %s, width: %s, height: %s", r_width, r_height, w_ratio,
                       h_ratio, width, height)
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
 GUI Updates (#940)

* lib.gui: Update icons
* tools.cli: Add video filetype flag to mask input
* lib.gui.popup_configure: Refresh GUI on config save
* lib.gui._config: Add Icon size and load last session options
* lib.gui.control_helper - Add control modification tracking
* lib.gui - Add Projects and Last Session
- Main root title handled by projects
- Add Hotkeys
- Create projects module
- split fsw and fst filetypes
- Add last_session saving

* lib.project
- Documentation
- Ask confirm on closing unsaved project
-Fixups

* Track model folder changes
- Shuffle some globals
- Activate System Verbosity for GUI

* lib.gui.utils - Documentation and clean up
- lib.gui.custom_widgets - Create and document

* Add GUI config option to disable auto loading model stats 
scripts/gui.py