Skip to content

Commit bfee562

Browse files
authored
Redesign Secondary Windows (#336)
2 parents ea58751 + 6d7629d commit bfee562

File tree

14 files changed

+486
-358
lines changed

14 files changed

+486
-358
lines changed

.github/workflows/build.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ jobs:
1919
token: ${{ secrets.GITHUB_TOKEN }}
2020
submodules: recursive
2121
- name: Extract Build Info
22+
shell: bash
2223
run: |
2324
echo "BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
2425
if [[ "${{ github.ref }}" == "refs/tags/bleeding_edge" ]]; then
@@ -96,6 +97,7 @@ jobs:
9697
token: ${{ secrets.GITHUB_TOKEN }}
9798
submodules: recursive
9899
- name: Extract Build Info
100+
shell: bash
99101
run: |
100102
echo "BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
101103
if [[ "${{ github.ref }}" == "refs/tags/bleeding_edge" ]]; then
@@ -196,6 +198,7 @@ jobs:
196198
submodules: recursive
197199

198200
- name: Extract Build Info
201+
shell: bash
199202
run: |
200203
echo "BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
201204
if [[ "${{ github.ref }}" == "refs/tags/bleeding_edge" ]]; then
@@ -267,6 +270,7 @@ jobs:
267270
submodules: recursive
268271

269272
- name: Extract Build Info
273+
shell: bash
270274
run: |
271275
echo "BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
272276
if [[ "${{ github.ref }}" == "refs/tags/bleeding_edge" ]]; then
@@ -410,12 +414,13 @@ jobs:
410414
token: ${{ secrets.GITHUB_TOKEN }}
411415
submodules: recursive
412416

413-
- name: Extract Build Info
414-
run: |
415-
echo "BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
416-
if [[ "${{ github.ref }}" == "refs/tags/bleeding_edge" ]]; then
417-
echo "BUILD_NAME=3.0.0-bleeding_edge+${{ github.run_number }}" >> $GITHUB_ENV
418-
fi
417+
# - name: Extract Build Info
418+
# shell: bash
419+
# run: |
420+
# echo "BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
421+
# if [[ "${{ github.ref }}" == "refs/tags/bleeding_edge" ]]; then
422+
# echo "BUILD_NAME=3.0.0-bleeding_edge+${{ github.run_number }}" >> $GITHUB_ENV
423+
# fi
419424

420425
- name: Install Flutter
421426
uses: subosito/[email protected]
@@ -432,7 +437,7 @@ jobs:
432437
433438
- name: Build
434439
run: |
435-
flutterpi_tool build --release --cpu=pi4 --build-number=${{ env.BUILD_NUMBER }} ${{ env.BUILD_NAME && format('--build-name={0}', env.BUILD_NAME) }}
440+
flutterpi_tool build --release --cpu=pi4
436441
437442
build_web:
438443
name: Bluecherry Web
@@ -445,6 +450,7 @@ jobs:
445450
submodules: recursive
446451

447452
- name: Extract Build Info
453+
shell: bash
448454
run: |
449455
echo "BUILD_NUMBER=${{ github.run_number }}" >> $GITHUB_ENV
450456
if [[ "${{ github.ref }}" == "refs/tags/bleeding_edge" ]]; then

lib/main.dart

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import 'package:bluecherry_client/firebase_messaging_background_handler.dart';
2626
import 'package:bluecherry_client/l10n/generated/app_localizations.dart';
2727
import 'package:bluecherry_client/models/device.dart';
2828
import 'package:bluecherry_client/models/event.dart';
29+
import 'package:bluecherry_client/models/layout.dart';
2930
import 'package:bluecherry_client/models/server.dart';
3031
import 'package:bluecherry_client/providers/downloads_provider.dart';
3132
import 'package:bluecherry_client/providers/events_provider.dart';
@@ -396,6 +397,21 @@ class _UnityAppState extends State<UnityApp>
396397
);
397398
}
398399

