Fix bug where settings widgets were not centered by using a shared widget.
diff --git a/packages/devtools_app/lib/src/common_widgets.dart b/packages/devtools_app/lib/src/common_widgets.dart index 21ada7b..45f411c 100644 --- a/packages/devtools_app/lib/src/common_widgets.dart +++ b/packages/devtools_app/lib/src/common_widgets.dart
@@ -254,30 +254,24 @@ class SettingsOutlinedButton extends StatelessWidget { const SettingsOutlinedButton({ @required this.onPressed, - @required this.tooltip, + @required this.label, }); final VoidCallback onPressed; - final String tooltip; + final String label; @override Widget build(BuildContext context) { - return SizedBox( - // TODO(kenz): this height should be unnecessary once - // https://github.com/flutter/flutter/issues/79894 is fixed. - height: defaultButtonHeight, - width: defaultButtonHeight, // This will result in a square button. - child: DevToolsTooltip( - tooltip: tooltip, - child: OutlinedButton( - onPressed: onPressed, - child: const Icon( - Icons.settings, - size: defaultIconSize, - ), - ), - ), + return IconLabelButton( + onPressed: onPressed, + icon: Icons.settings, + label: label, + // TODO(jacobr): consider a more conservative min-width. To minimize the + // impact on the existing UI and deal with the fact that some of the + // existing label names are fairly verbose, we set a width that will + // never be hit. + includeTextWidth: 20000, ); } }
diff --git a/packages/devtools_app/lib/src/memory/memory_screen.dart b/packages/devtools_app/lib/src/memory/memory_screen.dart index a1e78f8..c3659dc 100644 --- a/packages/devtools_app/lib/src/memory/memory_screen.dart +++ b/packages/devtools_app/lib/src/memory/memory_screen.dart
@@ -21,7 +21,6 @@ import '../ui/icons.dart'; import '../ui/utils.dart'; import '../utils.dart'; - import 'memory_android_chart.dart' as android; import 'memory_charts.dart'; import 'memory_controller.dart'; @@ -606,7 +605,7 @@ const SizedBox(width: denseSpacing), SettingsOutlinedButton( onPressed: _openSettingsDialog, - tooltip: 'Memory Configuration', + label: 'Memory Configuration', ), ], );
diff --git a/packages/devtools_app/lib/src/performance/performance_screen.dart b/packages/devtools_app/lib/src/performance/performance_screen.dart index 1ff648a..e0151fe 100644 --- a/packages/devtools_app/lib/src/performance/performance_screen.dart +++ b/packages/devtools_app/lib/src/performance/performance_screen.dart
@@ -250,7 +250,7 @@ const SizedBox(width: defaultSpacing), SettingsOutlinedButton( onPressed: _openSettingsDialog, - tooltip: 'Performance Settings', + label: 'Performance Settings', ), ], );
diff --git a/packages/devtools_app/lib/src/provider/provider_screen.dart b/packages/devtools_app/lib/src/provider/provider_screen.dart index 4ffe639..b23788c 100644 --- a/packages/devtools_app/lib/src/provider/provider_screen.dart +++ b/packages/devtools_app/lib/src/provider/provider_screen.dart
@@ -108,7 +108,7 @@ builder: (_) => _StateInspectorSettingsDialog(), ); }, - tooltip: _StateInspectorSettingsDialog.title, + label: _StateInspectorSettingsDialog.title, ), ], ),