Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix sidebar overflow #1248

Merged
merged 1 commit into from
Mar 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 10 additions & 7 deletions lib/community/widgets/community_sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,16 @@ class CommunityModeratorList extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
mods.moderator.displayName ?? mods.moderator.name,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
SizedBox(
width: MediaQuery.of(context).size.width * 0.55,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, but where does the 0.55 come from?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tweaked the percentage until it looked good. I figured since it was a percentage rather than a fixed value it should scale to other devices. What do you think?

I tried FractionallySizedBox first, since that's what the whole sidebar uses, but it didn't work.

child: Text(
mods.moderator.displayName ?? mods.moderator.name,
overflow: TextOverflow.fade,
softWrap: false,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
),
UserFullNameWidget(
Expand Down
17 changes: 10 additions & 7 deletions lib/user/widgets/user_sidebar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -229,13 +229,16 @@ class UserModeratorList extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
mods.community.title,
overflow: TextOverflow.ellipsis,
maxLines: 1,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
SizedBox(
width: MediaQuery.of(context).size.width * 0.55,
child: Text(
mods.community.title,
overflow: TextOverflow.fade,
softWrap: false,
style: const TextStyle(
fontWeight: FontWeight.bold,
fontSize: 16,
),
),
),
CommunityFullNameWidget(
Expand Down
Loading