tksheet 7.2.5__tar.gz → 7.2.6__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (24) hide show
  1. {tksheet-7.2.5/tksheet.egg-info → tksheet-7.2.6}/PKG-INFO +1 -1
  2. {tksheet-7.2.5 → tksheet-7.2.6}/pyproject.toml +1 -1
  3. {tksheet-7.2.5 → tksheet-7.2.6}/tksheet/__init__.py +1 -1
  4. {tksheet-7.2.5 → tksheet-7.2.6}/tksheet/column_headers.py +7 -3
  5. {tksheet-7.2.5 → tksheet-7.2.6}/tksheet/main_table.py +11 -5
  6. {tksheet-7.2.5 → tksheet-7.2.6}/tksheet/row_index.py +4 -2
  7. {tksheet-7.2.5 → tksheet-7.2.6}/tksheet/sheet.py +1 -1
  8. {tksheet-7.2.5 → tksheet-7.2.6/tksheet.egg-info}/PKG-INFO +1 -1
  9. {tksheet-7.2.5 → tksheet-7.2.6}/LICENSE.txt +0 -0
  10. {tksheet-7.2.5 → tksheet-7.2.6}/README.md +0 -0
  11. {tksheet-7.2.5 → tksheet-7.2.6}/setup.cfg +0 -0
  12. {tksheet-7.2.5 → tksheet-7.2.6}/tksheet/colors.py +0 -0
  13. {tksheet-7.2.5 → tksheet-7.2.6}/tksheet/formatters.py +0 -0
  14. {tksheet-7.2.5 → tksheet-7.2.6}/tksheet/functions.py +0 -0
  15. {tksheet-7.2.5 → tksheet-7.2.6}/tksheet/other_classes.py +0 -0
  16. {tksheet-7.2.5 → tksheet-7.2.6}/tksheet/sheet_options.py +0 -0
  17. {tksheet-7.2.5 → tksheet-7.2.6}/tksheet/text_editor.py +0 -0
  18. {tksheet-7.2.5 → tksheet-7.2.6}/tksheet/themes.py +0 -0
  19. {tksheet-7.2.5 → tksheet-7.2.6}/tksheet/top_left_rectangle.py +0 -0
  20. {tksheet-7.2.5 → tksheet-7.2.6}/tksheet/types.py +0 -0
  21. {tksheet-7.2.5 → tksheet-7.2.6}/tksheet/vars.py +0 -0
  22. {tksheet-7.2.5 → tksheet-7.2.6}/tksheet.egg-info/SOURCES.txt +0 -0
  23. {tksheet-7.2.5 → tksheet-7.2.6}/tksheet.egg-info/dependency_links.txt +0 -0
  24. {tksheet-7.2.5 → tksheet-7.2.6}/tksheet.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tksheet
3
- Version: 7.2.5
3
+ Version: 7.2.6
4
4
  Summary: Tkinter table / sheet widget
5
5
  Author-email: ragardner <github@ragardner.simplelogin.com>
6
6
  License: Copyright (c) 2019 ragardner and open source contributors
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
6
6
  name = "tksheet"
7
7
  description = "Tkinter table / sheet widget"
8
8
  readme = "README.md"
9
- version = "7.2.5"
9
+ version = "7.2.6"
10
10
  authors = [{ name = "ragardner", email = "github@ragardner.simplelogin.com" }]
11
11
  requires-python = ">=3.8"
12
12
  license = {file = "LICENSE.txt"}
@@ -4,7 +4,7 @@
4
4
  tksheet - A Python tkinter table widget
