Merge pull request #3334 from NicKoehler/file-manager-redesign

File manager redesign
This commit is contained in:
RustDesk 2023-02-23 11:08:27 +08:00 committed by GitHub
commit 9f062b8bb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
16 changed files with 815 additions and 566 deletions

2
flutter/assets/arrow.svg Normal file
View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="305.118 110.478 32 32" width="32pt" height="32pt"><g><path d=" M 305.118 110.478 L 337.118 110.478 L 337.118 142.478 L 305.118 142.478 L 305.118 110.478 Z " fill="none"/><path d=" M 322.26 126.052 L 316.297 120.09 C 315.72 119.512 315.72 118.574 316.297 117.997 L 316.297 117.997 C 316.875 117.419 317.813 117.419 318.39 117.997 L 326.02 125.627 C 326.49 126.097 326.49 126.86 326.02 127.33 L 318.39 134.959 C 317.813 135.537 316.875 135.537 316.297 134.959 L 316.297 134.959 C 315.72 134.382 315.72 133.444 316.297 132.866 L 322.26 126.904 C 322.495 126.669 322.495 126.287 322.26 126.052 Z " fill="rgb(0,0,0)"/></g></svg>

After

Width:  |  Height:  |  Size: 796 B

2
flutter/assets/dots.svg Normal file
View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="105.516 106.603 32 32" width="32pt" height="32pt"><g><path d=" M 105.516 106.603 L 137.516 106.603 L 137.516 138.603 L 105.516 138.603 L 105.516 106.603 Z " fill="none"/><path d=" M 118.954 115.165 C 118.954 113.751 120.102 112.603 121.516 112.603 C 122.929 112.603 124.077 113.751 124.077 115.165 C 124.077 116.579 122.929 117.727 121.516 117.727 C 120.102 117.727 118.954 116.579 118.954 115.165 L 118.954 115.165 Z M 118.954 122.603 C 118.954 121.189 120.102 120.041 121.516 120.041 C 122.929 120.041 124.077 121.189 124.077 122.603 C 124.077 124.017 122.929 125.165 121.516 125.165 C 120.102 125.165 118.954 124.017 118.954 122.603 L 118.954 122.603 Z M 118.954 130.041 C 118.954 128.627 120.102 127.479 121.516 127.479 C 122.929 127.479 124.077 128.627 124.077 130.041 C 124.077 131.455 122.929 132.603 121.516 132.603 C 120.102 132.603 118.954 131.455 118.954 130.041 Z " fill-rule="evenodd" fill="rgb(0,0,0)"/></g></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

2
flutter/assets/file.svg Normal file
View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="187.624 70.761 32 32" width="32pt" height="32pt"><g><path d=" M 187.624 70.761 L 219.624 70.761 L 219.624 102.761 L 187.624 102.761 L 187.624 70.761 Z " fill="none"/><path d=" M 199.771 89.326 L 207.477 89.326 C 207.944 89.326 208.324 89.705 208.324 90.173 L 208.324 90.173 C 208.324 90.64 207.944 91.019 207.477 91.019 L 199.771 91.019 C 199.304 91.019 198.924 90.64 198.924 90.173 L 198.924 90.173 C 198.924 89.705 199.304 89.326 199.771 89.326 L 199.771 89.326 L 199.771 89.326 Z M 199.771 85.914 L 207.477 85.914 C 207.944 85.914 208.324 86.294 208.324 86.761 L 208.324 86.761 C 208.324 87.228 207.944 87.608 207.477 87.608 L 199.771 87.608 C 199.304 87.608 198.924 87.228 198.924 86.761 L 198.924 86.761 C 198.924 86.294 199.304 85.914 199.771 85.914 L 199.771 85.914 Z M 196.935 81.117 L 196.935 92.406 C 196.935 93.974 198.21 95.248 199.78 95.248 L 207.468 95.248 C 209.038 95.248 210.313 93.974 210.313 92.406 L 210.313 81.117 C 210.313 79.548 209.038 78.274 207.468 78.274 L 199.78 78.274 C 198.21 78.274 196.935 79.548 196.935 81.117 L 196.935 81.117 L 196.935 81.117 Z M 199.771 82.503 L 207.477 82.503 C 207.944 82.503 208.324 82.882 208.324 83.35 L 208.324 83.35 C 208.324 83.817 207.944 84.196 207.477 84.196 L 199.771 84.196 C 199.304 84.196 198.924 83.817 198.924 83.35 L 198.924 83.35 C 198.924 82.882 199.304 82.503 199.771 82.503 Z " fill-rule="evenodd" fill="rgb(0,0,0)"/></g></svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="129.858 75.669 32 32" width="32pt" height="32pt"><g><path d=" M 129.858 75.669 L 161.858 75.669 L 161.858 107.669 L 129.858 107.669 L 129.858 75.669 Z " fill="none"/><path d=" M 138.617 99.535 L 153.1 99.535 C 154.622 99.535 155.858 98.299 155.858 96.777 L 155.858 89.32 C 155.858 87.797 154.622 86.561 153.1 86.561 L 147.703 86.561 C 147.399 86.561 147.151 86.314 147.151 86.009 L 147.151 85.182 C 147.151 84.421 146.533 83.802 145.772 83.802 L 139.996 83.802 C 139.235 83.802 138.18 84.239 137.641 84.778 L 136.833 85.586 C 136.295 86.124 135.858 87.179 135.858 87.94 L 135.858 96.777 C 135.858 98.299 137.094 99.535 138.617 99.535 Z " fill="rgb(0,0,0)"/></g></svg>

After

Width:  |  Height:  |  Size: 840 B

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="59.535 106.603 32 32" width="32pt" height="32pt"><g><path d=" M 59.535 106.603 L 91.535 106.603 L 91.535 138.603 L 59.535 138.603 L 59.535 106.603 Z " fill="none"/><path d=" M 68.294 130.469 L 82.776 130.469 C 84.299 130.469 85.535 129.233 85.535 127.711 L 85.535 120.254 C 85.535 118.731 84.299 117.495 82.776 117.495 L 77.38 117.495 C 77.075 117.495 76.828 117.248 76.828 116.944 L 76.828 116.116 C 76.828 115.355 76.21 114.737 75.449 114.737 L 69.673 114.737 C 68.912 114.737 67.857 115.174 67.318 115.712 L 66.51 116.52 C 65.972 117.058 65.535 118.113 65.535 118.875 L 65.535 127.711 C 65.535 129.233 66.771 130.469 68.294 130.469 Z M 80.242 125.161 L 81.924 125.161 C 82.362 125.161 82.718 124.806 82.718 124.368 L 82.718 124.368 C 82.718 123.93 82.362 123.575 81.924 123.575 L 80.242 123.575 L 80.242 121.892 C 80.242 121.454 79.886 121.098 79.448 121.098 L 79.448 121.098 C 79.01 121.098 78.655 121.454 78.655 121.892 L 78.655 123.575 L 76.972 123.575 C 76.534 123.575 76.178 123.93 76.178 124.368 L 76.178 124.368 C 76.178 124.806 76.534 125.161 76.972 125.161 L 78.655 125.161 L 78.655 126.844 C 78.655 127.282 79.01 127.638 79.448 127.638 L 79.448 127.638 C 79.886 127.638 80.242 127.282 80.242 126.844 L 80.242 125.161 Z " fill-rule="evenodd" fill="rgb(0,0,0)"/></g></svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

