changed empty job list logic

This commit is contained in:
NicKoehler 2023-02-26 09:13:42 +01:00
parent eb39cc5da1
commit ee893ce744
No known key found for this signature in database
GPG Key ID: BAE01394EB51AC58
2 changed files with 163 additions and 132 deletions

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="298.171 98.799 32 32" width="32pt" height="32pt"><g><path d=" M 298.171 98.799 L 330.171 98.799 L 330.171 130.799 L 298.171 130.799 L 298.171 98.799 Z " fill="none"/><path d=" M 310.278 119.949 L 321.825 119.949 C 322.772 119.949 323.542 119.18 323.542 118.233 L 323.542 118.233 C 323.542 117.285 322.772 116.516 321.825 116.516 L 307.25 116.516 C 304.69 116.516 304.031 118.035 305.779 119.905 L 311.537 126.064 C 312.207 126.734 313.295 126.734 313.965 126.064 L 313.965 126.064 C 314.635 125.394 314.635 124.306 313.965 123.636 L 310.278 119.949 Z M 318.065 109.649 L 306.518 109.649 C 305.57 109.649 304.801 110.419 304.801 111.366 L 304.801 111.366 C 304.801 112.313 305.57 113.083 306.518 113.083 L 321.092 113.083 C 323.653 113.083 324.312 111.564 322.563 109.693 L 316.806 103.535 C 316.136 102.865 315.048 102.865 314.378 103.535 L 314.378 103.535 C 313.708 104.205 313.708 105.293 314.378 105.963 L 318.065 109.649 Z " fill-rule="evenodd" fill="rgb(0,0,0)"/></g></svg>

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -153,17 +153,9 @@ class _FileManagerPageState extends State<FileManagerPage>
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: Row( body: Row(
children: [ children: [
Flexible( Flexible(flex: 3, child: body(isLocal: true)),
flex: 3, Flexible(flex: 3, child: body(isLocal: false)),
child: body(isLocal: true), Flexible(flex: 2, child: statusList())
),
Flexible(
flex: 3,
child: body(isLocal: false),
),
model.jobTable.isEmpty
? SizedBox()
: Flexible(flex: 2, child: statusList())
], ],
), ),
); );
@ -550,6 +542,18 @@ class _FileManagerPageState extends State<FileManagerPage>
return false; return false;
} }
Widget generateCard(Widget child) {
return Container(
decoration: BoxDecoration(
color: Theme.of(context).cardColor,
borderRadius: BorderRadius.all(
Radius.circular(15.0),
),
),
child: child,
);
}
/// transfer status list /// transfer status list
/// watch transfer status /// watch transfer status
Widget statusList() { Widget statusList() {
@ -558,21 +562,37 @@ class _FileManagerPageState extends State<FileManagerPage>
child: Container( child: Container(
margin: const EdgeInsets.only(top: 16.0, bottom: 16.0, right: 16.0), 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),
child: Obx( child: model.jobTable.isEmpty
? generateCard(
Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
SvgPicture.asset(
"assets/transfer.svg",
color: Theme.of(context).tabBarTheme.labelColor,
height: 40,
).paddingOnly(bottom: 10),
Text(
translate("No transfers in progress"),
textAlign: TextAlign.center,
textScaleFactor: 1.20,
style: TextStyle(
color: Theme.of(context).tabBarTheme.labelColor),
),
],
),
),
)
: 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 Padding( return Padding(
padding: const EdgeInsets.only(bottom: 5), padding: const EdgeInsets.only(bottom: 5),
child: Container( child: generateCard(
decoration: BoxDecoration( Column(
color: Theme.of(context).cardColor,
borderRadius: BorderRadius.all(
Radius.circular(15.0),
),
),
child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Row( Row(
@ -582,7 +602,9 @@ class _FileManagerPageState extends State<FileManagerPage>
angle: item.isRemote ? pi : 0, angle: item.isRemote ? pi : 0,
child: SvgPicture.asset( child: SvgPicture.asset(
"assets/arrow.svg", "assets/arrow.svg",
color: Theme.of(context).tabBarTheme.labelColor, color: Theme.of(context)
.tabBarTheme
.labelColor,
), ),
).paddingOnly(left: 15), ).paddingOnly(left: 15),
const SizedBox( const SizedBox(
@ -591,10 +613,12 @@ class _FileManagerPageState extends State<FileManagerPage>
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,
@ -610,7 +634,8 @@ class _FileManagerPageState extends State<FileManagerPage>
), ),
), ),
Offstage( Offstage(
offstage: item.state != JobState.inProgress, offstage:
item.state != JobState.inProgress,
child: Text( child: Text(
'${translate("Speed")} ${readableFileSize(item.speed)}/s', '${translate("Speed")} ${readableFileSize(item.speed)}/s',
style: TextStyle( style: TextStyle(
@ -620,7 +645,8 @@ class _FileManagerPageState extends State<FileManagerPage>
), ),
), ),
Offstage( Offstage(
offstage: item.state == JobState.inProgress, offstage:
item.state == JobState.inProgress,
child: Text( child: Text(
translate( translate(
item.display(), item.display(),
@ -632,7 +658,8 @@ class _FileManagerPageState extends State<FileManagerPage>
), ),
), ),
Offstage( Offstage(
offstage: item.state != JobState.inProgress, offstage:
item.state != JobState.inProgress,
child: LinearPercentIndicator( child: LinearPercentIndicator(
padding: EdgeInsets.only(right: 15), padding: EdgeInsets.only(right: 15),
animateFromLastPercent: true, animateFromLastPercent: true,
@ -640,11 +667,13 @@ class _FileManagerPageState extends State<FileManagerPage>
'${(item.finishedSize / item.totalSize * 100).toStringAsFixed(0)}%', '${(item.finishedSize / item.totalSize * 100).toStringAsFixed(0)}%',
), ),
barRadius: Radius.circular(15), barRadius: Radius.circular(15),
percent: item.finishedSize / item.totalSize, percent: item.finishedSize /
item.totalSize,
progressColor: MyTheme.accent, progressColor: MyTheme.accent,
backgroundColor: backgroundColor:
Theme.of(context).hoverColor, Theme.of(context).hoverColor,
lineHeight: kDesktopFileTransferRowHeight, lineHeight:
kDesktopFileTransferRowHeight,
).paddingSymmetric(vertical: 15), ).paddingSymmetric(vertical: 15),
), ),
], ],
@ -678,7 +707,7 @@ class _FileManagerPageState extends State<FileManagerPage>
model.cancelJob(item.id); model.cancelJob(item.id);
}, },
color: MyTheme.accent, color: MyTheme.accent,
hoverColor: MyTheme.button, hoverColor: MyTheme.accent80,
), ),
], ],
), ),