mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-03-31 16:45:27 +00:00
disconnect previous connection on active
This commit is contained in:
parent
9e56d37bae
commit
d3c9cb843f
2 changed files with 12 additions and 1 deletions
|
|
@ -17,6 +17,9 @@ Request::Request(
|
|||
action__update = ACTION__UPDATE;
|
||||
action__reload = ACTION__RELOAD;
|
||||
|
||||
// Init extras
|
||||
progress_fraction = 0;
|
||||
|
||||
// Init widget
|
||||
set_placeholder_text(
|
||||
_("URL or search term...")
|
||||
|
|
@ -53,8 +56,14 @@ void Request::update(
|
|||
// Update progress
|
||||
progress_fraction = PROGRESS_FRACTION;
|
||||
|
||||
// Reset previous connection
|
||||
if (progress_connection.connected())
|
||||
{
|
||||
progress_connection.disconnect();
|
||||
}
|
||||
|
||||
// Animate progress function
|
||||
Glib::signal_timeout().connect(
|
||||
progress_connection = Glib::signal_timeout().connect(
|
||||
[this]() -> bool
|
||||
{
|
||||
double current_progress_fraction = get_progress_fraction();
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#include <glibmm/regex.h>
|
||||
#include <glibmm/ustring.h>
|
||||
#include <gtkmm/entry.h>
|
||||
#include <sigc++/connection.h>
|
||||
#include <sqlite3.h>
|
||||
|
||||
namespace app::browser::main::tab::page::navigation
|
||||
|
|
@ -65,6 +66,7 @@ namespace app::browser::main::tab::page::navigation
|
|||
|
||||
// Extras
|
||||
double progress_fraction;
|
||||
sigc::connection progress_connection;
|
||||
|
||||
// Defaults
|
||||
const bool HEXPAND = true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue