11import 'package:flutter/material.dart' as material;
22import 'package:querya_desktop/shared/services/data_export_service.dart' ;
33import 'package:querya_desktop/shared/widgets/widgets.dart' ;
4+ import 'package:querya_desktop/core/ui/querya_control_tokens.dart' ;
45
56/// Standard toolbar for [ExtensionTableView] with title, pagination chip, DDL inspection, custom filter toggle, export/save actions, and navigation.
67class ExtensionTableToolbar extends material.StatelessWidget {
@@ -71,14 +72,11 @@ class ExtensionTableToolbar extends material.StatelessWidget {
7172 if (onNavigateHome != null ) ...[
7273 material.Tooltip (
7374 message: 'Return to driver overview' ,
74- child: OutlineButton (
75- size: ButtonSize .small,
75+ child: QueryaButton .secondary (
76+ label: 'Driver' ,
77+ icon: material.Icons .dns_outlined,
7678 onPressed: onNavigateHome,
77- leading: const material.Icon (
78- material.Icons .dns_outlined,
79- size: 14 ,
80- ),
81- child: const Text ('Driver' ),
79+ size: QueryaControlSize .sm,
8280 ),
8381 ),
8482 const Gap (10 ),
@@ -133,26 +131,20 @@ class ExtensionTableToolbar extends material.StatelessWidget {
133131 editAction! ,
134132 const Gap (4 ),
135133 ],
136- OutlineButton (
137- size: ButtonSize .small,
134+ QueryaButton .secondary (
135+ label: 'DDL' ,
136+ icon: material.Icons .code_rounded,
138137 onPressed: onOpenDdl,
139- leading: const material.Icon (
140- material.Icons .code_rounded,
141- size: 16 ,
142- ),
143- child: const Text ('DDL' ),
138+ size: QueryaControlSize .sm,
144139 ),
145140 const Gap (4 ),
146- OutlineButton (
147- size: ButtonSize .small,
148- onPressed: onToggleFilter,
149- leading: material.Icon (
150- isFiltered
141+ QueryaButton .secondary (
142+ label: isFiltered ? 'Filter (active)' : 'Filter' ,
143+ icon: isFiltered
151144 ? material.Icons .filter_alt_rounded
152145 : material.Icons .filter_alt_outlined,
153- size: 15 ,
154- ),
155- child: Text (isFiltered ? 'Filter (active)' : 'Filter' ),
146+ onPressed: onToggleFilter,
147+ size: QueryaControlSize .sm,
156148 ),
157149 if (onCopyFormat != null ) ...[
158150 const Gap (4 ),
@@ -174,59 +166,43 @@ class ExtensionTableToolbar extends material.StatelessWidget {
174166 ],
175167 if (loading && onCancelQuery != null ) ...[
176168 const Gap (4 ),
177- OutlineButton (
178- size: ButtonSize .small,
169+ QueryaButton .ghost (
170+ label: 'Cancel' ,
171+ icon: material.Icons .cancel_outlined,
179172 onPressed: onCancelQuery,
180- leading: const material.Icon (
181- material.Icons .cancel_outlined,
182- size: 15 ,
183- ),
184- child: const Text ('Cancel' ),
173+ size: QueryaControlSize .sm,
185174 ),
186175 ],
187176 const Gap (4 ),
188- OutlineButton (
189- size: ButtonSize .small,
177+ QueryaButton .secondary (
178+ label: 'Prev' ,
179+ icon: material.Icons .chevron_left_rounded,
190180 onPressed: canGoPrevious ? onGoPrevious : null ,
191- leading: const material.Icon (
192- material.Icons .chevron_left_rounded,
193- size: 16 ,
194- ),
195- child: const Text ('Prev' ),
181+ size: QueryaControlSize .sm,
196182 ),
197183 const Gap (4 ),
198- OutlineButton (
199- size: ButtonSize .small,
184+ QueryaButton .secondary (
185+ label: 'Next' ,
186+ icon: material.Icons .chevron_right_rounded,
200187 onPressed: canGoNext ? onGoNext : null ,
201- leading: const material.Icon (
202- material.Icons .chevron_right_rounded,
203- size: 16 ,
204- ),
205- child: const Text ('Next' ),
188+ size: QueryaControlSize .sm,
206189 ),
207190 const Gap (8 ),
208191 if (onRestartDriver != null ) ...[
209- OutlineButton (
210- size: ButtonSize .small,
192+ QueryaButton .secondary (
193+ label: isRestarting ? 'Restarting...' : 'Restart Driver' ,
194+ icon: material.Icons .restart_alt_rounded,
195+ loading: isRestarting,
211196 onPressed: loading || isRestarting ? null : onRestartDriver,
212- leading: isRestarting
213- ? const QueryaSpinner (size: QueryaSpinnerSize .sm)
214- : const material.Icon (
215- material.Icons .restart_alt_rounded,
216- size: 15 ,
217- ),
218- child: Text (isRestarting ? 'Restarting...' : 'Restart Driver' ),
197+ size: QueryaControlSize .sm,
219198 ),
220199 const Gap (4 ),
221200 ],
222- OutlineButton (
223- size: ButtonSize .small,
201+ QueryaButton .secondary (
202+ label: 'Refresh' ,
203+ icon: material.Icons .refresh_rounded,
224204 onPressed: loading ? null : onRefresh,
225- leading: const material.Icon (
226- material.Icons .refresh_rounded,
227- size: 14 ,
228- ),
229- child: const Text ('Refresh' ),
205+ size: QueryaControlSize .sm,
230206 ),
231207 ],
232208 ),
0 commit comments