diff --git a/lib/src/pages/manager.dart b/lib/src/pages/manager.dart index f721775..987afb1 100644 --- a/lib/src/pages/manager.dart +++ b/lib/src/pages/manager.dart @@ -106,19 +106,37 @@ class _ManagerState extends State with PreferencesMixin { Widget _buildVmList() { List _widgetList = []; - _widgetList.add(TextButton( - onPressed: () async { - String? result = await FilePicker.platform.getDirectoryPath(); - if (result != null) { - setState(() { - Directory.current = result; - }); + _widgetList.add( + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + Directory.current.path, + ), + const SizedBox( + width: 8, + ), + ElevatedButton( + style: ElevatedButton.styleFrom( + primary: Theme.of(context).canvasColor, + onPrimary: Theme.of(context).brightness == Brightness.dark ? Colors.white70 : Theme.of(context).colorScheme.primary, + ), + onPressed: () async { + String? result = await FilePicker.platform.getDirectoryPath(); + if (result != null) { + setState(() { + Directory.current = result; + }); - savePreference(prefWorkingDirectory, Directory.current.path); - _getVms(context); - } - }, - child: Text(Directory.current.path))); + savePreference(prefWorkingDirectory, Directory.current.path); + _getVms(context); + } + }, + child: const Icon(Icons.more_horiz), + ), + ], + ), + ); List> rows = _currentVms.map((vm) { return _buildRow(vm); }).toList(); diff --git a/lib/src/widgets/home_page/downloader_menu.dart b/lib/src/widgets/home_page/downloader_menu.dart index c0eb3f1..f77feaa 100644 --- a/lib/src/widgets/home_page/downloader_menu.dart +++ b/lib/src/widgets/home_page/downloader_menu.dart @@ -24,7 +24,7 @@ class _DownloaderMenuState extends State with PreferencesMixin { } }); } - + @override Widget build(BuildContext context) { return Expanded( @@ -47,20 +47,33 @@ class _DownloaderMenuState extends State with PreferencesMixin { ), ], ), - InkWell( - onTap: () async { - var folder = await FilePicker.platform.getDirectoryPath(dialogTitle: "Pick a folder"); - if (folder != null) { - setState(() { - Directory.current = folder; - }); - savePreference(prefWorkingDirectory, Directory.current.path); - } - }, - child: Text( - "Working directory : ${Directory.current.path}", - style: Theme.of(context).textTheme.subtitle1!.copyWith(color: Colors.white), - ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "Working directory : ${Directory.current.path}", + style: Theme.of(context).textTheme.subtitle1!.copyWith(color: Colors.white), + ), + const SizedBox( + width: 8, + ), + ElevatedButton( + style: ElevatedButton.styleFrom( + primary: Theme.of(context).canvasColor, + onPrimary: Theme.of(context).brightness == Brightness.dark ? Colors.white70 : Theme.of(context).colorScheme.primary, + ), + onPressed: () async { + var folder = await FilePicker.platform.getDirectoryPath(dialogTitle: "Pick a folder"); + if (folder != null) { + setState(() { + Directory.current = folder; + }); + savePreference(prefWorkingDirectory, Directory.current.path); + } + }, + child: const Icon(Icons.more_horiz), + ), + ], ), ], ),