tksheet 7.2.5__py3-none-any.whl → 7.2.6__py3-none-any.whl
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.
- tksheet/__init__.py +1 -1
- tksheet/column_headers.py +7 -3
- tksheet/main_table.py +11 -5
- tksheet/row_index.py +4 -2
- tksheet/sheet.py +1 -1
- {tksheet-7.2.5.dist-info → tksheet-7.2.6.dist-info}/METADATA +1 -1
- {tksheet-7.2.5.dist-info → tksheet-7.2.6.dist-info}/RECORD +10 -10
- {tksheet-7.2.5.dist-info → tksheet-7.2.6.dist-info}/LICENSE.txt +0 -0
- {tksheet-7.2.5.dist-info → tksheet-7.2.6.dist-info}/WHEEL +0 -0
- {tksheet-7.2.5.dist-info → tksheet-7.2.6.dist-info}/top_level.txt +0 -0
tksheet/__init__.py
CHANGED
tksheet/column_headers.py
CHANGED
@@ -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
|
851
|
-
c
|
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,
|
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
|
tksheet/main_table.py
CHANGED
@@ -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)
|
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
|
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
|
-
|
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,
|
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:
|
tksheet/row_index.py
CHANGED
@@ -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
|
850
|
-
r
|
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,
|
tksheet/sheet.py
CHANGED
@@ -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(
|
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,20 +1,20 @@
|
|
1
|
-
tksheet/__init__.py,sha256=
|
1
|
+
tksheet/__init__.py,sha256=MyZeK3V7P7e3h5lPng0iDT2Y99wNpgBKlVk2bY8FsF8,2144
|
2
2
|
tksheet/colors.py,sha256=1k06VorynLmnC4FdJg8H4reIA6rXaeXBpdMwXLhN8oc,51594
|
3
|
-
tksheet/column_headers.py,sha256=
|
3
|
+
tksheet/column_headers.py,sha256=OTK9av3WkPF3ToXAALsa12TqltEFw_-c3kBUv_MTcok,102189
|
4
4
|
tksheet/formatters.py,sha256=DXif00aq9DgFpXwkbiqD86KxtDg0Meop51hLY-KcGNQ,10037
|
5
5
|
tksheet/functions.py,sha256=Ie53z5GWbGoUXUiTf0DtoyOadWFbMFXMFwUjM67vetI,40706
|
6
|
-
tksheet/main_table.py,sha256=
|
6
|
+
tksheet/main_table.py,sha256=jfnetKAxNaH77_B1vbUX0O3yBNBaZt2he--IIi9lNws,327795
|
7
7
|
tksheet/other_classes.py,sha256=CDN38ZjKxZro9YOS_g0DjMC82-Mi9udedny4wdd90W0,14347
|
8
|
-
tksheet/row_index.py,sha256=
|
9
|
-
tksheet/sheet.py,sha256=
|
8
|
+
tksheet/row_index.py,sha256=Owsa7YKVZc9TY7W5nfs-M0I1RdFvuoyXhpuyCi5kleo,108606
|
9
|
+
tksheet/sheet.py,sha256=xMctRdAC9npUPPEMXFfH4qCE_vyrUV7BJFrCumaOmU0,272368
|
10
10
|
tksheet/sheet_options.py,sha256=Azo7_-H0e0ssYEoU7Mq_OWy3S-U05rp4_6Q2E2Ffuu8,12262
|
11
11
|
tksheet/text_editor.py,sha256=aRm1Y5GfORiEAJthtN1uQ30CT3VoF8mRWvR-SIXPrJU,6548
|
12
12
|
tksheet/themes.py,sha256=N9nAj6vcWk4UdcrAakvz2LPbJEJWXdv3j7Om6AnvX5k,14474
|
13
13
|
tksheet/top_left_rectangle.py,sha256=o-M6i5NjaJwo60tV-BDP9SbaT1CzQNoPjuoC7p-nb5Q,8436
|
14
14
|
tksheet/types.py,sha256=IgoEHMbceKpakcZtanxKaKJ4RdCq7UW6EoEIIz5O59k,340
|
15
15
|
tksheet/vars.py,sha256=86ubZZElsnQuC6Lv6bW2lt2NhD9wAp6PxtkK7ufKqq0,3452
|
16
|
-
tksheet-7.2.
|
17
|
-
tksheet-7.2.
|
18
|
-
tksheet-7.2.
|
19
|
-
tksheet-7.2.
|
20
|
-
tksheet-7.2.
|
16
|
+
tksheet-7.2.6.dist-info/LICENSE.txt,sha256=ndbcCPe9SlHfweE_W2RAueWUe2k7yudyxYLq6WjFdn4,1101
|
17
|
+
tksheet-7.2.6.dist-info/METADATA,sha256=6V_98XBvk9-2ibBCLzZxrih4Jx_CNZGEpy2Wg4MGG2g,6284
|
18
|
+
tksheet-7.2.6.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
|
19
|
+
tksheet-7.2.6.dist-info/top_level.txt,sha256=my61PXCcck_HHAc9cq3NAlyAr3A3FXxCy9gptEOaCN8,8
|
20
|
+
tksheet-7.2.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|