append progressbar to request entry

This commit is contained in:
yggverse 2024-09-06 05:17:33 +03:00
parent f959a6627b
commit 3a91155596
10 changed files with 68 additions and 103 deletions

View file

@ -15,6 +15,10 @@ Request::Request(
HEXPAND
);
set_progress_pulse_step(
PROGRESS_PULSE_STEP
);
if (!TEXT.empty())
{
set_text(
@ -48,6 +52,36 @@ Request::Request(
);
}
// Actions
void Request::refresh(
const double & PROGRESS_FRACTION
) {
// Update progress
progress_fraction = PROGRESS_FRACTION;
// Animate progress function
Glib::signal_timeout().connect(
[this]() -> bool
{
double current_progress_fraction = get_progress_fraction();
if (current_progress_fraction < progress_fraction)
{
set_progress_fraction(
current_progress_fraction + PROGRESS_PULSE_STEP
);
return false;
}
return true; // 100% of value
//return current_progress_fraction < 1; // until 100% of value
},
PROGRESS_ANIMATION_TIME
);
}
// Getters
Glib::ustring Request::get_scheme()
{