Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/flutter_scene_editor_app/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ void main() {
exit(1);
}
WidgetsFlutterBinding.ensureInitialized();
final controller = RegularWindowController(
final controller = WindowController(
size: const Size(1280, 800),
// The runner styles the window with a hidden title bar by this title
// (see AppDelegate.swift); keep the two in sync.
title: 'Scene Editor',
delegate: _MainWindowDelegate(),
);
runWidget(
RegularWindow(controller: controller, child: const FlutterSceneEditorApp()),
Window(controller: controller, child: const FlutterSceneEditorApp()),
);
}

/// Quits the app when the main editor window closes, taking any floating
/// panel windows with it.
class _MainWindowDelegate with RegularWindowControllerDelegate {
class _MainWindowDelegate with WindowControllerDelegate {
@override
void onWindowDestroyed() {
exit(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import 'package:scene/scene.dart';
// ignore: implementation_imports
import 'package:flutter/material.dart';
// Not re-exported through material.dart on 3.47 stable.
import 'package:flutter/rendering.dart' show ScrollCacheExtent;
import 'package:flutter/services.dart';

import '../controller/editor_controller.dart';
Expand Down
10 changes: 5 additions & 5 deletions packages/flutter_scene_editor/lib/src/shell/docking_shell.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ class _DockingShellState extends State<DockingShell> {

// One native window per floating panel, keyed by panel id and kept in sync
// with the layout's floating list.
final Map<String, RegularWindowController> _floatControllers = {};
final Map<String, WindowController> _floatControllers = {};

@override
void initState() {
Expand Down Expand Up @@ -139,7 +139,7 @@ class _DockingShellState extends State<DockingShell> {
for (final id in _layout.floating) {
_floatControllers.putIfAbsent(
id,
() => RegularWindowController(
() => WindowController(
size: const Size(480, 640),
title: _panelById(id)?.title ?? id,
delegate: _FloatWindowDelegate(() => _redock(id)),
Expand Down Expand Up @@ -168,7 +168,7 @@ class _DockingShellState extends State<DockingShell> {
views: [
for (final id in _layout.floating)
if (_floatControllers[id] != null)
RegularWindow(
Window(
controller: _floatControllers[id]!,
child: _FloatWindowScaffold(
theme: theme,
Expand Down Expand Up @@ -226,13 +226,13 @@ class _DockingShellState extends State<DockingShell> {

/// Re-docks the panel instead of destroying the window outright when the user
/// clicks the native close button; the shell then tears the window down.
class _FloatWindowDelegate with RegularWindowControllerDelegate {
class _FloatWindowDelegate with WindowControllerDelegate {
_FloatWindowDelegate(this.onCloseRequested);

final VoidCallback onCloseRequested;

@override
void onWindowCloseRequested(RegularWindowController controller) {
void onWindowCloseRequested(WindowController controller) {
onCloseRequested();
}
}
Expand Down