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,
body: Row(
children: [
Flexible(flex: 3, child: body(isLocal: true)),
Flexible(flex: 3, child: body(isLocal: false)),
Flexible(flex: 2, child: statusList())
Flexible(
flex: 3,
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() {
return PreferredSize(
preferredSize: const Size(200, double.infinity),
child: model.jobTable.isEmpty
? Center(child: Text(translate("Empty")))
: Container(
margin:
const EdgeInsets.only(top: 16.0, bottom: 16.0, right: 16.0),
child: Container(
margin: const EdgeInsets.only(top: 16.0, bottom: 16.0, right: 16.0),
padding: const EdgeInsets.all(8.0),
child: Obx(
() => ListView.builder(
@ -577,9 +582,7 @@ class _FileManagerPageState extends State<FileManagerPage>
angle: item.isRemote ? pi : 0,
child: SvgPicture.asset(
"assets/arrow.svg",
color: Theme.of(context)
.tabBarTheme
.labelColor,
color: Theme.of(context).tabBarTheme.labelColor,
),
).paddingOnly(left: 15),
const SizedBox(
@ -588,12 +591,10 @@ class _FileManagerPageState extends State<FileManagerPage>
Expanded(
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Tooltip(
waitDuration:
Duration(milliseconds: 500),
waitDuration: Duration(milliseconds: 500),
message: item.jobName,
child: Text(
item.jobName,
@ -609,8 +610,7 @@ class _FileManagerPageState extends State<FileManagerPage>
),
),
Offstage(
offstage:
item.state != JobState.inProgress,
offstage: item.state != JobState.inProgress,
child: Text(
'${translate("Speed")} ${readableFileSize(item.speed)}/s',
style: TextStyle(
@ -620,8 +620,7 @@ class _FileManagerPageState extends State<FileManagerPage>
),
),
Offstage(
offstage:
item.state == JobState.inProgress,
offstage: item.state == JobState.inProgress,
child: Text(
translate(
item.display(),
@ -633,8 +632,7 @@ class _FileManagerPageState extends State<FileManagerPage>
),
),
Offstage(
offstage:
item.state != JobState.inProgress,
offstage: item.state != JobState.inProgress,
child: LinearPercentIndicator(
padding: EdgeInsets.only(right: 15),
animateFromLastPercent: true,
@ -642,13 +640,11 @@ class _FileManagerPageState extends State<FileManagerPage>
'${(item.finishedSize / item.totalSize * 100).toStringAsFixed(0)}%',
),
barRadius: Radius.circular(15),
percent: item.finishedSize /
item.totalSize,
percent: item.finishedSize / item.totalSize,
progressColor: MyTheme.accent,
backgroundColor:
Theme.of(context).hoverColor,
lineHeight:
kDesktopFileTransferRowHeight,
lineHeight: kDesktopFileTransferRowHeight,
).paddingSymmetric(vertical: 15),
),
],
@ -696,7 +692,8 @@ class _FileManagerPageState extends State<FileManagerPage>
itemCount: model.jobTable.length,
),
),
));
),
);
}
Widget headTools(bool isLocal) {