diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2005-02-25 16:10:00 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2005-02-25 16:10:00 +0000 |
commit | 713f7fd7ee649be3e9f10fc1a92096238f1fcaed (patch) | |
tree | d23cd5c5fe3a2dde0aa1b1c714e70824cd7c793c | |
parent | 40c74cffb6657e7e65d1f046aef5e349d70976b4 (diff) | |
download | control-center-713f7fd7ee649be3e9f10fc1a92096238f1fcaed.tar control-center-713f7fd7ee649be3e9f10fc1a92096238f1fcaed.tar.gz control-center-713f7fd7ee649be3e9f10fc1a92096238f1fcaed.tar.bz2 control-center-713f7fd7ee649be3e9f10fc1a92096238f1fcaed.tar.xz control-center-713f7fd7ee649be3e9f10fc1a92096238f1fcaed.zip |
fix layout but on "expert mode" switch while embedding a tool (#13416)
-rwxr-xr-x | control-center | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/control-center b/control-center index bebd0d11..1386d4de 100755 --- a/control-center +++ b/control-center @@ -1260,11 +1260,21 @@ my $spacing = 25; my %tool_callbacks; -my $page_count; +my ($page_count, $need_to_refresh); + +sub really_refresh_tree { + my $pos = $notebook_global->get_current_page; + $notebook_global->show_all; + $notebook_global->queue_draw; + # workaround buggy gtk+: + $notebook_global->set_current_page($page_count-$_-1) foreach 0..$page_count-1; + # restore previous position: + $notebook_global->set_current_page($pos); + $notebook_global->window && $notebook_global->window->thaw_updates; +} sub refresh_tree { my ($mode) = @_; - my $pos = $notebook_global->get_current_page; if ($mode && $page_count) { $notebook_global->window && $notebook_global->window->freeze_updates; $notebook_global->remove_page(-1) foreach 0..$page_count-1; @@ -1349,14 +1359,8 @@ foreach (@tree) { add2notebook($banner_notebook, "", Gtk2::Banner->new($icon, $text)) if !$mode; } - if ($mode) { - $notebook_global->show_all; - # workaround buggy gtk+: - $notebook_global->set_current_page($page_count-$_-1) foreach 0..$page_count-1; - # restore previous position: - $notebook_global->set_current_page($pos); - $notebook_global->window && $notebook_global->window->thaw_updates; - } + $need_to_refresh = defined($emb_socket); + really_refresh_tree() if $mode && !$need_to_refresh; } refresh_tree(); @@ -1507,6 +1511,8 @@ sub create_hidden_socket { Gtk2::HSeparator->new, ), 1, gtksignal_connect($emb_socket = Gtk2::Socket->new, 'plug-removed' => sub { + # handle expert mode switch: + really_refresh_tree() if $need_to_refresh; $menu->show if $application_driven_menu; $banner->destroy; child_just_exited(); |