From e35fdabd8db5259be88a921bf0823d85aad53c9d Mon Sep 17 00:00:00 2001 From: Faisal Ansari Date: Tue, 13 Aug 2024 20:22:43 +0530 Subject: [PATCH] fixed text overflow on sidebar item (#513) * fixed text overflow on sidebar item * updated version and changelog --- CHANGELOG.md | 4 ++++ lib/src/layout/sidebar/sidebar_items.dart | 11 +++++++---- pubspec.yaml | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85e8c48c..b5e17ad5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## [2.0.8] +### 🛠️ Updated 🛠️ +* Fixed `SidebarItem` text overflowing. + ## [2.0.7] ### 🛠️ Updated 🛠️ * Made most widgets aware of the user’s accent color and window state by adding respective fields to `MacosThemeData`. diff --git a/lib/src/layout/sidebar/sidebar_items.dart b/lib/src/layout/sidebar/sidebar_items.dart index 5dd4d7d1..dc9329c5 100644 --- a/lib/src/layout/sidebar/sidebar_items.dart +++ b/lib/src/layout/sidebar/sidebar_items.dart @@ -318,11 +318,14 @@ class _SidebarItem extends StatelessWidget { child: item.leading!, ), ), - DefaultTextStyle( - style: labelStyle.copyWith( - color: selected ? textLuminance(selectedColor) : null, + Expanded( + child: DefaultTextStyle( + style: labelStyle.copyWith( + color: selected ? textLuminance(selectedColor) : null, + overflow: TextOverflow.ellipsis, + ), + child: item.label, ), - child: item.label, ), if (hasTrailing) ...[ const Spacer(), diff --git a/pubspec.yaml b/pubspec.yaml index 547ae60c..81c1ed36 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: macos_ui description: Flutter widgets and themes implementing the current macOS design language. -version: 2.0.7 +version: 2.0.8 homepage: "https://macosui.dev" repository: "https://github.com/GroovinChip/macos_ui"