2
flutter/assets/home.svg Normal file
View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="13.554 106.603 32 32" width="32pt" height="32pt"><g><path d=" M 13.554 106.603 L 45.554 106.603 L 45.554 138.603 L 13.554 138.603 L 13.554 106.603 Z " fill="none"/><path d=" M 32.944 132.507 L 36.605 132.507 C 37.157 132.507 37.605 132.059 37.605 131.507 L 37.605 123.67 L 39.94 123.67 C 40.492 123.67 40.623 123.354 40.233 122.963 L 30.261 112.992 C 29.871 112.601 29.237 112.601 28.847 112.992 L 18.876 122.963 C 18.485 123.354 18.617 123.67 19.169 123.67 L 21.503 123.67 L 21.503 131.507 C 21.503 132.059 21.951 132.507 22.503 132.507 L 26.164 132.507 C 26.716 132.507 27.164 132.059 27.164 131.507 L 27.164 128.541 C 27.164 128.265 27.388 128.041 27.664 128.041 L 31.444 128.041 C 31.72 128.041 31.944 128.265 31.944 128.541 L 31.944 131.507 C 31.944 132.059 32.393 132.507 32.944 132.507 Z " fill="rgb(0,0,0)"/></g></svg>

After

Width:  |  Height:  |  Size: 999 B

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="259.244 114.353 32 32" width="32pt" height="32pt"><g><path d=" M 259.244 114.353 L 291.244 114.353 L 291.244 146.353 L 259.244 146.353 L 259.244 114.353 Z " fill="none"/><path d=" M 268.254 130.003 C 268.254 130.725 267.668 131.311 266.945 131.311 C 266.223 131.311 265.637 130.725 265.637 130.003 C 265.639 126.264 267.81 122.867 271.202 121.295 C 274.594 119.724 278.59 120.264 281.442 122.68 L 281.442 121.661 C 281.442 120.939 282.028 120.353 282.751 120.353 C 283.473 120.353 284.059 120.939 284.059 121.661 L 284.059 125.786 C 284.059 126.505 283.476 127.088 282.757 127.088 L 278.788 127.458 C 278.072 127.522 277.438 126.994 277.373 126.277 C 277.309 125.56 277.837 124.927 278.554 124.862 L 279.856 124.743 C 277.79 122.938 274.86 122.506 272.362 123.638 C 269.863 124.771 268.257 127.259 268.254 130.003 Z M 271.959 133.192 C 272.678 133.127 273.313 133.658 273.378 134.377 C 273.443 135.096 272.912 135.731 272.193 135.796 L 270.553 135.944 C 272.603 137.801 275.556 138.275 278.085 137.151 C 280.613 136.027 282.24 133.518 282.235 130.751 C 282.235 130.029 282.821 129.443 283.543 129.443 C 284.266 129.443 284.851 130.029 284.851 130.751 C 284.852 134.439 282.74 137.801 279.417 139.402 C 276.095 141.002 272.149 140.558 269.266 138.259 L 269.266 138.939 C 269.266 139.662 268.68 140.248 267.957 140.248 C 267.235 140.248 266.649 139.662 266.649 138.939 L 266.649 134.865 L 266.649 134.865 C 266.647 134.189 267.162 133.623 267.835 133.563 L 271.954 133.189 L 271.959 133.192 Z " fill="rgb(0,0,0)"/></g></svg>

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="204.996 114.353 32 32" width="32pt" height="32pt"><g><path d=" M 204.996 114.353 L 236.996 114.353 L 236.996 146.353 L 204.996 146.353 L 204.996 114.353 Z " fill="none"/><path d=" M 230.603 139.96 L 230.603 139.96 C 230.08 140.484 229.229 140.484 228.706 139.96 L 223.712 134.966 C 220.568 137.205 216.172 136.915 213.353 134.096 C 210.211 130.954 210.211 125.852 213.353 122.71 C 216.495 119.567 221.597 119.567 224.739 122.71 C 227.558 125.529 227.848 129.925 225.609 133.068 L 230.603 138.063 C 231.127 138.586 231.127 139.436 230.603 139.96 Z M 213.456 128.413 C 213.456 125.328 215.961 122.822 219.047 122.822 C 222.133 122.822 224.638 125.328 224.638 128.413 C 224.638 131.499 222.133 134.005 219.047 134.005 C 215.961 134.005 213.456 131.499 213.456 128.413 Z " fill-rule="evenodd" fill="rgb(0,0,0)"/></g></svg>

After

Width:  |  Height:  |  Size: 992 B

2
flutter/assets/trash.svg Normal file
View File

