Gitea CI / Build Android APK (pull_request) Canceled after 0s
Gitea CI / Build Windows x64 app (pull_request) Canceled after 0s
Gitea CI / Audit and package Windows x64 (pull_request) Canceled after 0s
Gitea CI / Assemble and validate CI artifacts (pull_request) Canceled after 0s
Gitea CI / Gitea CI passed (pull_request) Canceled after 0s
Gitea CI / Check code and tests (pull_request) Canceled after 6m29s
72 lines
2.1 KiB
Dart
72 lines
2.1 KiB
Dart
import 'package:cutdex_ui/icons.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
import '../../integrations/platform/editor_window_chrome.dart';
|
|
|
|
import 'package:cutdex_native/cutdex_native.dart';
|
|
|
|
import '../../l10n/l10n.dart';
|
|
|
|
/// Navigation and mode controls for bounded workspaces. Drawer visibility is
|
|
/// local presentation state and never overwrites the desktop sidebar preference.
|
|
class WorkspaceFrame extends StatelessWidget {
|
|
const WorkspaceFrame({
|
|
super.key,
|
|
required this.navigation,
|
|
required this.headerActions,
|
|
required this.title,
|
|
required this.integratedTitlebar,
|
|
required this.child,
|
|
this.bottomNavigationBar,
|
|
});
|
|
|
|
final Widget navigation;
|
|
final Widget headerActions;
|
|
final String title;
|
|
final bool integratedTitlebar;
|
|
final Widget child;
|
|
final Widget? bottomNavigationBar;
|
|
|
|
@override
|
|
Widget build(BuildContext context) => Scaffold(
|
|
drawer: Drawer(width: 320, child: SafeArea(child: navigation)),
|
|
body: Column(
|
|
children: [
|
|
SizedBox(
|
|
key: const Key('workspace-window-header'),
|
|
height: 48,
|
|
child: WindowHeaderPadding(
|
|
child: Row(
|
|
children: [
|
|
if (integratedTitlebar)
|
|
SizedBox(width: EditorWindowChrome.leadingWidth),
|
|
HeaderControlRegion(
|
|
child: Builder(
|
|
builder: (context) => IconButton(
|
|
key: const Key('workspace-navigation-button'),
|
|
tooltip: context.l10n.expandSidebar,
|
|
onPressed: () => Scaffold.of(context).openDrawer(),
|
|
icon: const Icon(AppIcons.menu),
|
|
),
|
|
),
|
|
),
|
|
Expanded(
|
|
child: Text(
|
|
title,
|
|
maxLines: 1,
|
|
overflow: TextOverflow.ellipsis,
|
|
),
|
|
),
|
|
headerActions,
|
|
],
|
|
),
|
|
),
|
|
),
|
|
const Divider(height: 1),
|
|
Expanded(child: child),
|
|
],
|
|
),
|
|
bottomNavigationBar: bottomNavigationBar,
|
|
);
|
|
}
|