Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Commit

Permalink
fix(system_navbar): sizing
Browse files Browse the repository at this point in the history
  • Loading branch information
RossComputerGuy committed May 18, 2024
1 parent b2a6b0e commit 3fece42
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/views/desktop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class _DesktopViewState extends State<DesktopView> {
padding: 8 * output.units,
iconSize: 64 * output.units,
axisExtent: 84 * output.units,
height: 45 * output.units,
height: SystemNavbar.heightFor(context),
) : null,
);

Expand Down
15 changes: 11 additions & 4 deletions lib/widgets/system_navbar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import 'package:libtokyo/libtokyo.dart' hide TokyoApp, Scaffold;

import 'activity_drawer.dart';

const kSystemNavbarHeight = kToolbarHeight / 1.4;

class SystemNavbar extends StatefulWidget {
const SystemNavbar({
super.key,
Expand All @@ -12,7 +14,7 @@ class SystemNavbar extends StatefulWidget {
this.padding = 8,
this.iconSize = 64,
this.axisExtent = 84,
this.height = 45,
this.height = kSystemNavbarHeight,
});

final int outputIndex;
Expand All @@ -24,6 +26,11 @@ class SystemNavbar extends StatefulWidget {

@override
State<SystemNavbar> createState() => _SystemNavbarState();

static double heightFor(BuildContext context) {
final theme = BottomAppBarTheme.of(context);
return (theme.height ?? 80) / 1.4;
}
}

class _SystemNavbarState extends State<SystemNavbar> {
Expand All @@ -39,7 +46,7 @@ class _SystemNavbarState extends State<SystemNavbar> {
children: [
IconButton(
onPressed: () {},
icon: Icon(Icons.chevronLeft, size: widget.height - (widget.padding * 2)),
icon: Icon(Icons.chevronLeft, size: widget.height - widget.padding),
),
IconButton(
onPressed: () {
Expand All @@ -60,11 +67,11 @@ class _SystemNavbarState extends State<SystemNavbar> {
));
}
},
icon: Icon(Icons.circleDot, size: widget.height - (widget.padding * 2)),
icon: Icon(Icons.circleDot, size: widget.height - widget.padding),
),
IconButton(
onPressed: () {},
icon: Icon(Icons.bars, size: widget.height - (widget.padding * 2)),
icon: Icon(Icons.bars, size: widget.height - widget.padding),
),
],
),
Expand Down

0 comments on commit 3fece42

Please sign in to comment.