mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
append progressbar to request entry
This commit is contained in:
parent
f959a6627b
commit
3a91155596
10 changed files with 68 additions and 103 deletions
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue