Gitea CI / Assemble and validate CI artifacts (push) Successful in 1m47s
Gitea CI / Check code and tests (push) Successful in 7m15s
Gitea CI / Build Android APK (push) Successful in 4m6s
Gitea CI / Build Windows x64 app (push) Successful in 3m34s
Gitea CI / Audit and package Windows x64 (push) Successful in 1m29s
Gitea CI / Gitea CI passed (push) Successful in 1s
Gitea Release / Prepare draft Release (push) Failing after 8s
Gitea Release / Upload Android to draft Release (push) Skipped
Gitea Release / Upload Windows to draft Release (push) Skipped
Gitea Release / Verify and publish Release (push) Skipped
50 lines
1.8 KiB
Dart
50 lines
1.8 KiB
Dart
import 'dart:math' as math;
|
|
|
|
abstract final class WorkspaceLayoutMetrics {
|
|
// 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;
|
|
|
|
static const timelineDefaultHeightFraction = 0.36;
|
|
static const timelineMinimumHeight = 220.0;
|
|
static const previewMinimumHeight = 180.0;
|
|
|
|
static const mediaPanelWidth = 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)
|
|
.toDouble();
|
|
}
|