Terminal theme: square bottom bar and map overlays
The contacts/channels/map switch bar loses its rounded corners, labels and 16 px of height; the map's search field, zoom column, legend, stats and source switch become square black panels. Node markers stay round. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
e939932cef
commit
b47afe7854
2 files changed
+36
-14
No files matched your search
+25
-12
@@ -40,6 +40,7 @@ import 'channels_screen.dart';
|
|||||||
import 'chat_screen.dart';
|
import 'chat_screen.dart';
|
||||||
import 'contacts_screen.dart';
|
import 'contacts_screen.dart';
|
||||||
import '../theme/mesh_theme.dart';
|
import '../theme/mesh_theme.dart';
|
||||||
|
import '../theme/terminal_theme.dart';
|
||||||
import '../widgets/mesh_ui.dart';
|
import '../widgets/mesh_ui.dart';
|
||||||
import '../widgets/repeater_login_dialog.dart';
|
import '../widgets/repeater_login_dialog.dart';
|
||||||
import '../widgets/room_login_dialog.dart';
|
import '../widgets/room_login_dialog.dart';
|
||||||
@@ -169,7 +170,19 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
|
|||||||
|
|
||||||
bool get _useDarkOverlay => Theme.of(context).brightness == Brightness.dark;
|
bool get _useDarkOverlay => Theme.of(context).brightness == Brightness.dark;
|
||||||
|
|
||||||
Color get _overlayPanelColor => _useDarkOverlay
|
// tth fork: square, black overlays in the terminal theme.
|
||||||
|
bool get _terminal => MeshStyle.of(context).terminal;
|
||||||
|
|
||||||
|
BorderRadius _overlayRadius(double radius) =>
|
||||||
|
_terminal ? BorderRadius.zero : BorderRadius.circular(radius);
|
||||||
|
|
||||||
|
OutlinedBorder _overlayPill({BorderSide side = BorderSide.none}) => _terminal
|
||||||
|
? RoundedRectangleBorder(side: side)
|
||||||
|
: StadiumBorder(side: side);
|
||||||
|
|
||||||
|
Color get _overlayPanelColor => _terminal
|
||||||
|
? const Color(0xEB000000)
|
||||||
|
: _useDarkOverlay
|
||||||
? MapPalette.panelDark
|
? MapPalette.panelDark
|
||||||
: _overlayScheme.surfaceContainerLow.withValues(alpha: 0.96);
|
: _overlayScheme.surfaceContainerLow.withValues(alpha: 0.96);
|
||||||
|
|
||||||
@@ -404,7 +417,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
|
|||||||
child: DecoratedBox(
|
child: DecoratedBox(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: _overlayPanelColor,
|
color: _overlayPanelColor,
|
||||||
borderRadius: BorderRadius.circular(MeshRadii.md),
|
borderRadius: _overlayRadius(MeshRadii.md),
|
||||||
border: Border.all(color: _overlayBorderColor),
|
border: Border.all(color: _overlayBorderColor),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
@@ -415,7 +428,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(MeshRadii.md),
|
borderRadius: _overlayRadius(MeshRadii.md),
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisSize: MainAxisSize.min,
|
mainAxisSize: MainAxisSize.min,
|
||||||
children: [
|
children: [
|
||||||
@@ -1691,7 +1704,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
|
|||||||
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 1),
|
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 1),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: _overlayPanelColor,
|
color: _overlayPanelColor,
|
||||||
borderRadius: BorderRadius.circular(MeshRadii.xs),
|
borderRadius: _overlayRadius(MeshRadii.xs),
|
||||||
border: Border.all(color: _overlayBorderColor),
|
border: Border.all(color: _overlayBorderColor),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
@@ -1924,7 +1937,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
|
|||||||
Expanded(
|
Expanded(
|
||||||
child: Material(
|
child: Material(
|
||||||
color: _overlayPanelColor,
|
color: _overlayPanelColor,
|
||||||
shape: StadiumBorder(
|
shape: _overlayPill(
|
||||||
side: BorderSide(color: _overlayBorderColor),
|
side: BorderSide(color: _overlayBorderColor),
|
||||||
),
|
),
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
@@ -1977,7 +1990,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
|
|||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
Material(
|
Material(
|
||||||
color: _overlayPanelColor,
|
color: _overlayPanelColor,
|
||||||
shape: StadiumBorder(
|
shape: _overlayPill(
|
||||||
side: BorderSide(color: _overlayBorderColor),
|
side: BorderSide(color: _overlayBorderColor),
|
||||||
),
|
),
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
@@ -2110,7 +2123,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
|
|||||||
final l10n = context.l10n;
|
final l10n = context.l10n;
|
||||||
return Material(
|
return Material(
|
||||||
color: _overlayPanelColor,
|
color: _overlayPanelColor,
|
||||||
shape: StadiumBorder(side: BorderSide(color: _overlayBorderColor)),
|
shape: _overlayPill(side: BorderSide(color: _overlayBorderColor)),
|
||||||
clipBehavior: Clip.antiAlias,
|
clipBehavior: Clip.antiAlias,
|
||||||
child: SegmentedButton<MapSourceOption>(
|
child: SegmentedButton<MapSourceOption>(
|
||||||
showSelectedIcon: false,
|
showSelectedIcon: false,
|
||||||
@@ -2195,7 +2208,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
|
|||||||
_overlayPanelColor,
|
_overlayPanelColor,
|
||||||
)
|
)
|
||||||
: _overlayPanelColor,
|
: _overlayPanelColor,
|
||||||
shape: StadiumBorder(
|
shape: _overlayPill(
|
||||||
side: BorderSide(
|
side: BorderSide(
|
||||||
color: selected ? accent : _overlayBorderColor,
|
color: selected ? accent : _overlayBorderColor,
|
||||||
width: selected ? 1.5 : 1,
|
width: selected ? 1.5 : 1,
|
||||||
@@ -2260,7 +2273,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
|
|||||||
constraints: const BoxConstraints(maxHeight: 300),
|
constraints: const BoxConstraints(maxHeight: 300),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: _overlayPanelColor,
|
color: _overlayPanelColor,
|
||||||
borderRadius: BorderRadius.circular(MeshRadii.md),
|
borderRadius: _overlayRadius(MeshRadii.md),
|
||||||
border: Border.all(color: _overlayBorderColor),
|
border: Border.all(color: _overlayBorderColor),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
@@ -2395,7 +2408,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
|
|||||||
padding: const EdgeInsets.fromLTRB(14, 12, 14, 12),
|
padding: const EdgeInsets.fromLTRB(14, 12, 14, 12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: _overlayPanelColor,
|
color: _overlayPanelColor,
|
||||||
borderRadius: BorderRadius.circular(MeshRadii.md),
|
borderRadius: _overlayRadius(MeshRadii.md),
|
||||||
border: Border.all(color: _overlayBorderColor),
|
border: Border.all(color: _overlayBorderColor),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
@@ -4180,7 +4193,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
|
|||||||
child: DecoratedBox(
|
child: DecoratedBox(
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: _overlayPanelColor,
|
color: _overlayPanelColor,
|
||||||
borderRadius: BorderRadius.circular(MeshRadii.md),
|
borderRadius: _overlayRadius(MeshRadii.md),
|
||||||
border: Border.all(color: _overlayBorderColor),
|
border: Border.all(color: _overlayBorderColor),
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
@@ -4191,7 +4204,7 @@ class _MapScreenState extends State<MapScreen> with DisconnectNavigationMixin {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(MeshRadii.md),
|
borderRadius: _overlayRadius(MeshRadii.md),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.all(12.0),
|
padding: const EdgeInsets.all(12.0),
|
||||||
child: Column(
|
child: Column(
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ import 'dart:ui';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import '../l10n/l10n.dart';
|
import '../l10n/l10n.dart';
|
||||||
import '../theme/mesh_theme.dart';
|
import '../theme/mesh_theme.dart';
|
||||||
|
import '../theme/terminal_theme.dart';
|
||||||
|
|
||||||
class QuickSwitchBar extends StatelessWidget {
|
class QuickSwitchBar extends StatelessWidget {
|
||||||
final int selectedIndex;
|
final int selectedIndex;
|
||||||
@@ -40,11 +41,13 @@ class QuickSwitchBar extends StatelessWidget {
|
|||||||
? MapPalette.textSecondary
|
? MapPalette.textSecondary
|
||||||
: colorScheme.onSurfaceVariant;
|
: colorScheme.onSurfaceVariant;
|
||||||
final indicator = highContrast ? MapPalette.selected : colorScheme.primary;
|
final indicator = highContrast ? MapPalette.selected : colorScheme.primary;
|
||||||
|
// tth fork, terminal theme: a square strip of icons, no labels.
|
||||||
|
final terminal = MeshStyle.of(context).terminal;
|
||||||
|
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: ClipRRect(
|
child: ClipRRect(
|
||||||
borderRadius: BorderRadius.circular(20),
|
borderRadius: terminal ? BorderRadius.zero : BorderRadius.circular(20),
|
||||||
child: BackdropFilter(
|
child: BackdropFilter(
|
||||||
filter: ImageFilter.blur(sigmaX: 14, sigmaY: 14),
|
filter: ImageFilter.blur(sigmaX: 14, sigmaY: 14),
|
||||||
child: DecoratedBox(
|
child: DecoratedBox(
|
||||||
@@ -62,6 +65,9 @@ class QuickSwitchBar extends StatelessWidget {
|
|||||||
surfaceTintColor: Colors.transparent,
|
surfaceTintColor: Colors.transparent,
|
||||||
shadowColor: Colors.transparent,
|
shadowColor: Colors.transparent,
|
||||||
indicatorColor: indicator,
|
indicatorColor: indicator,
|
||||||
|
indicatorShape: terminal
|
||||||
|
? const RoundedRectangleBorder()
|
||||||
|
: null,
|
||||||
labelTextStyle: WidgetStateProperty.resolveWith((states) {
|
labelTextStyle: WidgetStateProperty.resolveWith((states) {
|
||||||
final isSelected = states.contains(WidgetState.selected);
|
final isSelected = states.contains(WidgetState.selected);
|
||||||
return labelStyle.copyWith(
|
return labelStyle.copyWith(
|
||||||
@@ -77,7 +83,10 @@ class QuickSwitchBar extends StatelessWidget {
|
|||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
child: NavigationBar(
|
child: NavigationBar(
|
||||||
height: 60,
|
height: terminal ? 44 : 60,
|
||||||
|
labelBehavior: terminal
|
||||||
|
? NavigationDestinationLabelBehavior.alwaysHide
|
||||||
|
: null,
|
||||||
selectedIndex: selectedIndex,
|
selectedIndex: selectedIndex,
|
||||||
onDestinationSelected: onDestinationSelected,
|
onDestinationSelected: onDestinationSelected,
|
||||||
destinations: [
|
destinations: [
|
||||||
|
|||||||
Reference in new issue
Block a user