@@ -5,7 +5,6 @@ import 'package:querya_desktop/features/settings/preferences_dialog.dart';
55import 'package:querya_desktop/features/settings/sql_statement_timeout_dropdown.dart' ;
66import 'package:querya_desktop/features/workspace/sql_execution_delegate.dart' ;
77import 'package:querya_desktop/features/workspace/sql_query_tab_session.dart' ;
8- import 'package:querya_desktop/shared/widgets/querya_action_menu.dart' ;
98import 'package:querya_desktop/shared/widgets/widgets.dart' ;
109
1110/// Choices for the session options dropdown.
@@ -147,7 +146,6 @@ class SqlWorkspaceToolbar extends StatelessWidget {
147146
148147 @override
149148 material.Widget build (material.BuildContext context) {
150- final accent = context.workbench.accent;
151149 return material.LayoutBuilder (
152150 builder: (context, constraints) {
153151 final compact = constraints.maxWidth < compactWidthBreakpoint;
@@ -159,17 +157,15 @@ class SqlWorkspaceToolbar extends StatelessWidget {
159157 headerBadge! ,
160158 const material.SizedBox (width: 12 ),
161159 ],
162- QueryaActionButton (
163- key: const material.ValueKey ('run_script' ),
160+ QueryaSplitButton <bool >(
161+ mainKey: const material.ValueKey ('run_script' ),
162+ menuKey: const material.ValueKey ('run_menu' ),
164163 label: 'Execute (F5)' ,
165164 icon: material.Icons .play_arrow_rounded,
166165 compact: compact,
167166 loading: session.running,
168167 onPressed: () => onExecute (false ),
169- ),
170- const material.SizedBox (width: 4 ),
171- QueryaActionMenu <bool >(
172- key: const material.ValueKey ('run_menu' ),
168+ menuTooltip: 'Run options' ,
173169 items: [
174170 QueryaActionMenuItem (
175171 value: true ,
@@ -187,10 +183,6 @@ class SqlWorkspaceToolbar extends StatelessWidget {
187183 onExecute (atCursor);
188184 }
189185 },
190- child: const material.Icon (
191- material.Icons .expand_more_rounded,
192- size: 16 ,
193- ),
194186 ),
195187 if (delegate.supportsExplain) ...[
196188 const material.SizedBox (width: 8 ),
@@ -267,44 +259,15 @@ class SqlWorkspaceToolbar extends StatelessWidget {
267259 ],
268260 const material.SizedBox (width: 8 ),
269261 ],
270- material.IgnorePointer (
271- ignoring: session.running,
272- child: material.Opacity (
273- opacity: session.running ? 0.5 : 1 ,
274- child: QueryaActionMenu <SqlWorkspaceSessionChoice >(
275- key: const material.ValueKey ('session_menu' ),
276- items: _sessionMenuItems (),
277- onSelected: (choice) => _onSessionChoice (context, choice),
278- child: material.Padding (
279- padding: const material.EdgeInsets .symmetric (
280- horizontal: 10 ,
281- vertical: 6 ,
282- ),
283- child: material.Row (
284- mainAxisSize: material.MainAxisSize .min,
285- children: [
286- material.Icon (
287- material.Icons .tune_rounded,
288- size: 16 ,
289- color: accent,
290- ),
291- const material.SizedBox (width: 6 ),
292- if (! compact) ...[
293- Text (autocommit
294- ? 'Session · auto-commit'
295- : 'Session · manual' ),
296- const material.SizedBox (width: 4 ),
297- ],
298- material.Icon (
299- material.Icons .expand_more_rounded,
300- size: 16 ,
301- color: accent,
302- ),
303- ],
304- ),
305- ),
306- ),
307- ),
262+ QueryaMenuButton <SqlWorkspaceSessionChoice >(
263+ key: const material.ValueKey ('session_menu' ),
264+ items: _sessionMenuItems (),
265+ onSelected: (choice) => _onSessionChoice (context, choice),
266+ enabled: ! session.running,
267+ icon: material.Icons .tune_rounded,
268+ label: compact
269+ ? null
270+ : (autocommit ? 'Session · auto-commit' : 'Session · manual' ),
308271 ),
309272 if (extraTrailing != null ) ...[
310273 const material.SizedBox (width: 8 ),
0 commit comments