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: change timeline tabs to be square #490

Merged
merged 1 commit into from
Dec 10, 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
2 changes: 1 addition & 1 deletion lib/view/page/timelines_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class TimelinesPage extends HookConsumerWidget {
bottomNavigationBar: showTimelineTabBarAtBottom
? BottomAppBar(
padding: EdgeInsets.zero,
height: 56.0,
height: kToolbarHeight,
color: colors.panel,
elevation: 0.0,
child: Row(
Expand Down
1 change: 1 addition & 0 deletions lib/view/widget/timeline_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ class TimelineHeader extends HookConsumerWidget {
},
backgroundColor: Theme.of(context).colorScheme.surface,
collapsedBackgroundColor: Theme.of(context).colorScheme.surface,
visualDensity: VisualDensity.compact,
children: [
if (onlineUsersCount != null)
Text.rich(
Expand Down
8 changes: 4 additions & 4 deletions lib/view/widget/timeline_tab_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ import '../../provider/timeline_scroll_controller_provider.dart';
import '../../provider/timeline_tabs_notifier_provider.dart';
import 'tab_icon_widget.dart';

class TimelineTabBar extends HookConsumerWidget implements PreferredSizeWidget {
class TimelineTabBar extends HookConsumerWidget {
const TimelineTabBar({super.key, required this.controller});

final TabController controller;

@override
Widget build(BuildContext context, WidgetRef ref) {
const tabHeight = 46.0;
final tabs = ref.watch(timelineTabsNotifierProvider);

return TabBar(
Expand All @@ -30,6 +31,8 @@ class TimelineTabBar extends HookConsumerWidget implements PreferredSizeWidget {
indicator: BoxDecoration(
color: Theme.of(context).colorScheme.primary.withOpacity(0.5),
),
labelPadding:
const EdgeInsets.symmetric(horizontal: (tabHeight - 24.0) / 2),
indicatorSize: TabBarIndicatorSize.tab,
indicatorWeight: 0.0,
dividerHeight: 0.0,
Expand All @@ -56,7 +59,4 @@ class TimelineTabBar extends HookConsumerWidget implements PreferredSizeWidget {
tabAlignment: TabAlignment.center,
);
}

@override
Size get preferredSize => const Size.fromHeight(46.0);
}
Loading