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
@@ -97,6 +97,18 @@ class _ComposerProjectSelectorState extends State<ComposerProjectSelector> {
|
||||
final projects = widget.projects
|
||||
.where((project) => project.name.toLowerCase().contains(query))
|
||||
.toList();
|
||||
final listHeight = projects.isEmpty
|
||||
? ComposerLayout.menuRowHeight +
|
||||
AppComposerStyle.menuEmptyPadding.vertical
|
||||
: (projects.length * ComposerLayout.menuRowHeight).clamp(
|
||||
0.0,
|
||||
ComposerLayout.menuListMaxHeight,
|
||||
);
|
||||
final contentHeight =
|
||||
ComposerLayout.menuRowHeight * 2 +
|
||||
(AppComposerStyle.menuSeparatorPadding.vertical + 1) * 2 +
|
||||
listHeight;
|
||||
final menuHeight = contentHeight + ComposerLayout.menuGutter * 2;
|
||||
return Material(
|
||||
key: const Key('composer-project-bar'),
|
||||
color: widget.backgroundColor,
|
||||
@@ -109,12 +121,15 @@ class _ComposerProjectSelectorState extends State<ComposerProjectSelector> {
|
||||
alignment: AlignmentDirectional.centerStart,
|
||||
child: MenuAnchor(
|
||||
controller: _menu,
|
||||
alignmentOffset: Offset(0, -menuHeight - 4),
|
||||
consumeOutsideTap: false,
|
||||
onClose: () => setState(_search.clear),
|
||||
style: AppComposerStyle.projectMenu(context),
|
||||
style: AppComposerStyle.projectMenu(context)
|
||||
.copyWith(alignment: AlignmentDirectional.topStart),
|
||||
menuChildren: [
|
||||
SizedBox(
|
||||
width: ComposerLayout.menuContentWidth,
|
||||
height: contentHeight,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
@@ -134,10 +149,7 @@ class _ComposerProjectSelectorState extends State<ComposerProjectSelector> {
|
||||
),
|
||||
),
|
||||
_separator(),
|
||||
ConstrainedBox(
|
||||
constraints: const BoxConstraints(
|
||||
maxHeight: ComposerLayout.menuListMaxHeight,
|
||||
),
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
primary: false,
|
||||
child: Column(
|
||||
|
||||
Reference in new issue
Block a user