feat(workspace): add workflow navigation and resizable desktop panels
This commit is contained in:
1 parent
02413383d8
commit
1acfe4a005
17 files changed
+2008
-277
No files matched your search
@@ -1,12 +1,21 @@
|
||||
import 'dart:math' as math;
|
||||
|
||||
abstract final class WorkspaceLayoutMetrics {
|
||||
static const desktopSpacing = 6.0;
|
||||
static const desktopOuterSpacing = 6.0;
|
||||
static const desktopResizeSlop = 2.0;
|
||||
static const desktopResizeHitExtent = desktopSpacing + 2 * desktopResizeSlop;
|
||||
// Keep the cards compact; their two facing borders add another 2 px.
|
||||
static const desktopSpacing = 2.0;
|
||||
static const desktopOuterSpacing = desktopSpacing;
|
||||
// Resize targets overlap the panel edges without widening the visible gap.
|
||||
static const desktopResizeHitExtent = 10.0;
|
||||
// Cover the gutter and its facing borders without changing the hit target.
|
||||
static const desktopResizeHighlightThickness = 4.0;
|
||||
static const desktopResizeSlop =
|
||||
(desktopResizeHitExtent - desktopSpacing) / 2;
|
||||
static const dualPaneMinimumWidth = 840.0;
|
||||
|
||||
static const sidebarDefaultWidth = 240.0;
|
||||
static const sidebarMinimumWidth = 220.0;
|
||||
// Like VS Code SplitView, snap closed halfway past the minimum width.
|
||||
static const sidebarSnapThreshold = sidebarMinimumWidth / 2;
|
||||
static const sidebarWidthLimit = 320.0;
|
||||
static const contentMinimumWidth = 320.0;
|
||||
|
||||
@@ -15,9 +24,24 @@ abstract final class WorkspaceLayoutMetrics {
|
||||
static const previewMinimumHeight = 180.0;
|
||||
|
||||
static const mediaPanelWidth = 260.0;
|
||||
static const propertiesPanelWidth = 260.0;
|
||||
static const mediaPanelMinimumWidth = 220.0;
|
||||
static const propertiesPanelWidth = 240.0;
|
||||
static const previewMinimumWidth = 320.0;
|
||||
|
||||
static double resolveTimelineHeight(
|
||||
double availableHeight,
|
||||
double? requestedHeight,
|
||||
) {
|
||||
final maximum = math.max(
|
||||
0.0,
|
||||
availableHeight - desktopSpacing - previewMinimumHeight,
|
||||
);
|
||||
final minimum = math.min(timelineMinimumHeight, maximum);
|
||||
return (requestedHeight ?? availableHeight * timelineDefaultHeightFraction)
|
||||
.clamp(minimum, maximum)
|
||||
.toDouble();
|
||||
}
|
||||
|
||||
static double sidebarMaximumWidth(double availableWidth) =>
|
||||
(availableWidth - contentMinimumWidth)
|
||||
.clamp(sidebarMinimumWidth, sidebarWidthLimit)
|
||||
|
||||
Reference in new issue
Block a user