5
5
  """
6
6
 
7
- __version__ = "7.2.5"
7
+ __version__ = "7.2.6"
8
8
 
9
9
  from .colors import (
10
10
  color_map,
@@ -847,8 +847,10 @@ class ColumnHeaders(tk.Canvas):
847
847
  and is_contiguous(self.dragged_col.to_move)
848
848
  )
849
849
  ):
850
- if c >= len(self.MT.col_positions) - 1:
851
- c -= 1
850
+ if c > self.dragged_col.to_move[-1]:
851
+ c += 1
852
+ if c > len(self.MT.col_positions) - 1:
853
+ c = len(self.MT.col_positions) - 1
852
854
  event_data = event_dict(
853
855
  name="move_columns",
854
856
  sheet=self.PAR.name,
@@ -1010,7 +1012,9 @@ class ColumnHeaders(tk.Canvas):
1010
1012
  txt = self.get_valid_cell_data_as_str(datacn, fix=False)
1011
1013
  if txt:
1012
1014
  self.MT.txt_measure_canvas.itemconfig(
1013
- self.MT.txt_measure_canvas_text, text=txt, font=self.PAR.ops.header_font
1015
+ self.MT.txt_measure_canvas_text,
1016
+ text=txt,
1017
+ font=self.PAR.ops.header_font,
1014
1018
  )
1015
1019
  b = self.MT.txt_measure_canvas.bbox(self.MT.txt_measure_canvas_text)
1016
1020
  w = b[2] - b[0] + 7
@@ -999,10 +999,11 @@ class MainTable(tk.Canvas):
999
999
  disp_new_idxs = get_new_indexes(move_to=move_to, to_move=to_move)
1000
1000
  else:
1001
1001
  disp_new_idxs = {}
1002
+ # at_least_cols should not be len in this case as move_to can be len
1002
1003
  if not self.all_columns_displayed and not data_indexes:
1003
- totalcols = self.equalize_data_row_lengths(at_least_cols=self.datacn(move_to) + 1)
1004
+ totalcols = self.equalize_data_row_lengths(at_least_cols=self.datacn(move_to))
1004
1005
  else:
1005
- totalcols = self.equalize_data_row_lengths(at_least_cols=move_to + 1)
1006
+ totalcols = self.equalize_data_row_lengths(at_least_cols=move_to)
1006
1007
  data_new_idxs = get_new_indexes(move_to=move_to, to_move=to_move)
1007
1008
  if not self.all_columns_displayed and not data_indexes:
1008
1009
  moved = {self.displayed_columns[i] for i in to_move}
@@ -1233,7 +1234,12 @@ class MainTable(tk.Canvas):
1233
1234
  disp_new_idxs = get_new_indexes(move_to=move_to, to_move=to_move)
1234
1235
  else:
1235
1236
  disp_new_idxs = {}
1236
- self.fix_data_len(self.datarn(move_to) if not self.all_rows_displayed and not data_indexes else move_to)
1237
+ # move_to can be len and fix_data_len() takes index so - 1
1238
+ if not self.all_rows_displayed and not data_indexes:
1239
+ fix_len = self.datarn(move_to) - 1
1240
+ else:
1241
+ fix_len = move_to - 1
1242
+ self.fix_data_len(fix_len)
1237
1243
  totalrows = max(self.total_data_rows(), len(self.row_positions) - 1)
1238
1244
  data_new_idxs = get_new_indexes(move_to=move_to, to_move=to_move)
1239
1245
  if not self.all_rows_displayed and not data_indexes:
@@ -3691,10 +3697,9 @@ class MainTable(tk.Canvas):
3691
3697
  else:
3692
3698
  return False
3693
3699
 
3694
- def set_all_cell_sizes_to_text(self, w: int | None = None, slim: bool = False) -> tuple[list[float], list[float]]:
3700
+ def set_all_cell_sizes_to_text(self, width: int | None = None, slim: bool = False) -> tuple[list[float], list[float]]:
3695
3701
  min_column_width = int(self.min_column_width)
3696
3702
  min_rh = int(self.min_row_height)
3697
- w = min_column_width if w is None else w
3698
3703
  h = min_rh
3699
3704
  rhs = defaultdict(lambda: int(min_rh))
3700
3705
  cws = []
@@ -3724,6 +3729,7 @@ class MainTable(tk.Canvas):
3724
3729
  rhs[datarn] = h
3725
3730
  added_w_space = 1 if slim else 7
3726
3731
  for datacn in itercols:
3732
+ w = min_column_width if width is None else width
3727
3733
  if (hw := self.CH.get_cell_dimensions(datacn)[0]) > w:
3728
3734
  w = hw
3729
3735
  else:
@@ -846,8 +846,10 @@ class RowIndex(tk.Canvas):
846
846
  and is_contiguous(self.dragged_row.to_move)
847
847
  )
848
848
  ):
849
- if r >= len(self.MT.row_positions) - 1:
850
- r -= 1
849
+ if r > self.dragged_row.to_move[-1]:
850
+ r += 1
851
+ if r > len(self.MT.row_positions) - 1:
852
+ r = len(self.MT.row_positions) - 1
851
853
  event_data = event_dict(
852
854
  name="move_rows",
853
855
  sheet=self.PAR.name,
@@ -3362,7 +3362,7 @@ class Sheet(tk.Frame):
3362
3362
  width: int | None = None,
3363
3363
  slim: bool = False,
3364
3364
  ) -> tuple[list[float], list[float]]:
3365
- self.MT.set_all_cell_sizes_to_text(w=width, slim=slim)
3365
+ self.MT.set_all_cell_sizes_to_text(width=width, slim=slim)
3366
3366
  self.set_refresh_timer(redraw)
3367
3367
  return self.MT.row_positions, self.MT.col_positions
3368
3368
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: tksheet
3
- Version: 7.2.5
3
+ Version: 7.2.6
4
4
  Summary: Tkinter table / sheet widget
5
5
  Author-email: ragardner <github@ragardner.simplelogin.com>
6
6
  License: Copyright (c) 2019 ragardner and open source contributors
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes