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
@@ -5,7 +5,6 @@ import '../../l10n/l10n.dart';
|
||||
import '../../workspace/project_state.dart';
|
||||
|
||||
import 'package:cutdex_ui/theme.dart';
|
||||
import 'package:cutdex_ui/widgets.dart';
|
||||
|
||||
class EmptyEditor extends StatelessWidget {
|
||||
const EmptyEditor({
|
||||
@@ -13,32 +12,44 @@ class EmptyEditor extends StatelessWidget {
|
||||
required this.state,
|
||||
required this.headerLeading,
|
||||
required this.showProjectName,
|
||||
this.desktop = false,
|
||||
});
|
||||
|
||||
final ProjectState state;
|
||||
final Widget headerLeading;
|
||||
final bool showProjectName;
|
||||
final bool desktop;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: AppControlSize.panelHeader,
|
||||
child: WindowHeaderPadding(
|
||||
child: Row(
|
||||
children: [
|
||||
headerLeading,
|
||||
if (showProjectName)
|
||||
Expanded(
|
||||
child: Text(
|
||||
state.activeProject?.name ?? '',
|
||||
key: const Key('workspace-project-title'),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context).textTheme.titleSmall,
|
||||
height: desktop
|
||||
? AppControlSize.panelToolbar
|
||||
: AppControlSize.panelHeader,
|
||||
child: Padding(
|
||||
padding: desktop
|
||||
? const EdgeInsets.symmetric(
|
||||
horizontal: AppSidebarMetrics.outerPadding,
|
||||
vertical: AppSpacing.gap,
|
||||
)
|
||||
: EdgeInsets.zero,
|
||||
child: WindowHeaderPadding(
|
||||
child: Row(
|
||||
children: [
|
||||
headerLeading,
|
||||
if (showProjectName)
|
||||
Expanded(
|
||||
child: Text(
|
||||
state.activeProject?.name ?? '',
|
||||
key: const Key('workspace-project-title'),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
style: Theme.of(context).textTheme.titleSmall,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
@@ -77,40 +88,3 @@ class EmptyEditor extends StatelessWidget {
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
class ProjectLoadingRegion extends StatelessWidget {
|
||||
const ProjectLoadingRegion({
|
||||
super.key,
|
||||
required this.loading,
|
||||
required this.child,
|
||||
});
|
||||
|
||||
final bool loading;
|
||||
final Widget child;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) => Stack(
|
||||
fit: StackFit.expand,
|
||||
children: [
|
||||
ExcludeFocus(
|
||||
excluding: loading,
|
||||
child: IgnorePointer(ignoring: loading, child: child),
|
||||
),
|
||||
if (loading)
|
||||
DelayedLoadingIndicator(
|
||||
child: Positioned.fill(
|
||||
child: ColoredBox(
|
||||
key: const Key('editor-project-loading'),
|
||||
color: Theme.of(context).colorScheme.surface,
|
||||
child: const Center(
|
||||
child: SizedBox.square(
|
||||
dimension: 20,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user