implemented shrinking transfers

This commit is contained in:
NicKoehler 2023-02-25 09:44:23 +01:00
parent ab9acc76fc
commit abeb2058ee
No known key found for this signature in database
GPG Key ID: BAE01394EB51AC58

View File

@ -153,9 +153,17 @@ class _FileManagerPageState extends State<FileManagerPage>
backgroundColor: Theme.of(context).scaffoldBackgroundColor, backgroundColor: Theme.of(context).scaffoldBackgroundColor,
body: Row( body: Row(
children: [ children: [
Flexible(flex: 3, child: body(isLocal: true)), Flexible(
Flexible(flex: 3, child: body(isLocal: false)), flex: 3,
Flexible(flex: 2, child: statusList()) child: body(isLocal: true),
),
Flexible(
flex: 3,
child: body(isLocal: false),
),
model.jobTable.isEmpty
? SizedBox()
: Flexible(flex: 2, child: statusList())
], ],
), ),
); );
@ -547,11 +555,8 @@ 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: model.jobTable.isEmpty child: Container(
? Center(child: Text(translate("Empty"))) margin: const EdgeInsets.only(top: 16.0, bottom: 16.0, right: 16.0),
: 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),
child: Obx( child: Obx(
() => ListView.builder( () => ListView.builder(
@ -577,9 +582,7 @@ 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) color: Theme.of(context).tabBarTheme.labelColor,
.tabBarTheme
.labelColor,
), ),
).paddingOnly(left: 15), ).paddingOnly(left: 15),
const SizedBox( const SizedBox(
@ -588,12 +591,10 @@ class _FileManagerPageState extends State<FileManagerPage>
Expanded( Expanded(
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Tooltip( Tooltip(
waitDuration: waitDuration: Duration(milliseconds: 500),
Duration(milliseconds: 500),
message: item.jobName, message: item.jobName,
child: Text( child: Text(
item.jobName, item.jobName,
@ -609,8 +610,7 @@ class _FileManagerPageState extends State<FileManagerPage>
), ),
), ),
Offstage( Offstage(
offstage: offstage: item.state != JobState.inProgress,
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,8 +620,7 @@ class _FileManagerPageState extends State<FileManagerPage>
), ),
), ),
Offstage( Offstage(
offstage: offstage: item.state == JobState.inProgress,
item.state == JobState.inProgress,
child: Text( child: Text(
translate( translate(
item.display(), item.display(),
@ -633,8 +632,7 @@ class _FileManagerPageState extends State<FileManagerPage>
), ),
), ),
Offstage( Offstage(
offstage: offstage: item.state != JobState.inProgress,
item.state != JobState.inProgress,
child: LinearPercentIndicator( child: LinearPercentIndicator(
padding: EdgeInsets.only(right: 15), padding: EdgeInsets.only(right: 15),
animateFromLastPercent: true, animateFromLastPercent: true,
@ -642,13 +640,11 @@ 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 / percent: item.finishedSize / item.totalSize,
item.totalSize,
progressColor: MyTheme.accent, progressColor: MyTheme.accent,
backgroundColor: backgroundColor:
Theme.of(context).hoverColor, Theme.of(context).hoverColor,
lineHeight: lineHeight: kDesktopFileTransferRowHeight,
kDesktopFileTransferRowHeight,
).paddingSymmetric(vertical: 15), ).paddingSymmetric(vertical: 15),
), ),
], ],
@ -696,7 +692,8 @@ class _FileManagerPageState extends State<FileManagerPage>
itemCount: model.jobTable.length, itemCount: model.jobTable.length,
), ),
), ),
)); ),
);
} }
Widget headTools(bool isLocal) { Widget headTools(bool isLocal) {