diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/controller_data.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/controller_data.py index 6011cf7..be65729 100644 --- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/controller_data.py +++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/controller_data.py @@ -71,6 +71,7 @@ class Controller_Data: self.to_copy_files = [] self.to_cut_files = [] self.soft_update_lock = {} + self.dnd_left_primed = 0 self.single_click_open = False self.is_pane1_hidden = False diff --git a/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/ui/window_mixin.py b/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/ui/window_mixin.py index 5b3d9b1..503cdd8 100644 --- a/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/ui/window_mixin.py +++ b/src/versions/solarfm-0.0.1/SolarFM/solarfm/core/mixins/ui/window_mixin.py @@ -158,7 +158,30 @@ class WindowMixin(TabMixin): tab = self.get_fm_window(wid).get_tab_by_id(tid) path_entry.set_text(tab.get_current_directory()) + # NOTE: If selected multiple with box select and then reselecting the same + # with box select, self.dnd_left_primed does not get deprimed if already primed. + # Ctrl does help in this context but the abocve is not desired def grid_set_selected_items(self, icons_grid): + items = icons_grid.get_selected_items() + size = len(items) + + if size == 1: + # NOTE: If already in selection, likely dnd else not so wont readd + if items[0] in self.selected_files: + self.dnd_left_primed += 1 + # NOTE: If in selection but trying to just select an already selected item. + if self.dnd_left_primed > 1: + self.dnd_left_primed = 0 + self.selected_files.clear() + return + + # NOTE: Likely trying dnd, just readd to selection the former set. + # Prevents losing highlighting of grid selected. + for path in self.selected_files: + icons_grid.select_path(path) + + return + self.selected_files = icons_grid.get_selected_items() def grid_icon_single_click(self, icons_grid, eve): @@ -170,6 +193,9 @@ class WindowMixin(TabMixin): self.set_window_title() if eve.type == Gdk.EventType.BUTTON_RELEASE and eve.button == 1: # l-click + if self.ctrl_down: + self.dnd_left_primed = 0 + if self.single_click_open: # FIXME: need to find a way to pass the model index self.grid_icon_double_click(icons_grid) elif eve.type == Gdk.EventType.BUTTON_RELEASE and eve.button == 3: # r-click