Skip to content

Commit

Permalink
Selection boxes issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ragardner committed May 24, 2023
1 parent abb3cce commit 165e1fa
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions tksheet/_tksheet_main_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -3628,6 +3628,8 @@ def set_cell_size_to_text(self, r, c, only_set_if_too_small=False, redraw=True,
self.RI.row_height_resize_func(ResizeEvent("row_height_resize", r, old_height, new_height))
if cell_needs_resize_w or cell_needs_resize_h:
self.recreate_all_selection_boxes()
self.allow_auto_resize_columns = not cell_needs_resize_w
self.allow_auto_resize_rows = not cell_needs_resize_h
if redraw:
self.refresh()
return True
Expand Down Expand Up @@ -5499,7 +5501,7 @@ def set_currently_selected(self, r, c, type_="cell"): # cell, column or row
r1 = 0
r2 = 0
tagr = ("selected", f"{r1}_{c1}_{r2}_{c2}", type_)
tag_index_header = ("cells", f"{r1}_{c1}_{r2}_{c2}")
tag_index_header = ("cells", f"{r1}_{c1}_{r2}_{c2}", "selected")
if type_ == "cell":
outline = self.table_selected_cells_border_fg
elif type_ == "row":
Expand Down Expand Up @@ -5581,21 +5583,22 @@ def create_selected(
state="normal",
):
self.itemconfig("cells", state="normal")
coords = f"{r1}_{c1}_{r2}_{c2}"
if type_ == "cells":
tagr = ("cells", f"{r1}_{c1}_{r2}_{c2}")
tagb = ("cellsbd", f"{r1}_{c1}_{r2}_{c2}")
tagr = ("cells", coords)
tagb = ("cellsbd", coords)
mt_bg = self.table_selected_cells_bg
mt_border_col = self.table_selected_cells_border_fg
elif type_ == "rows":
tagr = ("rows", f"{r1}_{c1}_{r2}_{c2}")
tagb = ("rowsbd", f"{r1}_{c1}_{r2}_{c2}")
tag_index_header = ("cells", f"{r1}_{c1}_{r2}_{c2}")
tagr = ("rows", coords)
tagb = ("rowsbd", coords)
tag_index_header = ("cells", coords)
mt_bg = self.table_selected_rows_bg
mt_border_col = self.table_selected_rows_border_fg
elif type_ == "columns":
tagr = ("columns", f"{r1}_{c1}_{r2}_{c2}")
tagb = ("columnsbd", f"{r1}_{c1}_{r2}_{c2}")
tag_index_header = ("cells", f"{r1}_{c1}_{r2}_{c2}")
tagr = ("columns", coords)
tagb = ("columnsbd", coords)
tag_index_header = ("cells", coords)
mt_bg = self.table_selected_columns_bg
mt_border_col = self.table_selected_columns_border_fg
self.last_selected = (r1, c1, r2, c2, type_)
Expand Down

0 comments on commit 165e1fa

Please sign in to comment.