@ -0,0 +1,2 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="isolation:isolate" viewBox="151.496 106.603 32 32" width="32pt" height="32pt"><g><path d=" M 151.496 106.603 L 183.496 106.603 L 183.496 138.603 L 151.496 138.603 L 151.496 106.603 Z " fill="none"/><path d=" M 162.872 114.091 L 161.304 114.091 C 160.527 114.091 159.897 114.721 159.897 115.498 L 159.897 115.498 C 159.897 116.275 160.527 116.905 161.304 116.905 L 173.688 116.905 C 174.465 116.905 175.096 116.275 175.096 115.498 L 175.096 115.498 C 175.096 114.721 174.465 114.091 173.688 114.091 L 172.12 114.091 L 172.12 113.784 C 172.12 113.132 171.591 112.603 170.939 112.603 L 164.053 112.603 C 163.401 112.603 162.872 113.132 162.872 113.784 L 162.872 114.091 Z M 161.497 117.967 L 173.495 117.967 C 173.779 117.967 174.01 118.198 174.01 118.482 L 174.01 130.03 C 174.01 131.45 172.857 132.603 171.437 132.603 L 163.556 132.603 C 162.135 132.603 160.982 131.45 160.982 130.03 L 160.982 118.482 C 160.982 118.198 161.213 117.967 161.497 117.967 Z " fill-rule="evenodd" fill="rgb(0,0,0)"/></g></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -152,7 +152,7 @@ class MyTheme {
static const Color canvasColor = Color(0xFF212121); static const Color canvasColor = Color(0xFF212121);
static const Color border = Color(0xFFCCCCCC); static const Color border = Color(0xFFCCCCCC);
static const Color idColor = Color(0xFF00B6F0); static const Color idColor = Color(0xFF00B6F0);
static const Color darkGray = Color(0xFFB9BABC); static const Color darkGray = Color.fromARGB(255, 148, 148, 148);
static const Color cmIdColor = Color(0xFF21790B); static const Color cmIdColor = Color(0xFF21790B);
static const Color dark = Colors.black87; static const Color dark = Colors.black87;
static const Color button = Color(0xFF2C8CFF); static const Color button = Color(0xFF2C8CFF);
@ -160,8 +160,9 @@ class MyTheme {
static ThemeData lightTheme = ThemeData( static ThemeData lightTheme = ThemeData(
brightness: Brightness.light, brightness: Brightness.light,
backgroundColor: Color(0xFFFFFFFF), backgroundColor: Color(0xFFEEEEEE),
scaffoldBackgroundColor: Color(0xFFEEEEEE), hoverColor: Color.fromARGB(255, 224, 224, 224),
scaffoldBackgroundColor: Color(0xFFFFFFFF),
textTheme: const TextTheme( textTheme: const TextTheme(
titleLarge: TextStyle(fontSize: 19, color: Colors.black87), titleLarge: TextStyle(fontSize: 19, color: Colors.black87),
titleSmall: TextStyle(fontSize: 14, color: Colors.black87), titleSmall: TextStyle(fontSize: 14, color: Colors.black87),
@ -169,6 +170,7 @@ class MyTheme {
bodyMedium: bodyMedium:
TextStyle(fontSize: 14, color: Colors.black87, height: 1.25), TextStyle(fontSize: 14, color: Colors.black87, height: 1.25),
labelLarge: TextStyle(fontSize: 16.0, color: MyTheme.accent80)), labelLarge: TextStyle(fontSize: 16.0, color: MyTheme.accent80)),
cardColor: Color(0xFFEEEEEE),
hintColor: Color(0xFFAAAAAA), hintColor: Color(0xFFAAAAAA),
primarySwatch: Colors.blue, primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity, visualDensity: VisualDensity.adaptivePlatformDensity,
@ -191,8 +193,9 @@ class MyTheme {
); );
static ThemeData darkTheme = ThemeData( static ThemeData darkTheme = ThemeData(
brightness: Brightness.dark, brightness: Brightness.dark,
backgroundColor: Color(0xFF252525), backgroundColor: Color(0xFF24252B),
scaffoldBackgroundColor: Color(0xFF141414), hoverColor: Color.fromARGB(255, 45, 46, 53),
scaffoldBackgroundColor: Color(0xFF18191E),
textTheme: const TextTheme( textTheme: const TextTheme(
titleLarge: TextStyle(fontSize: 19), titleLarge: TextStyle(fontSize: 19),
titleSmall: TextStyle(fontSize: 14), titleSmall: TextStyle(fontSize: 14),
@ -200,7 +203,7 @@ class MyTheme {
bodyMedium: TextStyle(fontSize: 14, height: 1.25), bodyMedium: TextStyle(fontSize: 14, height: 1.25),
labelLarge: TextStyle( labelLarge: TextStyle(
fontSize: 16.0, fontWeight: FontWeight.bold, color: accent80)), fontSize: 16.0, fontWeight: FontWeight.bold, color: accent80)),
cardColor: Color(0xFF252525), cardColor: Color(0xFF24252B),
primarySwatch: Colors.blue, primarySwatch: Colors.blue,
visualDensity: VisualDensity.adaptivePlatformDensity, visualDensity: VisualDensity.adaptivePlatformDensity,
tabBarTheme: const TabBarTheme( tabBarTheme: const TabBarTheme(
@ -217,9 +220,8 @@ class MyTheme {
style: ButtonStyle(splashFactory: NoSplash.splashFactory), style: ButtonStyle(splashFactory: NoSplash.splashFactory),
) )
: null, : null,
checkboxTheme: const CheckboxThemeData( checkboxTheme:
checkColor: MaterialStatePropertyAll(dark) const CheckboxThemeData(checkColor: MaterialStatePropertyAll(dark)),
),
).copyWith( ).copyWith(
extensions: <ThemeExtension<dynamic>>[ extensions: <ThemeExtension<dynamic>>[
ColorThemeExtension.dark, ColorThemeExtension.dark,

View File

@ -53,7 +53,7 @@ const int kDesktopMaxDisplayHeight = 1080;
const double kDesktopFileTransferNameColWidth = 200; const double kDesktopFileTransferNameColWidth = 200;
const double kDesktopFileTransferModifiedColWidth = 120; const double kDesktopFileTransferModifiedColWidth = 120;
const double kDesktopFileTransferRowHeight = 25.0; const double kDesktopFileTransferRowHeight = 30.0;
const double kDesktopFileTransferHeaderHeight = 25.0; const double kDesktopFileTransferHeaderHeight = 25.0;
// https://en.wikipedia.org/wiki/Non-breaking_space // https://en.wikipedia.org/wiki/Non-breaking_space

View File

@ -2,20 +2,23 @@ import 'dart:async';
import 'dart:io'; import 'dart:io';
import 'dart:math'; import 'dart:math';
import 'package:percent_indicator/percent_indicator.dart';
import 'package:desktop_drop/desktop_drop.dart'; import 'package:desktop_drop/desktop_drop.dart';
import 'package:flutter/gestures.dart'; import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_breadcrumb/flutter_breadcrumb.dart'; import 'package:flutter_breadcrumb/flutter_breadcrumb.dart';
import 'package:flutter_hbb/desktop/widgets/list_search_action_listener.dart'; import 'package:flutter_hbb/desktop/widgets/list_search_action_listener.dart';
import 'package:flutter_hbb/desktop/widgets/menu_button.dart';
import 'package:flutter_hbb/desktop/widgets/tabbar_widget.dart'; import 'package:flutter_hbb/desktop/widgets/tabbar_widget.dart';
import 'package:flutter_hbb/models/file_model.dart'; import 'package:flutter_hbb/models/file_model.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:wakelock/wakelock.dart'; import 'package:wakelock/wakelock.dart';
import '../../consts.dart'; import '../../consts.dart';
import '../../desktop/widgets/material_mod_popup_menu.dart' as mod_menu; import '../../desktop/widgets/material_mod_popup_menu.dart' as mod_menu;
import '../../common.dart'; import '../../common.dart';
import '../../models/model.dart'; import '../../models/model.dart';
import '../../models/platform_model.dart'; import '../../models/platform_model.dart';
@ -147,7 +150,7 @@ class _FileManagerPageState extends State<FileManagerPage>
value: _ffi.fileModel, value: _ffi.fileModel,
child: Consumer<FileModel>(builder: (context, model, child) { child: Consumer<FileModel>(builder: (context, model, child) {
return Scaffold( return Scaffold(
backgroundColor: Theme.of(context).backgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: Row( body: Row(
children: [ children: [
Flexible(flex: 3, child: body(isLocal: true)), Flexible(flex: 3, child: body(isLocal: true)),
@ -197,30 +200,37 @@ class _FileManagerPageState extends State<FileManagerPage>
final y = e.position.dy; final y = e.position.dy;
menuPos = RelativeRect.fromLTRB(x, y, x, y); menuPos = RelativeRect.fromLTRB(x, y, x, y);
}, },
child: IconButton( child: MenuButton(
icon: const Icon(Icons.more_vert),
splashRadius: kDesktopIconButtonSplashRadius,
onPressed: () => mod_menu.showMenu( onPressed: () => mod_menu.showMenu(
context: context, context: context,
position: menuPos, position: menuPos,
items: items items: items
.map((e) => e.build( .map(
(e) => e.build(
context, context,
MenuConfig( MenuConfig(
commonColor: CustomPopupMenuTheme.commonColor, commonColor: CustomPopupMenuTheme.commonColor,
height: CustomPopupMenuTheme.height, height: CustomPopupMenuTheme.height,
dividerHeight: CustomPopupMenuTheme.dividerHeight))) dividerHeight: CustomPopupMenuTheme.dividerHeight),
),
)
.expand((i) => i) .expand((i) => i)
.toList(), .toList(),
elevation: 8, elevation: 8,
), ),
)); child: SvgPicture.asset(
"assets/dots.svg",
color: Theme.of(context).tabBarTheme.labelColor,
),
color: Theme.of(context).cardColor,
hoverColor: Theme.of(context).hoverColor,
),
);
} }
Widget body({bool isLocal = false}) { Widget body({bool isLocal = false}) {
final scrollController = ScrollController(); final scrollController = ScrollController();
return Container( return Container(
decoration: BoxDecoration(border: Border.all(color: Colors.black26)),
margin: const EdgeInsets.all(16.0), margin: const EdgeInsets.all(16.0),
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: DropTarget( child: DropTarget(
@ -231,7 +241,9 @@ class _FileManagerPageState extends State<FileManagerPage>
onDragExited: (exit) { onDragExited: (exit) {
_dropMaskVisible.value = false; _dropMaskVisible.value = false;
}, },
child: Column(crossAxisAlignment: CrossAxisAlignment.start, children: [ child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
headTools(isLocal), headTools(isLocal),
Expanded( Expanded(
child: Row( child: Row(
@ -241,8 +253,10 @@ class _FileManagerPageState extends State<FileManagerPage>
child: _buildFileList(context, isLocal, scrollController), child: _buildFileList(context, isLocal, scrollController),
) )
], ],
)), ),
]), ),
],
),
), ),
); );
} }
@ -295,8 +309,7 @@ class _FileManagerPageState extends State<FileManagerPage>
}); });
return; return;
} }
_jumpToEntry( _jumpToEntry(isLocal, searchResult.first, scrollController,
isLocal, searchResult.first, scrollController,
kDesktopFileTransferRowHeight, buffer); kDesktopFileTransferRowHeight, buffer);
}, },
onSearch: (buffer) { onSearch: (buffer) {
@ -311,8 +324,7 @@ class _FileManagerPageState extends State<FileManagerPage>
}); });
return; return;
} }
_jumpToEntry( _jumpToEntry(isLocal, searchResult.first, scrollController,
isLocal, searchResult.first, scrollController,
kDesktopFileTransferRowHeight, buffer); kDesktopFileTransferRowHeight, buffer);
}, },
child: ObxValue<RxString>( child: ObxValue<RxString>(
@ -329,27 +341,32 @@ class _FileManagerPageState extends State<FileManagerPage>
? " " ? " "
: "${entry.lastModified().toString().replaceAll(".000", "")} "; : "${entry.lastModified().toString().replaceAll(".000", "")} ";
final isSelected = selectedEntries.contains(entry); final isSelected = selectedEntries.contains(entry);
return SizedBox( return Padding(
padding: EdgeInsets.symmetric(vertical: 1),
child: Container(
decoration: BoxDecoration(
color: isSelected
? Theme.of(context).hoverColor
: Theme.of(context).cardColor,
borderRadius: BorderRadius.all(
Radius.circular(5.0),
),
),
key: ValueKey(entry.name), key: ValueKey(entry.name),
height: kDesktopFileTransferRowHeight, height: kDesktopFileTransferRowHeight,
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
const Divider(
height: 1,
),
Expanded( Expanded(
child: Ink(
decoration: isSelected
? BoxDecoration(color: Theme.of(context).hoverColor)
: null,
child: InkWell( child: InkWell(
child: Row(children: [ child: Row(
children: [
GestureDetector( GestureDetector(
child: Container( child: Container(
width: kDesktopFileTransferNameColWidth, width: kDesktopFileTransferNameColWidth,
child: Tooltip( child: Tooltip(
waitDuration: Duration(milliseconds: 500), waitDuration:
Duration(milliseconds: 500),
message: entry.name, message: entry.name,
child: Row(children: [ child: Row(children: [
entry.isDrive entry.isDrive
@ -361,26 +378,27 @@ class _FileManagerPageState extends State<FileManagerPage>
.color .color
?.withOpacity(0.7)) ?.withOpacity(0.7))
.paddingAll(4) .paddingAll(4)
: Icon( : SvgPicture.asset(
entry.isFile entry.isFile
? Icons.feed_outlined ? "assets/file.svg"
: Icons.folder, : "assets/folder.svg",
size: 20,
color: Theme.of(context) color: Theme.of(context)
.iconTheme .tabBarTheme
.color .labelColor,
?.withOpacity(0.7), ),
).marginSymmetric(horizontal: 2),
Expanded( Expanded(
child: Text(entry.name.nonBreaking, child: Text(
overflow: TextOverflow.ellipsis)) entry.name.nonBreaking,
overflow:
TextOverflow.ellipsis))
]), ]),
)), )),
onTap: () { onTap: () {
final items = getSelectedItems(isLocal); final items = getSelectedItems(isLocal);
// handle double click // handle double click
if (_checkDoubleClick(entry)) { if (_checkDoubleClick(entry)) {
openDirectory(entry.path, isLocal: isLocal); openDirectory(entry.path,
isLocal: isLocal);
items.clear(); items.clear();
return; return;
} }
@ -392,15 +410,21 @@ class _FileManagerPageState extends State<FileManagerPage>
child: SizedBox( child: SizedBox(
width: kDesktopFileTransferModifiedColWidth, width: kDesktopFileTransferModifiedColWidth,
child: Tooltip( child: Tooltip(
waitDuration: Duration(milliseconds: 500), waitDuration:
Duration(milliseconds: 500),
message: lastModifiedStr, message: lastModifiedStr,
child: Text( child: Text(
lastModifiedStr, lastModifiedStr,
style: TextStyle( style: TextStyle(
fontSize: 12, color: MyTheme.darkGray), fontSize: 12,
color: MyTheme.darkGray,
),
)), )),
)), ),
GestureDetector( ),
SizedBox(
width: 100,
child: GestureDetector(
child: Tooltip( child: Tooltip(
waitDuration: Duration(milliseconds: 500), waitDuration: Duration(milliseconds: 500),
message: sizeStr, message: sizeStr,
@ -410,13 +434,16 @@ class _FileManagerPageState extends State<FileManagerPage>
style: TextStyle( style: TextStyle(
fontSize: 10, fontSize: 10,
color: MyTheme.darkGray), color: MyTheme.darkGray),
))), ),
]),
), ),
), ),
), ),
], ],
), ),
),
),
],
)),
); );
}).toList(growable: false); }).toList(growable: false);
@ -520,16 +547,27 @@ class _FileManagerPageState extends State<FileManagerPage>
Widget statusList() { Widget statusList() {
return PreferredSize( return PreferredSize(
preferredSize: const Size(200, double.infinity), preferredSize: const Size(200, double.infinity),
child: Container( child: model.jobTable.isEmpty
margin: const EdgeInsets.only(top: 16.0, bottom: 16.0, right: 16.0), ? Center(child: Text(translate("Empty")))
: Container(
margin:
const EdgeInsets.only(top: 16.0, bottom: 16.0, right: 16.0),
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
decoration: BoxDecoration(border: Border.all(color: Colors.grey)),
child: Obx( child: Obx(
() => ListView.builder( () => ListView.builder(
controller: ScrollController(), controller: ScrollController(),
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
final item = model.jobTable[index]; final item = model.jobTable[index];
return Column( return Padding(
padding: const EdgeInsets.only(bottom: 5),
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).cardColor,
borderRadius: BorderRadius.all(
Radius.circular(15.0),
),
),
child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Row( Row(
@ -537,40 +575,81 @@ class _FileManagerPageState extends State<FileManagerPage>
children: [ children: [
Transform.rotate( Transform.rotate(
angle: item.isRemote ? pi : 0, angle: item.isRemote ? pi : 0,
child: const Icon(Icons.send)), child: SvgPicture.asset(
"assets/arrow.svg",
color: Theme.of(context)
.tabBarTheme
.labelColor,
),
).paddingOnly(left: 15),
const SizedBox( const SizedBox(
width: 16.0, width: 16.0,
), ),
Expanded( Expanded(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment:
CrossAxisAlignment.start,
children: [ children: [
Tooltip( Tooltip(
waitDuration: Duration(milliseconds: 500), waitDuration:
Duration(milliseconds: 500),
message: item.jobName, message: item.jobName,
child: Text( child: Text(
item.jobName, item.jobName,
maxLines: 1, maxLines: 1,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
)), ).paddingSymmetric(vertical: 10),
Wrap( ),
children: [
Text( Text(
'${item.display()} ${max(0, item.fileNum)}/${item.fileCount} '), '${translate("Total")} ${readableFileSize(item.totalSize.toDouble())}',
Text( style: TextStyle(
'${translate("files")} ${readableFileSize(item.totalSize.toDouble())} '), fontSize: 12,
color: MyTheme.darkGray,
),
),
Offstage( Offstage(
offstage: offstage:
item.state != JobState.inProgress, item.state != JobState.inProgress,
child: Text( child: Text(
'${"${readableFileSize(item.speed)}/s"} ')), '${translate("Speed")} ${readableFileSize(item.speed)}/s',
Offstage( style: TextStyle(
offstage: item.totalSize <= 0, fontSize: 12,
child: Text( color: MyTheme.darkGray,
'${(item.finishedSize.toDouble() * 100 / item.totalSize.toDouble()).toStringAsFixed(2)}%'),
), ),
], ),
),
Offstage(
offstage:
item.state == JobState.inProgress,
child: Text(
translate(
item.display(),
),
style: TextStyle(
fontSize: 12,
color: MyTheme.darkGray,
),
),
),
Offstage(
offstage:
item.state != JobState.inProgress,
child: LinearPercentIndicator(
padding: EdgeInsets.only(right: 15),
animateFromLastPercent: true,
center: Text(
'${(item.finishedSize / item.totalSize * 100).toStringAsFixed(0)}%',
),
barRadius: Radius.circular(15),
percent: item.finishedSize /
item.totalSize,
progressColor: MyTheme.accent,
backgroundColor:
Theme.of(context).hoverColor,
lineHeight:
kDesktopFileTransferRowHeight,
).paddingSymmetric(vertical: 15),
), ),
], ],
), ),
@ -580,32 +659,38 @@ class _FileManagerPageState extends State<FileManagerPage>
children: [ children: [
Offstage( Offstage(
offstage: item.state != JobState.paused, offstage: item.state != JobState.paused,
child: IconButton( child: MenuButton(
onPressed: () { onPressed: () {
model.resumeJob(item.id); model.resumeJob(item.id);
}, },
splashRadius: kDesktopIconButtonSplashRadius, child: SvgPicture.asset(
icon: const Icon(Icons.restart_alt_rounded)), "assets/refresh.svg",
color: Colors.white,
),
color: MyTheme.accent,
hoverColor: MyTheme.accent80,
),
),
MenuButton(
padding: EdgeInsets.only(right: 15),
child: SvgPicture.asset(
"assets/close.svg",
color: Colors.white,
), ),
IconButton(
icon: const Icon(Icons.close),
splashRadius: 1,
onPressed: () { onPressed: () {
model.jobTable.removeAt(index); model.jobTable.removeAt(index);
model.cancelJob(item.id); model.cancelJob(item.id);
}, },
color: MyTheme.accent,
hoverColor: MyTheme.accent80,
), ),
], ],
) ),
], ],
), ),
SizedBox(
height: 8.0,
),
Divider(
height: 2.0,
)
], ],
).paddingSymmetric(vertical: 10),
),
); );
}, },
itemCount: model.jobTable.length, itemCount: model.jobTable.length,
@ -630,17 +715,23 @@ class _FileManagerPageState extends State<FileManagerPage>
Container( Container(
width: 50, width: 50,
height: 50, height: 50,
decoration: BoxDecoration(color: Colors.blue), decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(8)),
color: MyTheme.accent,
),
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: FutureBuilder<String>( child: FutureBuilder<String>(
future: bind.sessionGetPlatform( future: bind.sessionGetPlatform(
id: _ffi.id, isRemote: !isLocal), id: _ffi.id, isRemote: !isLocal),
builder: (context, snapshot) { builder: (context, snapshot) {
if (snapshot.hasData && snapshot.data!.isNotEmpty) { if (snapshot.hasData &&
snapshot.data!.isNotEmpty) {
return getPlatformImage('${snapshot.data}'); return getPlatformImage('${snapshot.data}');
} else { } else {
return CircularProgressIndicator( return CircularProgressIndicator(
color: Colors.white, color: Theme.of(context)
.tabBarTheme
.labelColor,
); );
} }
})), })),
@ -650,23 +741,38 @@ class _FileManagerPageState extends State<FileManagerPage>
.marginOnly(left: 8.0) .marginOnly(left: 8.0)
], ],
), ),
preferredSize: Size(double.infinity, 70)), preferredSize: Size(double.infinity, 70))
.paddingOnly(bottom: 15),
// buttons // buttons
Row( Row(
children: [ children: [
Row( Row(
children: [ children: [
IconButton( MenuButton(
icon: const Icon(Icons.arrow_back), padding: EdgeInsets.only(
splashRadius: kDesktopIconButtonSplashRadius, right: 3,
),
child: SvgPicture.asset(
"assets/arrow.svg",
color: Theme.of(context).tabBarTheme.labelColor,
),
color: Theme.of(context).cardColor,
hoverColor: Theme.of(context).hoverColor,
onPressed: () { onPressed: () {
selectedItems.clear(); selectedItems.clear();
model.goBack(isLocal: isLocal); model.goBack(isLocal: isLocal);
}, },
), ),
IconButton( MenuButton(
icon: const Icon(Icons.arrow_upward), child: RotatedBox(
splashRadius: kDesktopIconButtonSplashRadius, quarterTurns: 3,
child: SvgPicture.asset(
"assets/arrow.svg",
color: Theme.of(context).tabBarTheme.labelColor,
),
),
color: Theme.of(context).cardColor,
hoverColor: Theme.of(context).hoverColor,
onPressed: () { onPressed: () {
selectedItems.clear(); selectedItems.clear();
model.goToParentDirectory(isLocal: isLocal); model.goToParentDirectory(isLocal: isLocal);
@ -675,6 +781,17 @@ class _FileManagerPageState extends State<FileManagerPage>
], ],
), ),
Expanded( Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 3.0),
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).cardColor,
borderRadius: BorderRadius.all(
Radius.circular(8.0),
),
),
child: Padding(
padding: EdgeInsets.symmetric(vertical: 2.5),
child: GestureDetector( child: GestureDetector(
onTap: () { onTap: () {
locationStatus.value = locationStatus.value =
@ -682,33 +799,34 @@ class _FileManagerPageState extends State<FileManagerPage>
? LocationStatus.pathLocation ? LocationStatus.pathLocation
: LocationStatus.bread; : LocationStatus.bread;
Future.delayed(Duration.zero, () { Future.delayed(Duration.zero, () {
if (locationStatus.value == LocationStatus.pathLocation) { if (locationStatus.value ==
LocationStatus.pathLocation) {
locationFocus.requestFocus(); locationFocus.requestFocus();
} }
}); });
}, },
child: Obx(() => Container( child: Obx(
decoration: BoxDecoration( () => Container(
border: Border.all(
color: locationStatus.value == LocationStatus.bread
? Colors.black12
: Theme.of(context)
.colorScheme
.primary
.withOpacity(0.5))),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
child: locationStatus.value == LocationStatus.bread child: locationStatus.value ==
LocationStatus.bread
? buildBread(isLocal) ? buildBread(isLocal)
: buildPathLocation(isLocal)), : buildPathLocation(isLocal)),
], ],
))), ),
)), ),
),
),
),
),
),
),
Obx(() { Obx(() {
switch (locationStatus.value) { switch (locationStatus.value) {
case LocationStatus.bread: case LocationStatus.bread:
return IconButton( return MenuButton(
onPressed: () { onPressed: () {
locationStatus.value = LocationStatus.fileSearchBar; locationStatus.value = LocationStatus.fileSearchBar;
final focusNode = final focusNode =
@ -716,31 +834,52 @@ class _FileManagerPageState extends State<FileManagerPage>
Future.delayed( Future.delayed(
Duration.zero, () => focusNode.requestFocus()); Duration.zero, () => focusNode.requestFocus());
}, },
splashRadius: kDesktopIconButtonSplashRadius, child: SvgPicture.asset(
icon: Icon(Icons.search)); "assets/search.svg",
color: Theme.of(context).tabBarTheme.labelColor,
),
color: Theme.of(context).cardColor,
hoverColor: Theme.of(context).hoverColor,
);
case LocationStatus.pathLocation: case LocationStatus.pathLocation:
return IconButton( return MenuButton(
color: Theme.of(context).disabledColor,
onPressed: null, onPressed: null,
splashRadius: kDesktopIconButtonSplashRadius, child: SvgPicture.asset(
icon: Icon(Icons.close)); "assets/close.svg",
case LocationStatus.fileSearchBar: color: Theme.of(context).tabBarTheme.labelColor,
return IconButton( ),
color: Theme.of(context).disabledColor, color: Theme.of(context).disabledColor,
hoverColor: Theme.of(context).hoverColor,
);
case LocationStatus.fileSearchBar:
return MenuButton(
onPressed: () { onPressed: () {
onSearchText("", isLocal); onSearchText("", isLocal);
locationStatus.value = LocationStatus.bread; locationStatus.value = LocationStatus.bread;
}, },
splashRadius: 1, child: SvgPicture.asset(
icon: Icon(Icons.close)); "assets/close.svg",
color: Theme.of(context).tabBarTheme.labelColor,
),
color: Theme.of(context).cardColor,
hoverColor: Theme.of(context).hoverColor,
);
} }
}), }),
IconButton( MenuButton(
padding: EdgeInsets.only(
left: 3,
),
onPressed: () { onPressed: () {
model.refresh(isLocal: isLocal); model.refresh(isLocal: isLocal);
}, },
splashRadius: kDesktopIconButtonSplashRadius, child: SvgPicture.asset(
icon: const Icon(Icons.refresh)), "assets/refresh.svg",
color: Theme.of(context).tabBarTheme.labelColor,
),
color: Theme.of(context).cardColor,
hoverColor: Theme.of(context).hoverColor,
),
], ],
), ),
Row( Row(
@ -751,14 +890,21 @@ class _FileManagerPageState extends State<FileManagerPage>
mainAxisAlignment: mainAxisAlignment:
isLocal ? MainAxisAlignment.start : MainAxisAlignment.end, isLocal ? MainAxisAlignment.start : MainAxisAlignment.end,
children: [ children: [
IconButton( MenuButton(
padding: EdgeInsets.only(
right: 3,
),
onPressed: () { onPressed: () {
model.goHome(isLocal: isLocal); model.goHome(isLocal: isLocal);
}, },
icon: const Icon(Icons.home_outlined), child: SvgPicture.asset(
splashRadius: kDesktopIconButtonSplashRadius, "assets/home.svg",
color: Theme.of(context).tabBarTheme.labelColor,
), ),
IconButton( color: Theme.of(context).cardColor,
hoverColor: Theme.of(context).hoverColor,
),
MenuButton(
onPressed: () { onPressed: () {
final name = TextEditingController(); final name = TextEditingController();
_ffi.dialogManager.show((setState, close) { _ffi.dialogManager.show((setState, close) {
@ -800,9 +946,14 @@ class _FileManagerPageState extends State<FileManagerPage>
); );
}); });
}, },
splashRadius: kDesktopIconButtonSplashRadius, child: SvgPicture.asset(
icon: const Icon(Icons.create_new_folder_outlined)), "assets/folder_new.svg",
IconButton( color: Theme.of(context).tabBarTheme.labelColor,
),
color: Theme.of(context).cardColor,
hoverColor: Theme.of(context).hoverColor,
),
MenuButton(
onPressed: validItems(selectedItems) onPressed: validItems(selectedItems)
? () async { ? () async {
await (model.removeAction(selectedItems, await (model.removeAction(selectedItems,
@ -810,32 +961,80 @@ class _FileManagerPageState extends State<FileManagerPage>
selectedItems.clear(); selectedItems.clear();
} }
: null, : null,
splashRadius: kDesktopIconButtonSplashRadius, child: SvgPicture.asset(
icon: const Icon(Icons.delete_forever_outlined)), "assets/trash.svg",
color: Theme.of(context).tabBarTheme.labelColor,
),
color: Theme.of(context).cardColor,
hoverColor: Theme.of(context).hoverColor,
),
menu(isLocal: isLocal), menu(isLocal: isLocal),
], ],
), ),
), ),
TextButton.icon( ElevatedButton.icon(
style: ButtonStyle(
padding: MaterialStateProperty.all<EdgeInsetsGeometry>(isLocal
? EdgeInsets.only(left: 10)
: EdgeInsets.only(right: 10)),
backgroundColor: MaterialStateProperty.all(
selectedItems.length == 0
? MyTheme.accent80
: MyTheme.accent,
),
shape: MaterialStateProperty.all<RoundedRectangleBorder>(
RoundedRectangleBorder(
borderRadius: BorderRadius.circular(18.0),
),
),
),
onPressed: validItems(selectedItems) onPressed: validItems(selectedItems)
? () { ? () {
model.sendFiles(selectedItems, isRemote: !isLocal); model.sendFiles(selectedItems, isRemote: !isLocal);
selectedItems.clear(); selectedItems.clear();
} }
: null, : null,
icon: Transform.rotate( icon: isLocal
angle: isLocal ? 0 : pi, ? Text(
child: const Icon( translate('Send'),
Icons.send, textAlign: TextAlign.right,
style: TextStyle(
color: selectedItems.length == 0
? MyTheme.darkGray
: Colors.white,
),
)
: RotatedBox(
quarterTurns: 2,
child: SvgPicture.asset(
"assets/arrow.svg",
color: selectedItems.length == 0
? MyTheme.darkGray
: Colors.white,
alignment: Alignment.bottomRight,
),
),
label: isLocal
? SvgPicture.asset(
"assets/arrow.svg",
color: selectedItems.length == 0
? MyTheme.darkGray
: Colors.white,
)
: Text(
translate('Receive'),
style: TextStyle(
color: selectedItems.length == 0
? MyTheme.darkGray
: Colors.white,
),
), ),
), ),
label: Text(
isLocal ? translate('Send') : translate('Receive'),
)),
], ],
).marginOnly(top: 8.0) ).marginOnly(top: 8.0)
], ],
)); ),
);
} }
bool validItems(SelectedItems items) { bool validItems(SelectedItems items) {
@ -901,14 +1100,16 @@ class _FileManagerPageState extends State<FileManagerPage>
}, },
child: BreadCrumb( child: BreadCrumb(
items: items, items: items,
divider: Icon(Icons.chevron_right), divider: const Icon(Icons.keyboard_arrow_right_rounded),
overflow: ScrollableOverflow( overflow: ScrollableOverflow(
controller: controller: getBreadCrumbScrollController(isLocal),
getBreadCrumbScrollController(isLocal)), ),
))), ),
),
),
ActionIcon( ActionIcon(
message: "", message: "",
icon: Icons.arrow_drop_down, icon: Icons.keyboard_arrow_down_rounded,
onTap: () async { onTap: () async {
final renderBox = locationBarKey.currentContext final renderBox = locationBarKey.currentContext
?.findRenderObject() as RenderBox; ?.findRenderObject() as RenderBox;
@ -1021,13 +1222,23 @@ class _FileManagerPageState extends State<FileManagerPage>
.marginSymmetric(horizontal: 4))); .marginSymmetric(horizontal: 4)));
} else { } else {
final list = PathUtil.split(path, isWindows); final list = PathUtil.split(path, isWindows);
breadCrumbList.addAll(list.asMap().entries.map((e) => BreadCrumbItem( breadCrumbList.addAll(
list.asMap().entries.map(
(e) => BreadCrumbItem(
content: TextButton( content: TextButton(
child: Text(e.value), child: Text(e.value),
style: ButtonStyle( style: ButtonStyle(
minimumSize: MaterialStateProperty.all(Size(0, 0))), minimumSize: MaterialStateProperty.all(
onPressed: () => onPressed(list.sublist(0, e.key + 1))) Size(0, 0),
.marginSymmetric(horizontal: 4)))); ),
),
onPressed: () => onPressed(
list.sublist(0, e.key + 1),
),
).marginSymmetric(horizontal: 4),
),
),
);
} }
return breadCrumbList; return breadCrumbList;
} }
@ -1054,20 +1265,24 @@ class _FileManagerPageState extends State<FileManagerPage>
: searchTextObs.value; : searchTextObs.value;
final textController = TextEditingController(text: text) final textController = TextEditingController(text: text)
..selection = TextSelection.collapsed(offset: text.length); ..selection = TextSelection.collapsed(offset: text.length);
return Row(children: [ return Row(
Icon( children: [
SvgPicture.asset(
locationStatus.value == LocationStatus.pathLocation locationStatus.value == LocationStatus.pathLocation
? Icons.folder ? "assets/folder.svg"
: Icons.search, : "assets/search.svg",
color: Theme.of(context).hintColor, color: Theme.of(context).tabBarTheme.labelColor,
).paddingSymmetric(horizontal: 2), ),
Expanded( Expanded(
child: TextField( child: TextField(
focusNode: focusNode, focusNode: focusNode,
decoration: InputDecoration( decoration: InputDecoration(
border: InputBorder.none, border: InputBorder.none,
isDense: true, isDense: true,
prefix: Padding(padding: EdgeInsets.only(left: 4.0))), prefix: Padding(
padding: EdgeInsets.only(left: 4.0),
),
),
controller: textController, controller: textController,
onSubmitted: (path) { onSubmitted: (path) {
openDirectory(path, isLocal: isLocal); openDirectory(path, isLocal: isLocal);
@ -1075,8 +1290,10 @@ class _FileManagerPageState extends State<FileManagerPage>
onChanged: locationStatus.value == LocationStatus.fileSearchBar onChanged: locationStatus.value == LocationStatus.fileSearchBar
? (searchText) => onSearchText(searchText, isLocal) ? (searchText) => onSearchText(searchText, isLocal)
: null, : null,
)) ),
]); )
],
);
} }
onSearchText(String searchText, bool isLocal) { onSearchText(String searchText, bool isLocal) {
@ -1145,12 +1362,13 @@ class _FileManagerPageState extends State<FileManagerPage>
Text( Text(
name, name,
style: headerTextStyle, style: headerTextStyle,
).marginSymmetric( ).marginSymmetric(horizontal: 4),
horizontal: sortBy == SortBy.name ? 4 : 0.0),
ascending.value != null ascending.value != null
? Icon(ascending.value! ? Icon(
? Icons.arrow_upward ascending.value!
: Icons.arrow_downward) ? Icons.keyboard_arrow_up_rounded
: Icons.keyboard_arrow_down_rounded,
)
: const Offstage() : const Offstage()
], ],
), ),