400+
if (settings.name == '/fullscreen-layout') {
401+
final data = settings.arguments! as Map;
402+
final Layout layout = data['layout'];
403+
404+
return MaterialPageRoute(
405+
settings: RouteSettings(
406+
name: settings.name,
407+
arguments: layout,
408+
),
409+
builder: (context) {
410+
return AlternativeLayoutView(layout: layout);
411+
},
412+
);
413+
}
414+
399415
if (settings.name == '/rtsp') {
400416
final url = settings.arguments as String;
401417
return MaterialPageRoute(

lib/screens/layouts/desktop/layout_view.dart

Lines changed: 33 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,15 @@ class LayoutView extends StatelessWidget {
206206
this.onAccept,
207207
this.onWillAccept,
208208
this.onReorder,
209+
this.showOptions,
209210
});
210211

211212
final Layout layout;
212213

213214
final ValueChanged<Device>? onAccept;
214215
final DragTargetWillAccept<Device>? onWillAccept;
215216
final ReorderCallback? onReorder;
217+
final bool? showOptions;
216218

217219
@override
218220
Widget build(BuildContext context) {
@@ -378,7 +380,7 @@ class LayoutView extends StatelessWidget {
378380
child: SafeArea(
379381
child: Column(
380382
children: [
381-
if (!settings.isImmersiveMode && !isAlternativeWindow)
383+
if (showOptions ?? !settings.isImmersiveMode)
382384
Padding(
383385
padding: const EdgeInsets.all(16.0),
384386
child: IntrinsicHeight(
@@ -414,8 +416,13 @@ class LayoutView extends StatelessWidget {
414416

415417
class LayoutOptions extends StatefulWidget {
416418
final Layout layout;
419+
final bool isFullscreen;
417420

418-
const LayoutOptions({super.key, required this.layout});
421+
const LayoutOptions({
422+
super.key,
423+
required this.layout,
424+
this.isFullscreen = false,
425+
});
419426

420427
@override
421428
State<LayoutOptions> createState() => _LayoutOptionsState();
@@ -432,6 +439,8 @@ class _LayoutOptionsState extends State<LayoutOptions> {
432439
final isAlternativeWindow = AlternativeWindow.maybeOf(context) != null;
433440

434441
return Row(
442+
spacing: 4.0,
443+
mainAxisAlignment: MainAxisAlignment.end,
435444
children: [
436445
if (widget.layout.devices.isNotEmpty)
437446
...() {
@@ -493,18 +502,30 @@ class _LayoutOptionsState extends State<LayoutOptions> {
493502
tooltip: loc.openInANewWindow,
494503
onPressed: widget.layout.openInANewWindow,
495504
),
505+
if (!isAlternativeWindow && !widget.isFullscreen)
506+
SquaredIconButton(
507+
icon: Icon(Icons.fullscreen_rounded, color: Colors.white),
508+
tooltip: loc.showFullscreenCamera,
509+
onPressed: () async {
510+
Navigator.of(context).pushNamed(
511+
'/fullscreen-layout',
512+
arguments: {'layout': widget.layout},
513+
);
514+
},
515+
),
496516
// TODO(bdlukaa): "Add" button. Displays a popup with the current
497517
// available cameras
498-
SquaredIconButton(
499-
icon: const Icon(Icons.edit, color: Colors.white),
500-
tooltip: loc.editLayout,
501-
onPressed: () {
502-
showDialog(
503-
context: context,
504-
builder: (context) => EditLayoutDialog(layout: widget.layout),
505-
);
506-
},
507-
),
518+
if (!isAlternativeWindow && !widget.isFullscreen)
519+
SquaredIconButton(
520+
icon: const Icon(Icons.edit, color: Colors.white),
521+
tooltip: loc.editLayout,
522+
onPressed: () {
523+
showDialog(
524+
context: context,
525+
builder: (context) => EditLayoutDialog(layout: widget.layout),
526+
);
527+
},
528+
),
508529
SquaredIconButton(
509530
icon: const Icon(Icons.import_export, color: Colors.white),
510531
tooltip: loc.exportLayout,

lib/screens/layouts/desktop/sidebar.dart

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@ const kCompactSidebarConstraints = BoxConstraints(maxWidth: 80.0);
2525

2626
class DesktopSidebar extends StatefulWidget {
2727
final Widget collapseButton;
28+
final bool showLayoutManager;
2829

29-
const DesktopSidebar({super.key, required this.collapseButton});
30+
const DesktopSidebar({
31+
super.key,
32+
required this.collapseButton,
33+
this.showLayoutManager = true,
34+
});
3035

3136
@override
3237
State<DesktopSidebar> createState() => _DesktopSidebarState();
@@ -70,15 +75,16 @@ class _DesktopSidebarState extends State<DesktopSidebar> {
7075
child: Column(
7176
crossAxisAlignment: CrossAxisAlignment.start,
7277
children: [
73-
LayoutManager(
74-
collapseButton: widget.collapseButton,
75-
onSearchChanged: (text) {
76-
setState(() {
77-
searchQuery = text;
78-
_updateServers();
79-
});
80-
},
81-
),
78+
if (widget.showLayoutManager)
79+
LayoutManager(
80+
collapseButton: widget.collapseButton,
81+
onSearchChanged: (text) {
82+
setState(() {
83+
searchQuery = text;
84+
_updateServers();
85+
});
86+
},
87+
),
8288
if (servers.servers.isEmpty)
8389
const Expanded(child: NoServers())
8490
else

0 commit comments

Comments
 (0)