diff options
Diffstat (limited to 'control-center3')
-rwxr-xr-x | control-center3 | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/control-center3 b/control-center3 index c922ec30..209f7b4f 100755 --- a/control-center3 +++ b/control-center3 @@ -100,7 +100,7 @@ $vbox_global->pack_start($hpane_global, 1, 1, 0); $hpane_global->border_width(5); my $scrolled_global = new Gtk::ScrolledWindow; $scrolled_global->set_policy('automatic','automatic'); -$scrolled_global->set_usize(195, 0); +$scrolled_global->set_usize(210, 0); $scrolled_global->set_name("icons_back"); $hpane_global->pack1($scrolled_global,0,1); @@ -130,6 +130,8 @@ $window_global->realize; my $tree= new Gtk::Tree; $tree->set_selection_mode('browse'); +$tree->set_view_lines(0); +$tree->set_view_mode('item'); $vbox_global_left->pack_start($tree,1,1,0); map { create_tree_item($tree, $_->[0] , "$xpm_path_l/$_->[1]",1); @@ -323,21 +325,22 @@ my $treeitem_old; sub create_tree_item { my ($parent_tree, $label, $pixmap, $tree_depth_max) =@_; + my $expanded=0; my ($treeitem, $treebox, $new_subtree); $treeitem = new Gtk::TreeItem(); - $treebox = xpm_label_box($window_global,$pixmap,$label); + $treebox = xpm_label_box($window_global,$pixmap,$label, !$tree_depth_max); $treeitem->add($treebox); - $treebox->show(); if ($tree_depth_max == 0) { $tree_launched{$label}->[1]=\$treeitem; $treeitem->signal_connect('select', sub { exec_treeitem($label, $tree_exec{$label}, -e $tree_exec{$label} ) }); } else { + $treeitem->signal_connect('button_press_event', sub { $expanded ? $treeitem->collapse : $treeitem->expand; $expanded = !$expanded }); $treeitem->signal_connect('select', sub { $treeitem_old and $$treeitem_old->collapse(); $treeitem->expand(); $treeitem_old=\$treeitem; - #$treeitem->deselect(); + $expanded=1; }); } $parent_tree->append($treeitem); - $treeitem->show(); + $treeitem->show_all(); if ($tree_depth_max) { $tree_depth_max-- ; @@ -375,10 +378,16 @@ sub create_tree_item { } sub xpm_label_box { - my ( $parent, $xpm_filename, $label_text ) = @_; + my ( $parent, $xpm_filename, $label_text, $is_last ) = @_; # Create box for xpm and label my $box = new Gtk::HBox( 0, 0 ); - # Get the style of the button to get the background color. + my $box2; + if ($is_last) { + $box2 = new Gtk::HBox( 0, 0 ); + $box2->set_usize(20, 0); + $box->pack_start($box2, 0, 0, 0); + } + # Get the style of the button to get the background color. my $style = $parent->get_style()->bg( 'normal' ); # Now on to the xpm stuff my ($pixmap, $mask) = gtkcreate_png($xpm_filename ); @@ -389,8 +398,6 @@ sub xpm_label_box { $box->pack_start( $pixmapwid, 0, 0, 3 ); $box->pack_start( $label, 0, 0, 3 ); $box->border_width( 2 ); - $pixmapwid->show(); - $label->show(); return ( $box ); } |