Browse Source

implement refresh method for update

CPP-GTK4
yggverse 2 months ago
parent
commit
fac8c14cbd
  1. 2
      src/app/browser/main/tab/page/navigation.cpp
  2. 15
      src/app/browser/main/tab/page/navigation/update.cpp
  3. 4
      src/app/browser/main/tab/page/navigation/update.hpp

2
src/app/browser/main/tab/page/navigation.cpp

@ -107,7 +107,7 @@ void Navigation::refresh( @@ -107,7 +107,7 @@ void Navigation::refresh(
navigationHistory->refresh();
// Toggle update button sensibility
navigationUpdate->set_sensitive(
navigationUpdate->refresh(
navigationRequest->get_text_length() > 0
);

15
src/app/browser/main/tab/page/navigation/update.cpp

@ -17,10 +17,9 @@ Update::Update( @@ -17,10 +17,9 @@ Update::Update(
_("Update")
);
/* @TODO
set_sensitive(
false
); */
);
signal_clicked().connect(
[this]
@ -29,3 +28,15 @@ Update::Update( @@ -29,3 +28,15 @@ Update::Update(
}
);
}
void Update::refresh(
const bool & ENABLED
) {
set_sensitive(
ENABLED
);
action__update->set_enabled(
ENABLED
);
}

4
src/app/browser/main/tab/page/navigation/update.hpp

@ -17,6 +17,10 @@ namespace app::browser::main::tab::page::navigation @@ -17,6 +17,10 @@ namespace app::browser::main::tab::page::navigation
Update(
const Glib::RefPtr<Gio::SimpleAction> & ACTION__UPDATE
);
void refresh(
const bool & ENABLED
);
};
}

Loading…
Cancel
Save