View File

@ -86,18 +86,14 @@ class _FileManagerTabPageState extends State<FileManagerTabPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final tabWidget = Container( final tabWidget = Scaffold(
decoration: BoxDecoration( backgroundColor: Theme.of(context).cardColor,
border: Border.all(color: MyTheme.color(context).border!)),
child: Scaffold(
backgroundColor: Theme.of(context).backgroundColor,
body: DesktopTab( body: DesktopTab(
controller: tabController, controller: tabController,
onWindowCloseButton: handleWindowCloseButton, onWindowCloseButton: handleWindowCloseButton,
tail: const AddButton().paddingOnly(left: 10), tail: const AddButton().paddingOnly(left: 10),
labelGetter: DesktopTab.labelGetterAlias, labelGetter: DesktopTab.labelGetterAlias,
)), ));
);
return Platform.isMacOS return Platform.isMacOS
? tabWidget ? tabWidget
: SubWindowDragToResizeArea( : SubWindowDragToResizeArea(

View File

@ -27,6 +27,7 @@ class MenuButton extends StatefulWidget {
class _MenuButtonState extends State<MenuButton> { class _MenuButtonState extends State<MenuButton> {
bool _isHover = false; bool _isHover = false;
final double _borderRadius = 8.0;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -38,16 +39,17 @@ class _MenuButtonState extends State<MenuButton> {
type: MaterialType.transparency, type: MaterialType.transparency,
child: Ink( child: Ink(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5), borderRadius: BorderRadius.circular(_borderRadius),
color: _isHover ? widget.hoverColor : widget.color, color: _isHover ? widget.hoverColor : widget.color,
), ),
child: InkWell( child: InkWell(
hoverColor: widget.hoverColor,
onHover: (val) { onHover: (val) {
setState(() { setState(() {
_isHover = val; _isHover = val;
}); });
}, },
borderRadius: BorderRadius.circular(5), borderRadius: BorderRadius.circular(_borderRadius),
splashColor: widget.splashColor, splashColor: widget.splashColor,
enableFeedback: widget.enableFeedback, enableFeedback: widget.enableFeedback,
onTap: widget.onPressed, onTap: widget.onPressed,

View File

@ -325,8 +325,8 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
path: "." path: "."
ref: bc8604a88e52b2b6e64d2661ae49a71450a47af8 ref: f37357ed98a10717576eb9ed8413e92b2ec5d13a
resolved-ref: bc8604a88e52b2b6e64d2661ae49a71450a47af8 resolved-ref: f37357ed98a10717576eb9ed8413e92b2ec5d13a
url: "https://github.com/Kingtous/rustdesk_desktop_multi_window" url: "https://github.com/Kingtous/rustdesk_desktop_multi_window"
source: git source: git
version: "0.1.0" version: "0.1.0"
@ -970,6 +970,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.11.1" version: "1.11.1"
percent_indicator:
dependency: "direct main"
description:
name: percent_indicator
sha256: cec41f67181fbd5322aa68b355621d1a4eea827426b8eeb613f6cbe195ff7b4a
url: "https://pub.dev"
source: hosted
version: "4.2.2"
petitparser: petitparser:
dependency: transitive dependency: transitive
description: description:
@ -1216,6 +1224,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.2.1" version: "1.2.1"
texture_rgba_renderer:
dependency: "direct main"
description:
name: texture_rgba_renderer
sha256: fbb09b2c6b4ce71261927f9e7e4ea339af3e2f3f2b175f6fb921de1c66ec848d
url: "https://pub.dev"
source: hosted
version: "0.0.8"
timing: timing:
dependency: transitive dependency: transitive
description: description:

View File

@ -93,7 +93,7 @@ dependencies:
flutter_launcher_icons: ^0.11.0 flutter_launcher_icons: ^0.11.0
flutter_keyboard_visibility: ^5.4.0 flutter_keyboard_visibility: ^5.4.0
texture_rgba_renderer: ^0.0.8 texture_rgba_renderer: ^0.0.8
percent_indicator: ^4.2.2
dev_dependencies: dev_dependencies:
icons_launcher: ^2.0.4 icons_launcher: ^2.0.4
@ -119,7 +119,6 @@ flutter_icons:
web: web:
generate: true generate: true
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec
@ -145,8 +144,6 @@ flutter:
fonts: fonts:
- asset: assets/peer_searchbar.ttf - asset: assets/peer_searchbar.ttf
# An image asset can refer to one or more resolution-specific "variants", see # An image asset can refer to one or more resolution-specific "variants", see
# https://flutter.dev/assets-and-images/#resolution-aware. # https://flutter.dev/assets-and-images/#resolution-aware.