Skip to content

Commit 8c45431

Browse files
fix: ThemedTable2 header overflow detection by including the sort icon width in the available text width, ensuring tooltips appear correctly (#126)
This pull request addresses an issue with header overflow detection in the `ThemedTable2` widget. The main improvement ensures that tooltips appear correctly by accounting for the width of the sort icon when calculating the available text width in table headers. ### Table Header Overflow Fixes * Updated the calculation of available text width in `ThemedTable2` headers to subtract the sort icon width when present, ensuring accurate overflow detection and proper tooltip display. ### Documentation and Versioning * Updated the `CHANGELOG.md` to document the header overflow fix in version 7.5.20. * Bumped the package version to 7.5.20 in `pubspec.yaml`.
2 parents 2c3e42f + 09d789e commit 8c45431

3 files changed

Lines changed: 8 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## 7.5.20
4+
- Fixed `ThemedTable2` header overflow detection by including the sort icon width in the available text width, ensuring tooltips appear correctly.
5+
36
## 7.5.19
47
- Add `ThemedTooltip` to headers of `ThemedTable2` for better overflow handling
58

lib/src/table2/src/table.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,10 @@ class _ThemedTable2State<T> extends State<ThemedTable2<T>> {
483483
alignment: entry.alignment,
484484
child: Builder(
485485
builder: (context) {
486-
final double textWidth = cellWidth - (_padding.left + _padding.right);
486+
final double textWidth =
487+
cellWidth -
488+
(_padding.left + _padding.right) -
489+
(isSelected ? _sortIconSize : 0);
487490

488491
// Fetch inline spans if richTextBuilder is provided, otherwise, use the header text
489492
final textOnlySpan = TextSpan(

pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: layrz_theme
22
description: Layrz standard styling library for Flutter. Widget library following the Material Design 3 guidelines, with a focus on reliavility and functionality.
3-
version: "7.5.19"
3+
version: "7.5.20"
44
homepage: https://theme.layrz.com
55
repository: https://github.com/goldenm-software/layrz_theme
66

0 commit comments

Comments
 (0)