mirror of
https://github.com/veeso/termscp.git
synced 2026-04-04 17:21:21 -07:00
feat: update progress bar display for new unified data model
This commit is contained in:
@@ -178,33 +178,30 @@ impl FileTransferActivity {
|
|||||||
filename: String,
|
filename: String,
|
||||||
) {
|
) {
|
||||||
ui_result(self.app.attr(
|
ui_result(self.app.attr(
|
||||||
&Id::ProgressBarFull,
|
&Id::TransferProgressBar,
|
||||||
Attribute::Text,
|
Attribute::Text,
|
||||||
AttrValue::String(self.transfer.full.to_string()),
|
AttrValue::String(self.transfer.progress.to_string()),
|
||||||
));
|
));
|
||||||
ui_result(self.app.attr(
|
ui_result(self.app.attr(
|
||||||
&Id::ProgressBarFull,
|
&Id::TransferProgressBar,
|
||||||
Attribute::Value,
|
Attribute::Value,
|
||||||
AttrValue::Payload(PropPayload::One(PropValue::F64(
|
AttrValue::Payload(PropPayload::One(PropValue::F64(
|
||||||
self.transfer.full.calc_progress(),
|
self.transfer.progress.calc_progress(),
|
||||||
))),
|
))),
|
||||||
));
|
));
|
||||||
|
let title = if self.transfer.progress.is_single_file() {
|
||||||
|
filename
|
||||||
|
} else {
|
||||||
|
format!(
|
||||||
|
"{} {}",
|
||||||
|
filename,
|
||||||
|
self.transfer.progress.file_count_display()
|
||||||
|
)
|
||||||
|
};
|
||||||
ui_result(self.app.attr(
|
ui_result(self.app.attr(
|
||||||
&Id::ProgressBarPartial,
|
&Id::TransferProgressBar,
|
||||||
Attribute::Text,
|
|
||||||
AttrValue::String(self.transfer.partial.to_string()),
|
|
||||||
));
|
|
||||||
ui_result(self.app.attr(
|
|
||||||
&Id::ProgressBarPartial,
|
|
||||||
Attribute::Value,
|
|
||||||
AttrValue::Payload(PropPayload::One(PropValue::F64(
|
|
||||||
self.transfer.partial.calc_progress(),
|
|
||||||
))),
|
|
||||||
));
|
|
||||||
ui_result(self.app.attr(
|
|
||||||
&Id::ProgressBarPartial,
|
|
||||||
Attribute::Title,
|
Attribute::Title,
|
||||||
AttrValue::Title((filename, Alignment::Center)),
|
AttrValue::Title((title, Alignment::Center)),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user