summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xcontrol-center15
1 files changed, 11 insertions, 4 deletions
diff --git a/control-center b/control-center
index 9166640e..2aa7bf40 100755
--- a/control-center
+++ b/control-center
@@ -1382,7 +1382,7 @@ sub clean_list {
} @$subtree;
}
-
+my @labels;
foreach (@tree) {
my ($text, $icon, $subtrees) = @$_;
@@ -1484,6 +1484,7 @@ foreach (@tree) {
$document->clear;
$document->open_stream("text/html");
$document->write_stream($string);
+ $labels[$index-1]{text} = $text;
gtkappend_page($notebook_global,
my $_w_ret = create_scrolled_window(gtkset_border_width($view, 5),
@@ -1491,7 +1492,7 @@ foreach (@tree) {
),
gtkpack__(Gtk2::HBox->new,
Gtk2::Image->new_from_pixbuf(::scale(gtkcreate_pixbuf($icon), -16)),
- gtkset_markup(Gtk2::WrappedLabel->new, '<span weight="bold">' . $text . '</span>'),
+ $labels[$index-1]{widget} = Gtk2::WrappedLabel->new($text),
),
);
# $w_ret->vscrollbar->set_size_request(19, undef);
@@ -1560,9 +1561,15 @@ $wait_darea->signal_connect(expose_event => sub {
gtkflush();
set_page_raw(0);
+
+my $old_index;
$notebook_global->signal_connect(switch_page => sub {
- my $tab_number = $_[2];
- return unless $tab_number > 0;
+ my ($notebook, $page, $new_index) = @_;
+ return if !$labels[$new_index]{widget};
+ my $page = $notebook_global->get_current_page;
+ $labels[$old_index]{widget}->set_markup($labels[$old_index]{text}) if -1 < $old_index;
+ $labels[$new_index]{widget}->set_markup('<span weight="bold">' . $labels[$new_index]{text} . '</span>');
+ $old_index = $new_index;
});
$window_global->show_all;