Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(761)

Unified Diff: runtime/observatory/lib/src/elements/debugger.dart

Issue 1305163002: Update debugger console height when window is resized. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/observatory/lib/src/elements/debugger.dart
diff --git a/runtime/observatory/lib/src/elements/debugger.dart b/runtime/observatory/lib/src/elements/debugger.dart
index 60ecd0785e6904a76240e0d27146f63e9782f89a..78d9cf5deacf622545e216e284507e82302ec21b 100644
--- a/runtime/observatory/lib/src/elements/debugger.dart
+++ b/runtime/observatory/lib/src/elements/debugger.dart
@@ -1700,6 +1700,7 @@ class DebuggerPageElement extends ObservatoryElement {
debugger.page = this;
}
+ StreamSubscription _resizeSubscription;
Future<StreamSubscription> _isolateSubscriptionFuture;
Future<StreamSubscription> _debugSubscriptionFuture;
Future<StreamSubscription> _stdoutSubscriptionFuture;
@@ -1709,21 +1710,7 @@ class DebuggerPageElement extends ObservatoryElement {
@override
void attached() {
super.attached();
-
- var navbarDiv = $['navbarDiv'];
- var stackDiv = $['stackDiv'];
- var splitterDiv = $['splitterDiv'];
- var cmdDiv = $['commandDiv'];
-
- int navbarHeight = navbarDiv.clientHeight;
- int splitterHeight = splitterDiv.clientHeight;
- int cmdHeight = cmdDiv.clientHeight;
-
- int windowHeight = window.innerHeight;
- int fixedHeight = navbarHeight + splitterHeight + cmdHeight;
- int available = windowHeight - fixedHeight;
- int stackHeight = available ~/ 1.6;
- stackDiv.style.setProperty('height', '${stackHeight}px');
+ _onResize(null);
// Wire the debugger object to the stack, console, and command line.
var stackElement = $['stackElement'];
@@ -1734,6 +1721,7 @@ class DebuggerPageElement extends ObservatoryElement {
debugger.input.debugger = debugger;
debugger.init();
+ _resizeSubscription = window.onResize.listen(_onResize);
_isolateSubscriptionFuture =
app.vm.listenEventStream(VM.kIsolateStream, debugger.onEvent);
_debugSubscriptionFuture =
@@ -1774,9 +1762,28 @@ class DebuggerPageElement extends ObservatoryElement {
debugger.flushStdio();
}
+ void _onResize(_) {
+ var navbarDiv = $['navbarDiv'];
+ var stackDiv = $['stackDiv'];
+ var splitterDiv = $['splitterDiv'];
+ var cmdDiv = $['commandDiv'];
+
+ int navbarHeight = navbarDiv.clientHeight;
+ int splitterHeight = splitterDiv.clientHeight;
+ int cmdHeight = cmdDiv.clientHeight;
+
+ int windowHeight = window.innerHeight;
+ int fixedHeight = navbarHeight + splitterHeight + cmdHeight;
+ int available = windowHeight - fixedHeight;
+ int stackHeight = available ~/ 1.6;
+ stackDiv.style.setProperty('height', '${stackHeight}px');
+ }
+
@override
void detached() {
debugger.isolate = null;
+ _resizeSubscription.cancel();
+ _resizeSubscrption = null;
cancelFutureSubscription(_isolateSubscriptionFuture);
_isolateSubscriptionFuture = null;
cancelFutureSubscription(_debugSubscriptionFuture);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698