refactor(desktop): reorganize workspace panels and navigation
This commit is contained in:
1 parent
826745b407
commit
1f73765745
92 files changed
+5811
-2650
No files matched your search
@@ -103,6 +103,17 @@ abstract final class AppTheme {
|
||||
_ => 'sans-serif',
|
||||
};
|
||||
|
||||
static List<String> systemFontFamilyFallback(TargetPlatform platform) =>
|
||||
switch (platform) {
|
||||
TargetPlatform.windows => const [
|
||||
'Microsoft YaHei UI',
|
||||
'Microsoft YaHei',
|
||||
'Noto Sans CJK SC',
|
||||
'sans-serif',
|
||||
],
|
||||
_ => const ['PingFang SC', 'Noto Sans CJK SC', 'sans-serif'],
|
||||
};
|
||||
|
||||
static Color popoverBackground(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return theme.extension<AppSurfaces>()?.popoverBackground ??
|
||||
@@ -678,11 +689,7 @@ abstract final class AppTheme {
|
||||
useMaterial3: true,
|
||||
colorScheme: colors,
|
||||
fontFamily: systemFontFamily(defaultTargetPlatform),
|
||||
fontFamilyFallback: const [
|
||||
'PingFang SC',
|
||||
'Noto Sans CJK SC',
|
||||
'sans-serif',
|
||||
],
|
||||
fontFamilyFallback: systemFontFamilyFallback(defaultTargetPlatform),
|
||||
textTheme: text,
|
||||
primaryTextTheme: text,
|
||||
scaffoldBackgroundColor: palette.background,
|
||||
@@ -956,21 +963,11 @@ abstract final class AppTheme {
|
||||
}) => TextStyle(
|
||||
inherit: false,
|
||||
fontFamily: systemFontFamily(defaultTargetPlatform),
|
||||
fontFamilyFallback: const [
|
||||
'PingFang SC',
|
||||
'Noto Sans CJK SC',
|
||||
'sans-serif',
|
||||
],
|
||||
fontFamilyFallback: systemFontFamilyFallback(defaultTargetPlatform),
|
||||
textBaseline: TextBaseline.alphabetic,
|
||||
fontSize: size,
|
||||
height: lineHeight / size,
|
||||
fontWeight: weight,
|
||||
fontVariations: [
|
||||
FontVariation(
|
||||
'wght',
|
||||
weight == FontWeight.w400 ? 430 : weight.value.toDouble(),
|
||||
),
|
||||
],
|
||||
letterSpacing: 0,
|
||||
color: color ?? palette.foreground,
|
||||
);
|
||||
@@ -1199,16 +1196,12 @@ abstract final class AppSidebarTypography {
|
||||
Color? color,
|
||||
}) => TextStyle(
|
||||
fontFamily: AppTheme.systemFontFamily(Theme.of(context).platform),
|
||||
fontFamilyFallback: const ['PingFang SC', 'Noto Sans CJK SC', 'sans-serif'],
|
||||
fontFamilyFallback: AppTheme.systemFontFamilyFallback(
|
||||
Theme.of(context).platform,
|
||||
),
|
||||
fontSize: fontSize,
|
||||
height: height,
|
||||
fontWeight: weight,
|
||||
fontVariations: [
|
||||
FontVariation(
|
||||
'wght',
|
||||
weight == FontWeight.w400 ? 430 : weight.value.toDouble(),
|
||||
),
|
||||
],
|
||||
color: color ?? AppSidebarColors.of(context).primary,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import '../theme/app_theme.dart';
|
||||
|
||||
/// A compact menu trigger with neutral interaction feedback.
|
||||
class AppToolbarDropdownButton extends StatelessWidget {
|
||||
const AppToolbarDropdownButton({
|
||||
super.key,
|
||||
this.buttonKey,
|
||||
this.focusNode,
|
||||
this.onPressed,
|
||||
this.style,
|
||||
required this.child,
|
||||
});
|
||||
|
||||
final Key? buttonKey;
|
||||
final FocusNode? focusNode;
|
||||
final VoidCallback? onPressed;
|
||||
final ButtonStyle? style;
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => TextButton(
|
||||
key: buttonKey,
|
||||
focusNode: focusNode,
|
||||
onPressed: onPressed,
|
||||
style: AppTheme.toolbarButtonStyle(context)
|
||||
.merge(style)
|
||||
.copyWith(
|
||||
backgroundColor: const WidgetStatePropertyAll(Colors.transparent),
|
||||
overlayColor: WidgetStateProperty.resolveWith((states) {
|
||||
if (states.contains(WidgetState.disabled)) {
|
||||
return Colors.transparent;
|
||||
}
|
||||
return states.any(
|
||||
{
|
||||
WidgetState.hovered,
|
||||
WidgetState.focused,
|
||||
WidgetState.pressed,
|
||||
}.contains,
|
||||
)
|
||||
? Theme.of(context).colorScheme.onSurface.withValues(alpha: .05)
|
||||
: Colors.transparent;
|
||||
}),
|
||||
splashFactory: NoSplash.splashFactory,
|
||||
),
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user