diff options
author | Thierry Vignaud <tvignaud@mandriva.org> | 2004-02-27 15:33:51 +0000 |
---|---|---|
committer | Thierry Vignaud <tvignaud@mandriva.org> | 2004-02-27 15:33:51 +0000 |
commit | b49fb11a6aa3fb3207801951fe37f7eb9aab7329 (patch) | |
tree | 8001340b765093e27a5efe4da327867de1108a51 | |
parent | 28faa40498df130b22e94c9504d946793cc70412 (diff) | |
download | control-center-b49fb11a6aa3fb3207801951fe37f7eb9aab7329.tar control-center-b49fb11a6aa3fb3207801951fe37f7eb9aab7329.tar.gz control-center-b49fb11a6aa3fb3207801951fe37f7eb9aab7329.tar.bz2 control-center-b49fb11a6aa3fb3207801951fe37f7eb9aab7329.tar.xz control-center-b49fb11a6aa3fb3207801951fe37f7eb9aab7329.zip |
when embedding a tool, display its own icon and name rather than class ones
-rwxr-xr-x | control-center | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/control-center b/control-center index c3414930..9df58d35 100755 --- a/control-center +++ b/control-center @@ -636,7 +636,7 @@ foreach (@tree) { my $event_box; $event_box = Gtk2::WebIcon->new($text, $tag, { - button_release_event => sub { compute_exec_string($label, $event_box, $tag, @{$exec_hash->{$label}}) }, + button_release_event => sub { compute_exec_string($label, $event_box, $tag, $text, @{$exec_hash->{$label}}) }, } ); $event_box->set_events([ 'enter_notify_mask', 'leave_notify_mask', 'button_press_mask', 'button_release_mask' ]); @@ -766,10 +766,19 @@ sub hide_socket_and_clean() { $pending_app = 0; } -sub create_hidden_socket() { - gtkpack_($emb_box, 1, gtksignal_connect($emb_socket = Gtk2::Socket->new, 'plug-removed' => \&child_just_exited)); +sub create_hidden_socket { + my ($icon, $label) = @_; + my $banner; + gtkpack_($emb_box, + 0, $banner = Gtk2::Banner->new($icon, $label), + 1, gtksignal_connect($emb_socket = Gtk2::Socket->new, 'plug-removed' => sub { + $banner->destroy; + child_just_exited(); + })); + $banner->hide; # signal emitted when embedded apps begin to draw: $emb_socket->signal_connect('plug-added' => sub { + $banner->show; Glib::Source->remove($timeout) if $timeout; $left_locked = 0; $wait_darea->hide; @@ -811,7 +820,7 @@ sub fork_ { } sub compute_exec_string { - my ($label, $box, $icon, $_log_exp, $exec_, $gtkplug, undef, $alternate) = @_; #($_[0], @{$_[1]}); + my ($label, $box, $icon, $text, $_log_exp, $exec_, $gtkplug, undef, $alternate) = @_; #($_[0], @{$_[1]}); return if $tool_pids{$label}; my $exec = ref($exec_) ? $exec_->[0] : $exec_; if (! -x first(split /\s+/, $exec)) { @@ -821,10 +830,10 @@ sub compute_exec_string { $exec .= " --summary" if $option_values{expert_wizard} && $exec_ =~ /drakwizard/; my $embedded = $gtkplug != -1; # not "explicitely not embedded" if ($embedded) { - foreach my $notebook ($notebook_global) { + foreach my $notebook ($notebook_global, $banner_notebook) { $notebook->hide; } - create_hidden_socket(); + create_hidden_socket($icon, $text); $emb_box->show; $emb_socket->realize; $pending_app = 1; |