@@ -13,14 +13,14 @@ import 'package:flutter/material.dart' as material
1313 Icons,
1414 MouseRegion,
1515 AnimatedContainer,
16- AnimatedScale,
1716 SystemMouseCursors,
1817 SizedBox,
1918 SingleChildScrollView,
2019 Row,
2120 MainAxisSize,
2221 Widget,
23- BoxConstraints;
22+ BoxConstraints,
23+ Tooltip;
2424import 'package:querya_desktop/core/layout/vertical_split_pane.dart' ;
2525import 'package:querya_desktop/core/motion/querya_cross_fade_stack.dart' ;
2626import 'package:querya_desktop/core/motion/querya_motion.dart' ;
@@ -406,31 +406,22 @@ class _TabButtonState extends State<_TabButton> {
406406 }
407407}
408408
409- class _RunButton extends StatefulWidget {
409+ class _RunButton extends StatelessWidget {
410410 const _RunButton ();
411411
412- @override
413- State <_RunButton > createState () => _RunButtonState ();
414- }
415-
416- class _RunButtonState extends State <_RunButton > {
417- bool _hovered = false ;
412+ static const _noConnectionTooltip =
413+ 'Select an active database connection to execute queries' ;
418414
419415 @override
420416 Widget build (BuildContext context) {
421- return material.MouseRegion (
422- onEnter: (_) => setState (() => _hovered = true ),
423- onExit: (_) => setState (() => _hovered = false ),
424- cursor: material.SystemMouseCursors .click,
425- child: material.AnimatedScale (
426- scale: _hovered ? 1.03 : 1.0 ,
427- duration: context.motionDuration (QueryaMotion .fast),
428- curve: context.motionCurve (QueryaMotion .enter),
429- child: OutlineButton (
430- onPressed: () {},
431- leading: const material.Icon (material.Icons .play_arrow, size: 18 ),
432- child: const Text ('Execute/Refresh (F5)' ),
433- ),
417+ return const material.Tooltip (
418+ message: _noConnectionTooltip,
419+ waitDuration: Duration (milliseconds: 450 ),
420+ child: OutlineButton (
421+ key: Key ('workspace_run_button' ),
422+ onPressed: null ,
423+ leading: material.Icon (material.Icons .play_arrow, size: 18 ),
424+ child: Text ('Execute/Refresh (F5)' ),
434425 ),
435426 );
436427 }
0 commit comments