Skip to content

Commit

Permalink
fix #431 #384
Browse files Browse the repository at this point in the history
  • Loading branch information
guinux committed May 19, 2018
1 parent dd03f3f commit fba36ff
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/manager_window.vala
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ namespace Pamac {
Gtk.Label pending_label;
Gtk.ListBoxRow pending_row;
Gtk.ListBoxRow files_row;
bool scroll_to_top;

public ManagerWindow (Gtk.Application application) {
Object (application: application);
Expand All @@ -204,6 +205,7 @@ namespace Pamac {

button_back.visible = false;
select_all_button.visible = false;
scroll_to_top = true;
searchbar.connect_entry (search_entry);
refreshing = false;
important_details = false;
Expand Down Expand Up @@ -405,6 +407,7 @@ namespace Pamac {
if (!transaction.lockfile.query_exists ()) {
extern_lock = false;
transaction.refresh_handle ();
scroll_to_top = false;
refresh_packages_list ();
}
} else {
Expand All @@ -425,6 +428,7 @@ namespace Pamac {
void on_set_pkgreason_finished () {
transaction.unlock ();
transaction.refresh_handle ();
scroll_to_top = false;
refresh_packages_list ();
if (main_stack.visible_child_name == "details") {
if (transaction.get_installed_pkg (current_package_displayed).name != ""
Expand Down Expand Up @@ -1178,7 +1182,12 @@ namespace Pamac {
packages_treeview.freeze_child_notify ();
packages_list.clear ();
// scroll to top
packages_scrolledwindow.vadjustment.value = 0;
if (scroll_to_top) {
packages_scrolledwindow.vadjustment.value = 0;
} else {
// don't scroll to top just once
scroll_to_top = true;
}
if (pkgs.length == 0) {
origin_stack.visible_child_name = "no_item";
packages_treeview.thaw_child_notify ();
Expand Down Expand Up @@ -1254,7 +1263,12 @@ namespace Pamac {
aur_treeview.freeze_child_notify ();
aur_list.clear ();
// scroll to top
aur_scrolledwindow.vadjustment.value = 0;
if (scroll_to_top) {
aur_scrolledwindow.vadjustment.value = 0;
} else {
// don't scroll to top just once
scroll_to_top = true;
}
if (pkgs.length == 0) {
origin_stack.visible_child_name = "no_item";
aur_treeview.thaw_child_notify ();
Expand Down Expand Up @@ -2506,6 +2520,7 @@ namespace Pamac {
} else {
transaction.clear_lists ();
set_pendings_operations ();
scroll_to_top = false;
refresh_packages_list ();
if (main_stack.visible_child_name == "details") {
if (transaction.get_installed_pkg (current_package_displayed).name != ""
Expand Down Expand Up @@ -2643,11 +2658,13 @@ namespace Pamac {
sysupgrade_running = false;
transaction.to_build.remove_all ();
transaction.unlock ();
scroll_to_top = false;
refresh_packages_list ();
} else {
transaction_running = false;
generate_mirrors_list = false;
transaction.unlock ();
scroll_to_top = false;
refresh_packages_list ();
}
set_pendings_operations ();
Expand Down

0 comments on commit fba36ff

Please sign in to comment.