feat(ui): align desktop controls and inspector typography with Figma UI3
This commit is contained in:
1 parent
abc1868550
commit
bc3fdd6119
45 files changed
+1806
-227
No files matched your search
@@ -63,6 +63,8 @@ abstract final class AppIcons {
|
||||
static const IconData unlock = PhosphorIconsRegular.lockOpen;
|
||||
static const IconData fullscreen = PhosphorIconsRegular.arrowsOut;
|
||||
static const IconData exitFullscreen = PhosphorIconsRegular.arrowsIn;
|
||||
static const IconData independentCorners = PhosphorIconsRegular.cornersOut;
|
||||
static const IconData cornerRadius = PhosphorIconsRegular.rectangle;
|
||||
static const IconData fitContent = PhosphorIconsRegular.cornersIn;
|
||||
static const IconData menu = PhosphorIconsRegular.list;
|
||||
static const IconData sidebar = PhosphorIconsRegular.sidebarSimple;
|
||||
|
||||
@@ -174,8 +174,10 @@ abstract final class AppTheme {
|
||||
: null,
|
||||
textStyle: WidgetStatePropertyAll(
|
||||
theme.textTheme.labelLarge?.copyWith(
|
||||
fontSize: desktop ? 13 : 12,
|
||||
height: 1.3,
|
||||
fontSize: desktop ? AppInspectorMetrics.fontSize : 12,
|
||||
height: desktop
|
||||
? AppInspectorMetrics.lineHeight / AppInspectorMetrics.fontSize
|
||||
: 1.3,
|
||||
fontWeight: desktop && selected ? FontWeight.w500 : FontWeight.w400,
|
||||
fontVariations: desktop
|
||||
? [FontVariation('wght', selected ? 500 : 400)]
|
||||
@@ -188,14 +190,14 @@ abstract final class AppTheme {
|
||||
foregroundColor: WidgetStatePropertyAll(
|
||||
selected
|
||||
? desktop
|
||||
? colors.primary
|
||||
? colors.onSurface
|
||||
: colors.onSurface
|
||||
: colors.onSurfaceVariant,
|
||||
),
|
||||
backgroundColor: WidgetStatePropertyAll(
|
||||
selected
|
||||
? desktop
|
||||
? colors.primary.withValues(alpha: .12)
|
||||
? colors.surfaceContainer
|
||||
: colors.onSurface.withValues(alpha: .05)
|
||||
: Colors.transparent,
|
||||
),
|
||||
@@ -255,6 +257,9 @@ abstract final class AppTheme {
|
||||
|
||||
static Color comboboxBackground(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
if (isCompactInspector(context)) {
|
||||
return theme.inputDecorationTheme.fillColor!;
|
||||
}
|
||||
return theme.brightness == Brightness.dark
|
||||
? theme.colorScheme.surfaceContainerHighest.withValues(alpha: .3)
|
||||
: Colors.transparent;
|
||||
@@ -374,34 +379,12 @@ abstract final class AppTheme {
|
||||
/// Desktop inspectors use a denser scale than dialogs and settings.
|
||||
static ThemeData propertiesPanelTheme(ThemeData theme) {
|
||||
final desktop = theme.extension<DesktopControlDensity>() != null;
|
||||
if (desktop) return _desktopPropertiesPanelTheme(theme);
|
||||
final colors = theme.colorScheme;
|
||||
final panelText = desktop
|
||||
? theme.textTheme.copyWith(
|
||||
bodyMedium: theme.textTheme.bodyMedium?.copyWith(
|
||||
fontSize: 13,
|
||||
height: 20 / 13,
|
||||
leadingDistribution: TextLeadingDistribution.even,
|
||||
),
|
||||
bodySmall: theme.textTheme.bodySmall?.copyWith(
|
||||
fontSize: 12,
|
||||
height: 16 / 12,
|
||||
leadingDistribution: TextLeadingDistribution.even,
|
||||
),
|
||||
)
|
||||
: theme.textTheme;
|
||||
final actionSize = desktop
|
||||
? AppInspectorMetrics.action
|
||||
: AppControlSize.propertyControl;
|
||||
final panelText = theme.textTheme;
|
||||
const actionSize = AppControlSize.propertyControl;
|
||||
ButtonStyle? buttonStyle(ButtonStyle? style) => style?.copyWith(
|
||||
textStyle: WidgetStatePropertyAll(panelText.labelLarge),
|
||||
minimumSize: desktop
|
||||
? const WidgetStatePropertyAll(Size(0, AppInspectorMetrics.input))
|
||||
: style.minimumSize,
|
||||
padding: desktop
|
||||
? const WidgetStatePropertyAll(
|
||||
EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
)
|
||||
: style.padding,
|
||||
);
|
||||
final panelColors = colors.copyWith(surface: colors.surfaceContainerLow);
|
||||
final composerBackground = theme
|
||||
@@ -415,19 +398,13 @@ abstract final class AppTheme {
|
||||
borderSide: BorderSide.none,
|
||||
);
|
||||
return theme.copyWith(
|
||||
extensions: [
|
||||
...theme.extensions.values,
|
||||
if (desktop) const InspectorControlDensity(),
|
||||
],
|
||||
canvasColor: colors.surfaceContainerLow,
|
||||
colorScheme: panelColors,
|
||||
textTheme: panelText,
|
||||
primaryTextTheme: panelText,
|
||||
inputDecorationTheme: theme.inputDecorationTheme.copyWith(
|
||||
constraints: BoxConstraints(
|
||||
minHeight: desktop
|
||||
? AppInspectorMetrics.input
|
||||
: AppControlSize.propertyControl,
|
||||
constraints: const BoxConstraints(
|
||||
minHeight: AppControlSize.propertyControl,
|
||||
),
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
horizontal: AppSpacing.controlHorizontal,
|
||||
@@ -468,14 +445,151 @@ abstract final class AppTheme {
|
||||
);
|
||||
}
|
||||
|
||||
static ThemeData _desktopPropertiesPanelTheme(ThemeData theme) {
|
||||
// UI3 – Figma's UI Kit, Templates / design.sidebar.right.
|
||||
// The workspace owns the panel background and accents.
|
||||
final dark = theme.brightness == Brightness.dark;
|
||||
final background = theme.colorScheme.surfaceContainerLow;
|
||||
final inputBackground = dark
|
||||
? const Color(0xFF383838)
|
||||
: const Color(0xFFF5F5F5);
|
||||
final ink = dark ? Colors.white : Colors.black.withValues(alpha: .9);
|
||||
final secondaryInk = dark
|
||||
? Colors.white.withValues(alpha: .7)
|
||||
: Colors.black.withValues(alpha: .5);
|
||||
final divider = dark ? const Color(0xFF444444) : const Color(0xFFE6E6E6);
|
||||
final colors = theme.colorScheme.copyWith(
|
||||
surface: background,
|
||||
surfaceContainer: inputBackground,
|
||||
surfaceContainerHighest: inputBackground,
|
||||
onSurface: ink,
|
||||
onSurfaceVariant: secondaryInk,
|
||||
outlineVariant: divider,
|
||||
);
|
||||
final body = theme.textTheme.bodyMedium!.copyWith(
|
||||
fontFamily: 'packages/cutdex_ui/Inter',
|
||||
fontSize: AppInspectorMetrics.fontSize,
|
||||
height: AppInspectorMetrics.lineHeight / AppInspectorMetrics.fontSize,
|
||||
fontWeight: FontWeight.w400,
|
||||
fontVariations: const [FontVariation('wght', 450)],
|
||||
letterSpacing: AppInspectorMetrics.fontSize * .005,
|
||||
color: ink,
|
||||
leadingDistribution: TextLeadingDistribution.even,
|
||||
);
|
||||
final strong = body.copyWith(
|
||||
fontWeight: FontWeight.w600,
|
||||
fontVariations: const [FontVariation('wght', 550)],
|
||||
);
|
||||
final text = theme.textTheme.copyWith(
|
||||
bodyLarge: body,
|
||||
bodyMedium: body,
|
||||
bodySmall: body.copyWith(color: secondaryInk),
|
||||
labelLarge: body,
|
||||
labelMedium: body,
|
||||
labelSmall: body.copyWith(color: secondaryInk),
|
||||
titleSmall: strong.copyWith(
|
||||
fontSize: 13,
|
||||
height: 22 / 13,
|
||||
letterSpacing: -.0325,
|
||||
),
|
||||
);
|
||||
const shape = RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(AppInspectorMetrics.radius),
|
||||
),
|
||||
);
|
||||
const inputShape = OutlineInputBorder(
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(AppInspectorMetrics.radius),
|
||||
),
|
||||
borderSide: BorderSide.none,
|
||||
);
|
||||
ButtonStyle? button(ButtonStyle? style) => style?.copyWith(
|
||||
textStyle: WidgetStatePropertyAll(body),
|
||||
minimumSize: const WidgetStatePropertyAll(
|
||||
Size(0, AppInspectorMetrics.input),
|
||||
),
|
||||
padding: const WidgetStatePropertyAll(
|
||||
EdgeInsets.symmetric(horizontal: 8),
|
||||
),
|
||||
shape: const WidgetStatePropertyAll(shape),
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
visualDensity: VisualDensity.standard,
|
||||
);
|
||||
return theme.copyWith(
|
||||
extensions: [...theme.extensions.values, const InspectorControlDensity()],
|
||||
canvasColor: background,
|
||||
colorScheme: colors,
|
||||
textTheme: text,
|
||||
primaryTextTheme: text,
|
||||
dividerColor: divider,
|
||||
dividerTheme: theme.dividerTheme.copyWith(
|
||||
color: divider,
|
||||
thickness: 1,
|
||||
space: 1,
|
||||
),
|
||||
iconTheme: theme.iconTheme.copyWith(color: secondaryInk, size: 16),
|
||||
inputDecorationTheme: theme.inputDecorationTheme.copyWith(
|
||||
constraints: const BoxConstraints(minHeight: AppInspectorMetrics.input),
|
||||
contentPadding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
fillColor: inputBackground,
|
||||
hintStyle: body.copyWith(color: secondaryInk),
|
||||
border: inputShape,
|
||||
enabledBorder: inputShape,
|
||||
disabledBorder: inputShape,
|
||||
focusedBorder: inputShape.copyWith(
|
||||
borderSide: BorderSide(color: colors.primary),
|
||||
),
|
||||
errorBorder: inputShape.copyWith(
|
||||
borderSide: BorderSide(color: colors.error),
|
||||
),
|
||||
focusedErrorBorder: inputShape.copyWith(
|
||||
borderSide: BorderSide(color: colors.error),
|
||||
),
|
||||
),
|
||||
iconButtonTheme: IconButtonThemeData(
|
||||
style: theme.iconButtonTheme.style?.copyWith(
|
||||
minimumSize: const WidgetStatePropertyAll(
|
||||
Size.square(AppInspectorMetrics.action),
|
||||
),
|
||||
maximumSize: const WidgetStatePropertyAll(
|
||||
Size.square(AppInspectorMetrics.action),
|
||||
),
|
||||
fixedSize: const WidgetStatePropertyAll(
|
||||
Size.square(AppInspectorMetrics.action),
|
||||
),
|
||||
shape: const WidgetStatePropertyAll(shape),
|
||||
foregroundColor: WidgetStateProperty.resolveWith(
|
||||
(states) => states.contains(WidgetState.disabled)
|
||||
? secondaryInk.withValues(alpha: .38)
|
||||
: states.contains(WidgetState.selected)
|
||||
? colors.primary
|
||||
: secondaryInk,
|
||||
),
|
||||
),
|
||||
),
|
||||
textButtonTheme: TextButtonThemeData(
|
||||
style: button(theme.textButtonTheme.style),
|
||||
),
|
||||
filledButtonTheme: FilledButtonThemeData(
|
||||
style: button(theme.filledButtonTheme.style),
|
||||
),
|
||||
outlinedButtonTheme: OutlinedButtonThemeData(
|
||||
style: button(theme.outlinedButtonTheme.style),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
static bool isCompactInspector(BuildContext context) =>
|
||||
Theme.of(context).extension<InspectorControlDensity>() != null;
|
||||
|
||||
static EdgeInsets propertySectionPadding(BuildContext context) =>
|
||||
isDesktop(context)
|
||||
? const EdgeInsets.symmetric(
|
||||
horizontal: AppInspectorMetrics.padding,
|
||||
vertical: AppInspectorMetrics.groupGap / 2,
|
||||
? const EdgeInsets.fromLTRB(
|
||||
AppInspectorMetrics.padding,
|
||||
0,
|
||||
AppInspectorMetrics.trailingPadding,
|
||||
AppInspectorMetrics.groupGap,
|
||||
)
|
||||
: AppSpacing.panelSection;
|
||||
|
||||
@@ -489,8 +603,12 @@ abstract final class AppTheme {
|
||||
static TextStyle propertyLabelStyle(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
return theme.textTheme.bodyMedium!.copyWith(
|
||||
fontSize: isCompactInspector(context) ? 12 : null,
|
||||
height: isCompactInspector(context) ? 16 / 12 : null,
|
||||
fontSize: isCompactInspector(context)
|
||||
? AppInspectorMetrics.fontSize
|
||||
: null,
|
||||
height: isCompactInspector(context)
|
||||
? AppInspectorMetrics.lineHeight / AppInspectorMetrics.fontSize
|
||||
: null,
|
||||
leadingDistribution: TextLeadingDistribution.even,
|
||||
color: theme.colorScheme.onSurfaceVariant,
|
||||
);
|
||||
@@ -500,10 +618,12 @@ abstract final class AppTheme {
|
||||
Theme.of(context).textTheme.bodyMedium!
|
||||
.copyWith(fontSize: 13, height: 18 / 13);
|
||||
|
||||
/// Codex desktop's compact heading-sm: 13px, 1.4 line height, medium ink.
|
||||
/// Inspector group titles share the UI3 input scale.
|
||||
static TextStyle propertySectionTitleStyle(BuildContext context) =>
|
||||
Theme.of(context).textTheme.labelLarge!.copyWith(
|
||||
height: 1.4,
|
||||
height: isCompactInspector(context)
|
||||
? AppInspectorMetrics.lineHeight / AppInspectorMetrics.fontSize
|
||||
: 1.4,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
);
|
||||
|
||||
@@ -734,30 +854,44 @@ abstract final class AppTheme {
|
||||
}) {
|
||||
final colors = Theme.of(context).colorScheme;
|
||||
final ink = colors.onSurface;
|
||||
final compact = isCompactInspector(context);
|
||||
final height = compact
|
||||
? AppInspectorMetrics.input
|
||||
: AppControlSize.headerButton;
|
||||
return ButtonStyle(
|
||||
minimumSize: const WidgetStatePropertyAll(
|
||||
Size(0, AppControlSize.headerButton),
|
||||
),
|
||||
maximumSize: const WidgetStatePropertyAll(
|
||||
Size(double.infinity, AppControlSize.headerButton),
|
||||
),
|
||||
minimumSize: WidgetStatePropertyAll(Size(0, height)),
|
||||
maximumSize: WidgetStatePropertyAll(Size(double.infinity, height)),
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
textStyle: WidgetStatePropertyAll(toolbarTextStyle(context)),
|
||||
textStyle: WidgetStatePropertyAll(
|
||||
compact
|
||||
? inputTextStyle(context).copyWith(
|
||||
fontVariations: [FontVariation('wght', selected ? 550 : 450)],
|
||||
)
|
||||
: toolbarTextStyle(context),
|
||||
),
|
||||
padding: const WidgetStatePropertyAll(
|
||||
EdgeInsets.symmetric(horizontal: AppSpacing.small),
|
||||
),
|
||||
shape: WidgetStatePropertyAll(
|
||||
RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(
|
||||
compact ? AppInspectorMetrics.radius : 8,
|
||||
),
|
||||
),
|
||||
),
|
||||
foregroundColor: WidgetStatePropertyAll(
|
||||
selected
|
||||
? ink
|
||||
: compact
|
||||
? colors.onSurfaceVariant
|
||||
: Theme.of(context).brightness == Brightness.dark
|
||||
? ink.withValues(alpha: .498)
|
||||
: colors.onSurfaceVariant,
|
||||
),
|
||||
backgroundColor: WidgetStatePropertyAll(
|
||||
selected ? ink.withValues(alpha: .05) : Colors.transparent,
|
||||
selected
|
||||
? (compact ? colors.surfaceContainer : ink.withValues(alpha: .05))
|
||||
: Colors.transparent,
|
||||
),
|
||||
overlayColor: WidgetStateProperty.resolveWith((states) {
|
||||
if (states.contains(WidgetState.hovered) ||
|
||||
@@ -1746,16 +1880,16 @@ abstract final class AppDesktopMetrics {
|
||||
static const windowHeader = 44.0;
|
||||
static const panelHeader = 36.0;
|
||||
static const timelineTabs = 32.0;
|
||||
static const timelineTabControl = 26.0;
|
||||
static const timelineTabRadius = 7.0;
|
||||
static const timelineToolbar = 36.0;
|
||||
static const timelineTabControl = AppInspectorMetrics.input;
|
||||
static const timelineTabRadius = AppInspectorMetrics.radius;
|
||||
static const timelineToolbar = AppInspectorMetrics.row;
|
||||
static const timelineRuler = 28.0;
|
||||
static const playbackBar = 36.0;
|
||||
static const playbackBar = AppInspectorMetrics.row;
|
||||
static const iconButton = 28.0;
|
||||
static const button = 32.0;
|
||||
static const input = 36.0;
|
||||
static const sidebarRow = 32.0;
|
||||
static const panelPadding = 12.0;
|
||||
static const panelPadding = AppInspectorMetrics.padding;
|
||||
}
|
||||
|
||||
/// Window project tabs have their own geometry, separate from timeline tabs.
|
||||
@@ -1770,11 +1904,18 @@ abstract final class AppProjectTabMetrics {
|
||||
|
||||
/// Geometry for desktop parameter editing, independent of general inputs.
|
||||
abstract final class AppInspectorMetrics {
|
||||
static const input = 28.0;
|
||||
static const input = 24.0;
|
||||
static const action = 24.0;
|
||||
static const rowGap = 4.0;
|
||||
static const row = 32.0;
|
||||
static const sectionHeader = 40.0;
|
||||
static const rowPadding = 4.0;
|
||||
static const rowGap = 8.0;
|
||||
static const groupGap = 12.0;
|
||||
static const padding = 12.0;
|
||||
static const padding = 16.0;
|
||||
static const trailingPadding = 8.0;
|
||||
static const radius = 5.0;
|
||||
static const fontSize = 11.0;
|
||||
static const lineHeight = 16.0;
|
||||
}
|
||||
|
||||
class InspectorControlDensity extends ThemeExtension<InspectorControlDensity> {
|
||||
|
||||
@@ -124,6 +124,7 @@ class _AppComboboxState<T> extends State<AppCombobox<T>> {
|
||||
builder: (context, constraints) {
|
||||
final theme = Theme.of(context);
|
||||
final colors = theme.colorScheme;
|
||||
final compact = AppTheme.isCompactInspector(context);
|
||||
final inputStyle = AppTheme.inputTextStyle(
|
||||
context,
|
||||
style: AppTheme.isDesktop(context)
|
||||
@@ -181,21 +182,27 @@ class _AppComboboxState<T> extends State<AppCombobox<T>> {
|
||||
AppDesktopMetrics.input
|
||||
: AppControlSize.input,
|
||||
),
|
||||
padding: const EdgeInsetsDirectional.only(
|
||||
start: AppSpacing.compact,
|
||||
end: AppSpacing.tiny,
|
||||
padding: EdgeInsetsDirectional.only(
|
||||
start: compact ? AppSpacing.small : AppSpacing.compact,
|
||||
end: compact ? 0 : AppSpacing.tiny,
|
||||
),
|
||||
decoration: BoxDecoration(
|
||||
color: AppTheme.comboboxBackground(context),
|
||||
borderRadius: BorderRadius.circular(AppRadius.large),
|
||||
border: Border.all(color: colors.outlineVariant),
|
||||
boxShadow: [
|
||||
BoxShadow(
|
||||
color: colors.shadow.withValues(alpha: .05),
|
||||
offset: const Offset(0, 1),
|
||||
blurRadius: 2,
|
||||
),
|
||||
],
|
||||
borderRadius: BorderRadius.circular(
|
||||
compact ? AppInspectorMetrics.radius : AppRadius.large,
|
||||
),
|
||||
border: compact
|
||||
? null
|
||||
: Border.all(color: colors.outlineVariant),
|
||||
boxShadow: compact
|
||||
? []
|
||||
: [
|
||||
BoxShadow(
|
||||
color: colors.shadow.withValues(alpha: .05),
|
||||
offset: const Offset(0, 1),
|
||||
blurRadius: 2,
|
||||
),
|
||||
],
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
@@ -257,9 +264,9 @@ class _AppComboboxState<T> extends State<AppCombobox<T>> {
|
||||
icon: Icon(
|
||||
AppIcons.expandMore,
|
||||
size: 16,
|
||||
color: colors.onSurfaceVariant.withValues(
|
||||
alpha: .5,
|
||||
),
|
||||
color: compact
|
||||
? colors.onSurfaceVariant
|
||||
: colors.onSurfaceVariant.withValues(alpha: .5),
|
||||
),
|
||||
),
|
||||
],
|
||||
|
||||
@@ -32,19 +32,24 @@ class AppCommandToolbar extends StatelessWidget {
|
||||
final List<AppToolbarCommand> trailing;
|
||||
final Widget? status;
|
||||
|
||||
static const _buttonSize = AppInspectorMetrics.input;
|
||||
static const _commandSlot = 32.0;
|
||||
|
||||
Widget _button(AppToolbarCommand command) => IconButton(
|
||||
key: command.key,
|
||||
tooltip: command.label,
|
||||
onPressed: command.onPressed,
|
||||
icon: Icon(command.icon, semanticLabel: command.semanticLabel, size: 16),
|
||||
style: IconButton.styleFrom(
|
||||
fixedSize: const Size.square(AppDesktopMetrics.iconButton),
|
||||
minimumSize: const Size.square(AppDesktopMetrics.iconButton),
|
||||
maximumSize: const Size.square(AppDesktopMetrics.iconButton),
|
||||
fixedSize: const Size.square(_buttonSize),
|
||||
minimumSize: const Size.square(_buttonSize),
|
||||
maximumSize: const Size.square(_buttonSize),
|
||||
padding: EdgeInsets.zero,
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
shape: const RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(AppRadius.small)),
|
||||
borderRadius: BorderRadius.all(
|
||||
Radius.circular(AppInspectorMetrics.radius),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
@@ -53,13 +58,15 @@ class AppCommandToolbar extends StatelessWidget {
|
||||
Widget build(BuildContext context) => LayoutBuilder(
|
||||
builder: (context, constraints) {
|
||||
final commands = groups.expand((group) => group).toList();
|
||||
final reserved = trailing.length * 32 + (status == null ? 0 : 24);
|
||||
final reserved =
|
||||
trailing.length * _commandSlot + (status == null ? 0 : 24);
|
||||
final groupSpace = (groups.length - 1).clamp(0, groups.length) * 16;
|
||||
final allFit =
|
||||
constraints.maxWidth >= commands.length * 32 + groupSpace + reserved;
|
||||
constraints.maxWidth >=
|
||||
commands.length * _commandSlot + groupSpace + reserved;
|
||||
final visibleCount = allFit
|
||||
? commands.length
|
||||
: ((constraints.maxWidth - reserved - groupSpace - 36) / 32)
|
||||
: ((constraints.maxWidth - reserved - groupSpace - 36) / _commandSlot)
|
||||
.floor()
|
||||
.clamp(0, commands.length);
|
||||
final hidden = commands.skip(visibleCount).toList();
|
||||
@@ -75,7 +82,7 @@ class AppCommandToolbar extends StatelessWidget {
|
||||
for (final command in group)
|
||||
if (index++ < visibleCount) ...[
|
||||
_button(command),
|
||||
const SizedBox(width: 4),
|
||||
const SizedBox(width: 8),
|
||||
],
|
||||
],
|
||||
if (hidden.isNotEmpty)
|
||||
|
||||
@@ -9,7 +9,7 @@ import 'app_command_toolbar.dart';
|
||||
@Preview(
|
||||
name: 'Timeline commands — light',
|
||||
group: 'Desktop workspace',
|
||||
size: Size(480, 36),
|
||||
size: Size(480, 32),
|
||||
)
|
||||
Widget desktopTimelineToolbarLightPreview() =>
|
||||
_toolbarPreview(Brightness.light);
|
||||
@@ -17,12 +17,12 @@ Widget desktopTimelineToolbarLightPreview() =>
|
||||
@Preview(
|
||||
name: 'Timeline commands — dark',
|
||||
group: 'Desktop workspace',
|
||||
size: Size(480, 36),
|
||||
size: Size(480, 32),
|
||||
)
|
||||
@Preview(
|
||||
name: 'Narrow timeline commands',
|
||||
group: 'Desktop workspace',
|
||||
size: Size(180, 36),
|
||||
size: Size(180, 32),
|
||||
)
|
||||
Widget desktopTimelineToolbarPreview() => _toolbarPreview(Brightness.dark);
|
||||
|
||||
@@ -36,7 +36,7 @@ Widget _toolbarPreview(Brightness brightness) => MaterialApp(
|
||||
|
||||
Widget desktopTimelineCommands() => Material(
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8),
|
||||
padding: const EdgeInsets.symmetric(horizontal: AppSpacing.medium),
|
||||
child: AppCommandToolbar(
|
||||
groups: [
|
||||
[
|
||||
|
||||
@@ -453,6 +453,7 @@ class AppSelect<T> extends StatelessWidget {
|
||||
builder: (context, constraints) {
|
||||
final theme = Theme.of(context);
|
||||
final colors = theme.colorScheme;
|
||||
final compact = AppTheme.isCompactInspector(context);
|
||||
final current = options
|
||||
.where((option) => option.value == value)
|
||||
.firstOrNull;
|
||||
@@ -484,8 +485,10 @@ class AppSelect<T> extends StatelessWidget {
|
||||
child: AnimatedContainer(
|
||||
duration: const Duration(milliseconds: 100),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(AppRadius.large),
|
||||
boxShadow: outlined
|
||||
borderRadius: BorderRadius.circular(
|
||||
compact ? AppInspectorMetrics.radius : AppRadius.large,
|
||||
),
|
||||
boxShadow: outlined && !compact
|
||||
? [
|
||||
BoxShadow(
|
||||
color: colors.shadow.withValues(alpha: .05),
|
||||
@@ -526,7 +529,11 @@ class AppSelect<T> extends StatelessWidget {
|
||||
),
|
||||
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(AppRadius.large),
|
||||
borderRadius: BorderRadius.circular(
|
||||
compact
|
||||
? AppInspectorMetrics.radius
|
||||
: AppRadius.large,
|
||||
),
|
||||
),
|
||||
side: outlined
|
||||
? theme
|
||||
@@ -536,8 +543,12 @@ class AppSelect<T> extends StatelessWidget {
|
||||
BorderSide(color: colors.outlineVariant)
|
||||
: null,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: outlined ? 12 : AppSpacing.tiny,
|
||||
vertical: outlined ? AppSpacing.inputVertical : 0,
|
||||
horizontal: outlined
|
||||
? (compact ? 8 : 12)
|
||||
: AppSpacing.tiny,
|
||||
vertical: outlined && !compact
|
||||
? AppSpacing.inputVertical
|
||||
: 0,
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
@@ -557,9 +568,9 @@ class AppSelect<T> extends StatelessWidget {
|
||||
Icon(
|
||||
AppIcons.expandMore,
|
||||
size: 16,
|
||||
color: colors.onSurfaceVariant.withValues(
|
||||
alpha: .5,
|
||||
),
|
||||
color: compact
|
||||
? colors.onSurfaceVariant
|
||||
: colors.onSurfaceVariant.withValues(alpha: .5),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -2,6 +2,36 @@ import 'package:flutter/material.dart';
|
||||
|
||||
import '../theme/app_theme.dart';
|
||||
|
||||
/// Shared inspector gutters, section spacing, and a full-width divider.
|
||||
class AppPropertySection extends StatelessWidget {
|
||||
const AppPropertySection({
|
||||
super.key,
|
||||
required this.child,
|
||||
this.bottomSpacing,
|
||||
});
|
||||
|
||||
final Widget child;
|
||||
final double? bottomSpacing;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final content = Padding(
|
||||
padding: AppTheme.propertySectionPadding(context)
|
||||
.copyWith(bottom: bottomSpacing),
|
||||
child: child,
|
||||
);
|
||||
if (!AppTheme.isCompactInspector(context)) return content;
|
||||
return DecoratedBox(
|
||||
decoration: BoxDecoration(
|
||||
border: Border(
|
||||
bottom: BorderSide(color: Theme.of(context).dividerColor),
|
||||
),
|
||||
),
|
||||
child: content,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// An inspector property title, its actions, and the controls below it.
|
||||
class AppPropertyGroup extends StatelessWidget {
|
||||
const AppPropertyGroup({
|
||||
@@ -10,43 +40,109 @@ class AppPropertyGroup extends StatelessWidget {
|
||||
required this.child,
|
||||
this.labelWidget,
|
||||
this.actions = const [],
|
||||
this.padChild = true,
|
||||
});
|
||||
|
||||
final String label;
|
||||
final Widget? labelWidget;
|
||||
final List<Widget> actions;
|
||||
|
||||
/// Set to false when the child contains [AppPropertyRow] widgets.
|
||||
final bool padChild;
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
minHeight: AppTheme.isDesktop(context)
|
||||
? AppInspectorMetrics.action
|
||||
: AppControlSize.propertyControl,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child:
|
||||
labelWidget ??
|
||||
Text(
|
||||
label,
|
||||
style: AppTheme.propertySectionTitleStyle(context),
|
||||
),
|
||||
),
|
||||
for (final action in actions) ...[
|
||||
SizedBox(width: AppTheme.propertyRowGap(context)),
|
||||
action,
|
||||
Widget build(BuildContext context) {
|
||||
final compact = AppTheme.isCompactInspector(context);
|
||||
return Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
ConstrainedBox(
|
||||
constraints: BoxConstraints(
|
||||
minHeight: compact
|
||||
? AppInspectorMetrics.sectionHeader
|
||||
: AppControlSize.propertyControl,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child:
|
||||
labelWidget ??
|
||||
Text(
|
||||
label,
|
||||
style: AppTheme.propertySectionTitleStyle(context),
|
||||
),
|
||||
),
|
||||
for (final action in actions) ...[
|
||||
SizedBox(
|
||||
width: compact
|
||||
? AppSpacing.tiny
|
||||
: AppTheme.propertyRowGap(context),
|
||||
),
|
||||
action,
|
||||
],
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
if (compact && padChild)
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: AppInspectorMetrics.rowPadding,
|
||||
),
|
||||
child: child,
|
||||
)
|
||||
else if (compact)
|
||||
child
|
||||
else ...[
|
||||
SizedBox(height: AppTheme.propertyRowGap(context)),
|
||||
child,
|
||||
],
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// UI3 control cells share equal widths and a separate 24px action column.
|
||||
class AppPropertyRow extends StatelessWidget {
|
||||
const AppPropertyRow({
|
||||
super.key,
|
||||
required this.children,
|
||||
this.trailing,
|
||||
this.reserveTrailing = true,
|
||||
this.flexes,
|
||||
}) : assert(children.length > 0),
|
||||
assert(flexes == null || flexes.length == children.length);
|
||||
|
||||
final List<Widget> children;
|
||||
final Widget? trailing;
|
||||
final bool reserveTrailing;
|
||||
final List<int>? flexes;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
vertical: AppInspectorMetrics.rowPadding,
|
||||
),
|
||||
child: ConstrainedBox(
|
||||
constraints: const BoxConstraints(minHeight: AppInspectorMetrics.input),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
for (var i = 0; i < children.length; i++) ...[
|
||||
if (i > 0) const SizedBox(width: AppInspectorMetrics.rowGap),
|
||||
Expanded(flex: flexes?[i] ?? 1, child: children[i]),
|
||||
],
|
||||
if (trailing != null || reserveTrailing) ...[
|
||||
const SizedBox(width: AppInspectorMetrics.rowGap),
|
||||
SizedBox(
|
||||
width: AppInspectorMetrics.action,
|
||||
child:
|
||||
trailing ?? const SizedBox(height: AppInspectorMetrics.input),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
SizedBox(height: AppTheme.propertyRowGap(context)),
|
||||
child,
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -6,23 +6,24 @@ import '../theme/app_palette.dart';
|
||||
import '../theme/app_theme.dart';
|
||||
import 'app_property_group.dart';
|
||||
import 'app_text_field.dart';
|
||||
import 'app_button_group.dart';
|
||||
|
||||
@Preview(
|
||||
name: 'Property groups — light',
|
||||
group: 'Desktop inspector',
|
||||
size: Size(280, 240),
|
||||
size: Size(240, 360),
|
||||
)
|
||||
Widget propertyGroupsLightPreview() => _preview(Brightness.light);
|
||||
|
||||
@Preview(
|
||||
name: 'Property groups — dark',
|
||||
group: 'Desktop inspector',
|
||||
size: Size(280, 240),
|
||||
size: Size(240, 360),
|
||||
)
|
||||
@Preview(
|
||||
name: 'Narrow property groups',
|
||||
group: 'Desktop inspector',
|
||||
size: Size(220, 240),
|
||||
size: Size(220, 360),
|
||||
)
|
||||
Widget propertyGroupsDarkPreview() => _preview(Brightness.dark);
|
||||
|
||||
@@ -49,6 +50,7 @@ class _PropertyGroupsPreviewState extends State<_PropertyGroupsPreview> {
|
||||
TextEditingController(text: '100'),
|
||||
TextEditingController(text: '100'),
|
||||
TextEditingController(text: '0'),
|
||||
TextEditingController(text: '0'),
|
||||
];
|
||||
bool _locked = true;
|
||||
final _keyed = <int>{};
|
||||
@@ -70,19 +72,17 @@ class _PropertyGroupsPreviewState extends State<_PropertyGroupsPreview> {
|
||||
}),
|
||||
);
|
||||
|
||||
Widget _pair(String a, String b, int index, {String? unit}) => Row(
|
||||
Widget _pair(
|
||||
String a,
|
||||
String b,
|
||||
int index, {
|
||||
String? unit,
|
||||
Widget? trailing,
|
||||
}) => AppPropertyRow(
|
||||
trailing: trailing,
|
||||
children: [
|
||||
Expanded(
|
||||
child: AppTextField(label: a, unit: unit, controller: _values[index]),
|
||||
),
|
||||
const SizedBox(width: 4),
|
||||
Expanded(
|
||||
child: AppTextField(
|
||||
label: b,
|
||||
unit: unit,
|
||||
controller: _values[index + 1],
|
||||
),
|
||||
),
|
||||
AppTextField(label: a, unit: unit, controller: _values[index]),
|
||||
AppTextField(label: b, unit: unit, controller: _values[index + 1]),
|
||||
],
|
||||
);
|
||||
|
||||
@@ -93,41 +93,100 @@ class _PropertyGroupsPreviewState extends State<_PropertyGroupsPreview> {
|
||||
for (final group in [
|
||||
AppPropertyGroup(
|
||||
label: '位置',
|
||||
actions: [_keyframe(0)],
|
||||
child: _pair('X', 'Y', 0),
|
||||
padChild: false,
|
||||
child: Column(
|
||||
children: [
|
||||
AppPropertyRow(
|
||||
children: [
|
||||
for (final (index, icons) in [
|
||||
(
|
||||
0,
|
||||
[
|
||||
AppIcons.alignLeft,
|
||||
AppIcons.alignHorizontalCenter,
|
||||
AppIcons.alignRight,
|
||||
],
|
||||
),
|
||||
(
|
||||
1,
|
||||
[
|
||||
AppIcons.alignTop,
|
||||
AppIcons.alignVerticalCenter,
|
||||
AppIcons.alignBottom,
|
||||
],
|
||||
),
|
||||
])
|
||||
AppButtonGroup(
|
||||
expanded: true,
|
||||
label: 'Alignment',
|
||||
children: [
|
||||
for (var i = 0; i < icons.length; i++)
|
||||
IconButton(
|
||||
icon: Icon(icons[i]),
|
||||
onPressed: () =>
|
||||
_values[index].text = '${i * 100}',
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
_pair('X', 'Y', 0, trailing: _keyframe(0)),
|
||||
AppPropertyRow(
|
||||
trailing: _keyframe(2),
|
||||
children: [
|
||||
AppTextField(
|
||||
label: '旋转',
|
||||
leading: const SizedBox(
|
||||
width: AppInspectorMetrics.action,
|
||||
child: Center(child: Icon(AppIcons.angle, size: 14)),
|
||||
),
|
||||
unit: '°',
|
||||
controller: _values[4],
|
||||
),
|
||||
const SizedBox.shrink(),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
AppPropertyGroup(
|
||||
label: '缩放',
|
||||
actions: [
|
||||
IconButton(
|
||||
actions: [_keyframe(1)],
|
||||
padChild: false,
|
||||
child: _pair(
|
||||
'W',
|
||||
'H',
|
||||
2,
|
||||
unit: '%',
|
||||
trailing: IconButton(
|
||||
tooltip: 'Lock aspect ratio',
|
||||
isSelected: _locked,
|
||||
icon: const Icon(AppIcons.unlock),
|
||||
selectedIcon: const Icon(AppIcons.lockFilled),
|
||||
onPressed: () => setState(() => _locked = !_locked),
|
||||
),
|
||||
_keyframe(1),
|
||||
],
|
||||
child: _pair('W', 'H', 2, unit: '%'),
|
||||
),
|
||||
),
|
||||
AppPropertyGroup(
|
||||
label: '旋转',
|
||||
actions: [_keyframe(2)],
|
||||
child: AppTextField(
|
||||
label: '旋转',
|
||||
leading: const Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
child: Icon(AppIcons.angle, size: 14),
|
||||
),
|
||||
unit: '°',
|
||||
controller: _values[4],
|
||||
label: '圆角',
|
||||
padChild: false,
|
||||
child: AppPropertyRow(
|
||||
trailing: _keyframe(3),
|
||||
children: [
|
||||
AppTextField(
|
||||
label: '圆角',
|
||||
leading: const SizedBox(
|
||||
width: AppInspectorMetrics.action,
|
||||
child: Center(child: Icon(AppIcons.cornerRadius, size: 14)),
|
||||
),
|
||||
controller: _values[5],
|
||||
),
|
||||
const SizedBox.shrink(),
|
||||
],
|
||||
),
|
||||
),
|
||||
])
|
||||
Padding(
|
||||
padding: AppTheme.propertySectionPadding(context),
|
||||
child: group,
|
||||
),
|
||||
AppPropertySection(child: group),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -40,7 +40,9 @@ class _AppSwitchState extends State<AppSwitch> {
|
||||
onFocusChange: (value) => setState(() => _focused = value),
|
||||
child: SizedBox(
|
||||
width: width,
|
||||
height: 36,
|
||||
height: AppTheme.isCompactInspector(context)
|
||||
? AppInspectorMetrics.input
|
||||
: 36,
|
||||
child: Stack(
|
||||
alignment: Alignment.center,
|
||||
children: [
|
||||
|
||||
@@ -65,6 +65,7 @@ class _AppTextFieldState extends State<AppTextField> {
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
final colors = theme.colorScheme;
|
||||
final compact = AppTheme.isCompactInspector(context);
|
||||
final foreground = widget.enabled
|
||||
? colors.onSurface
|
||||
: colors.onSurface.withValues(alpha: 0.38);
|
||||
@@ -72,9 +73,11 @@ class _AppTextFieldState extends State<AppTextField> {
|
||||
final borderless =
|
||||
theme.inputDecorationTheme.enabledBorder?.borderSide == BorderSide.none;
|
||||
final style = AppTheme.inputTextStyle(context)
|
||||
.copyWith(color: foreground, letterSpacing: 0);
|
||||
.copyWith(color: foreground, letterSpacing: compact ? null : 0);
|
||||
OutlineInputBorder border(Color color) => OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(AppRadius.large),
|
||||
borderRadius: BorderRadius.circular(
|
||||
compact ? AppInspectorMetrics.radius : AppRadius.large,
|
||||
),
|
||||
borderSide: BorderSide(color: color),
|
||||
);
|
||||
|
||||
@@ -107,12 +110,20 @@ class _AppTextFieldState extends State<AppTextField> {
|
||||
hintStyle: AppTheme.inputHintStyle(context, style: style),
|
||||
errorText: widget.errorText,
|
||||
errorMaxLines: 2,
|
||||
contentPadding:
|
||||
theme.inputDecorationTheme.contentPadding ??
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: AppSpacing.controlHorizontal,
|
||||
vertical: AppSpacing.inputVertical,
|
||||
),
|
||||
contentPadding: compact && widget.maxLines == 1
|
||||
? EdgeInsets.fromLTRB(
|
||||
!labelAbove && (widget.leading != null || widget.label != null)
|
||||
? 0
|
||||
: 8,
|
||||
4,
|
||||
widget.unit == null ? 8 : 0,
|
||||
4,
|
||||
)
|
||||
: theme.inputDecorationTheme.contentPadding ??
|
||||
const EdgeInsets.symmetric(
|
||||
horizontal: AppSpacing.controlHorizontal,
|
||||
vertical: AppSpacing.inputVertical,
|
||||
),
|
||||
prefixIcon: labelAbove
|
||||
? null
|
||||
: widget.leading ??
|
||||
@@ -122,18 +133,26 @@ class _AppTextFieldState extends State<AppTextField> {
|
||||
widthFactor: 1,
|
||||
heightFactor: 1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: AppSpacing.small,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: compact && widget.label!.length == 1
|
||||
? 0
|
||||
: AppSpacing.small,
|
||||
),
|
||||
child: ExcludeSemantics(
|
||||
child: Text(
|
||||
widget.label!,
|
||||
style: AppTheme.propertyLabelStyle(context)
|
||||
.copyWith(
|
||||
color: widget.enabled
|
||||
? colors.onSurfaceVariant
|
||||
: foreground,
|
||||
),
|
||||
child: SizedBox(
|
||||
width: compact && widget.label!.length == 1
|
||||
? AppInspectorMetrics.action
|
||||
: null,
|
||||
child: Text(
|
||||
widget.label!,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppTheme.propertyLabelStyle(context)
|
||||
.copyWith(
|
||||
color: widget.enabled
|
||||
? colors.onSurfaceVariant
|
||||
: foreground,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -148,8 +167,8 @@ class _AppTextFieldState extends State<AppTextField> {
|
||||
widthFactor: 1,
|
||||
heightFactor: 1,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(
|
||||
horizontal: AppSpacing.small,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: compact ? 4 : AppSpacing.small,
|
||||
),
|
||||
child: ExcludeSemantics(
|
||||
child: Text(
|
||||
@@ -163,8 +182,8 @@ class _AppTextFieldState extends State<AppTextField> {
|
||||
),
|
||||
),
|
||||
),
|
||||
suffixIconConstraints: const BoxConstraints(
|
||||
minWidth: AppControlSize.compact,
|
||||
suffixIconConstraints: BoxConstraints(
|
||||
minWidth: compact ? 16 : AppControlSize.compact,
|
||||
minHeight: AppControlSize.input,
|
||||
),
|
||||
border: theme.inputDecorationTheme.border,
|
||||
@@ -201,12 +220,44 @@ class _AppTextFieldState extends State<AppTextField> {
|
||||
child: Semantics(
|
||||
label: [widget.label, widget.unit].whereType<String>().join(' '),
|
||||
child: labelAbove
|
||||
? AppPropertyGroup(
|
||||
label: widget.label ?? '',
|
||||
labelWidget: widget.leading,
|
||||
actions: widget.labelActions,
|
||||
child: input,
|
||||
)
|
||||
? compact
|
||||
? Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
minHeight: AppInspectorMetrics.lineHeight,
|
||||
),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child:
|
||||
widget.leading ??
|
||||
Text(
|
||||
widget.label ?? '',
|
||||
style: AppTheme.propertyLabelStyle(
|
||||
context,
|
||||
),
|
||||
),
|
||||
),
|
||||
for (final action in widget.labelActions) ...[
|
||||
const SizedBox(width: AppSpacing.tiny),
|
||||
action,
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
const SizedBox(height: AppInspectorMetrics.rowPadding),
|
||||
input,
|
||||
],
|
||||
)
|
||||
: AppPropertyGroup(
|
||||
label: widget.label ?? '',
|
||||
labelWidget: widget.leading,
|
||||
actions: widget.labelActions,
|
||||
child: input,
|
||||
)
|
||||
: input,
|
||||
),
|
||||
);
|
||||
|
||||
@@ -24,8 +24,8 @@ class AppToolbarDropdownButton extends StatelessWidget {
|
||||
key: buttonKey,
|
||||
focusNode: focusNode,
|
||||
onPressed: onPressed,
|
||||
style: AppTheme.toolbarButtonStyle(context)
|
||||
.merge(style)
|
||||
style: (style ?? const ButtonStyle())
|
||||
.merge(AppTheme.toolbarButtonStyle(context))
|
||||
.copyWith(
|
||||
backgroundColor: const WidgetStatePropertyAll(Colors.transparent),
|
||||
overlayColor: WidgetStateProperty.resolveWith((states) {
|
||||
|
||||
@@ -24,14 +24,19 @@ class CompactPanelTabs<T> extends StatelessWidget {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => SizedBox(
|
||||
height: AppTheme.isDesktop(context)
|
||||
height: AppTheme.isCompactInspector(context)
|
||||
? AppInspectorMetrics.sectionHeader
|
||||
: AppTheme.isDesktop(context)
|
||||
? AppDesktopMetrics.panelHeader
|
||||
: height,
|
||||
child: Padding(
|
||||
padding:
|
||||
AppTheme.isDesktop(context) &&
|
||||
padding == const EdgeInsets.all(AppSpacing.gap)
|
||||
? const EdgeInsets.symmetric(horizontal: 8, vertical: 4)
|
||||
? EdgeInsets.symmetric(
|
||||
horizontal: 8,
|
||||
vertical: AppTheme.isCompactInspector(context) ? 8 : 4,
|
||||
)
|
||||
: padding,
|
||||
child: SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
|
||||
@@ -53,7 +53,7 @@ class _TimelineControlsPreviewState extends State<_TimelineControlsPreview> {
|
||||
child: SizedBox(
|
||||
height: AppDesktopMetrics.timelineTabs,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: AppSpacing.tiny),
|
||||
padding: const EdgeInsets.symmetric(horizontal: AppSpacing.small),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
@@ -117,7 +117,7 @@ class _TimelineControlsPreviewState extends State<_TimelineControlsPreview> {
|
||||
SizedBox(
|
||||
height: AppDesktopMetrics.timelineToolbar,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: AppSpacing.small),
|
||||
padding: const EdgeInsets.symmetric(horizontal: AppSpacing.medium),
|
||||
child: AppCommandToolbar(
|
||||
groups: [
|
||||
[
|
||||
|
||||
@@ -53,7 +53,9 @@ class WorkspacePanel extends StatelessWidget {
|
||||
title,
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context).textTheme.labelLarge,
|
||||
style: AppTheme.isCompactInspector(context)
|
||||
? Theme.of(context).textTheme.titleSmall
|
||||
: Theme.of(context).textTheme.labelLarge,
|
||||
),
|
||||
),
|
||||
if (controls case final controls?) ...[
|
||||
|
||||
Reference in new issue
Block a user