diff options
author | damien <damien@mandriva.com> | 2001-01-05 15:10:17 +0000 |
---|---|---|
committer | damien <damien@mandriva.com> | 2001-01-05 15:10:17 +0000 |
commit | e8e7d8485aaab7350fc85aecb31278aed8110db5 (patch) | |
tree | c786794b8b867c50e79507b92b132f1683d30162 | |
parent | 7c3261b92001cf8cf0c0418efeb702083b02ad7d (diff) | |
download | control-center-e8e7d8485aaab7350fc85aecb31278aed8110db5.tar control-center-e8e7d8485aaab7350fc85aecb31278aed8110db5.tar.gz control-center-e8e7d8485aaab7350fc85aecb31278aed8110db5.tar.bz2 control-center-e8e7d8485aaab7350fc85aecb31278aed8110db5.tar.xz control-center-e8e7d8485aaab7350fc85aecb31278aed8110db5.zip |
updated
-rwxr-xr-x | control-center2 | 47 |
1 files changed, 35 insertions, 12 deletions
diff --git a/control-center2 b/control-center2 index 331adb72..1b4b974d 100755 --- a/control-center2 +++ b/control-center2 @@ -92,7 +92,9 @@ $vbox_global->pack_start($hbox_global, 1, 1, 0); $hbox_global->border_width(5); my $scrolled_global = new Gtk::ScrolledWindow; $scrolled_global->set_policy('automatic','automatic'); -$scrolled_global->set_usize(70, 0); +$scrolled_global->set_usize(100, 0); +$scrolled_global->set_name("icons_back"); +#$scrolled_global->window->draw_rectangle(nil,1, 0, 0, 70, 70); #$scrolled_global->window->style->bg_gc('normal') $hbox_global->pack_start($scrolled_global,0,1,0); my $vseparator_global = new Gtk::VSeparator; $hbox_global->pack_start($vseparator_global,0,1,0); @@ -127,22 +129,26 @@ my %tree; $tree{nb_groups}=2; $tree[0]{name}="groupe1"; $tree[0]{nb_applis}=2; -$tree[0]{applis}[0]{name}='drakfont'; -$tree[0]{applis}[1]{name}='drakfloppy'; +$tree[0]{applis}[0]{name}='DrakFont'; +$tree[0]{applis}[0]{exec}='drakfont'; +$tree[0]{applis}[1]{name}='DrakFloppy'; +$tree[0]{applis}[1]{exec}='drakfloppy'; $tree[1]{name}="groupe2"; $tree[1]{nb_applis}=2; -$tree[1]{applis}[0]{name}='drakxservices'; -$tree[1]{applis}[1]{name}='drakboot'; +$tree[1]{applis}[0]{name}='DrakFont';#'drakxservices'; +$tree[1]{applis}[0]{exec}='drakfont';#'drakxservices'; +$tree[1]{applis}[1]{name}='DrakFloppy';#'drakboot'; +$tree[1]{applis}[1]{exec}='drakfloppy';#'drakboot'; #print Data::Dumper->Dump([%tree], ['tree']) . "\n"; print "nb gr : " . $tree{nb_groups} . "\n"; my $num=0; my $group; for ( $group=0; $group<$tree{nb_groups}; $group++) { print "group : $group\n"; - draw_icon(56, 36, 'item', 0, "", $group); + draw_icon(56, 36, 'item', 0, "", $tree[$group]{name}, $group); for ($item=0; $item<$tree[$group]{nb_applis}; $item++) { print "item : $item\n"; - draw_icon(56, 36, 'item', 1, $tree[$group]{applis}[$item]{name}, $num); + draw_icon(56, 36, 'item', 1, $tree[$group]{applis}[$item]{exec}, $tree[$group]{applis}[$item]{name}, $num); $num++; } } @@ -150,12 +156,16 @@ print Data::Dumper->Dump([$tree[0]{applis}[0]], ['tree-applis->0-->']) . "\n"; ######### -#my $rc = "control-center.rc"; -#Gtk::Rc->parse($rc); + +my $area_global = new Gtk::DrawingArea; +$vbox_global_left->pack_start($area_global,1,1,0); +my $rc = "control-center.rc"; +Gtk::Rc->parse($rc); $window_global->show_all; for (my $i=0; $i<$tree{nb_groups}; $i++) { for (my $j=0; $j<$tree[$i]{nb_applis}; $j++) { $tree[$i]{applis}[$j]{darea}->hide; + $tree[$i]{applis}[$j]{label}->hide; } } print "num : " . $notebook_global->page_num($vbox_about) . "\n"; @@ -166,7 +176,7 @@ Gtk->main; sub draw_icon { - my ($width, $height, $icon_name, $decalage, $exec_string, $number ) = @_; + my ($width, $height, $icon_name, $decalage, $exec_string, $name, $number ) = @_; my %hash; if ($exec_string) { my $socket = new Gtk::Socket; @@ -183,8 +193,18 @@ sub draw_icon { $hash{anim_idle}=undef; $hash{timeout}=undef; $hash{darea} = new Gtk::DrawingArea; + $hash{label} = new Gtk::DrawingArea; + $hash{label}->set_usize(50, 12); + $hash{label}->signal_connect(expose_event => sub { + my $font = $hash{label}->style->font; + my $w = $font->string_width($name); + $hash{label}->window->draw_string($font, $hash{label}->style->fg_gc('normal'), ($hash{label}->allocation->[2] - $w) / 2 * 0 + $decalage*20, 9, $name ); #($hash{label}->allocation->[3]-40)/2 +# $hash{label}->window->draw_string($font, $hash{label}->style->bg_gc('normal'), 0, 10, "QQWWylt"); #($hash{label}->allocation->[3]-40)/2 +}); + if ($exec_string) { $tree[$group]{applis}[$item]{darea} = $hash{darea}; + $tree[$group]{applis}[$item]{label} = $hash{label}; } $hash{darea}->set_usize($width,$height); $hash{darea}->set_events(['exposure_mask', 'enter_notify_mask', 'leave_notify_mask', 'button_press_mask', 'button_release_mask' ]); @@ -193,7 +213,7 @@ sub draw_icon { $hash{darea}->window->draw_pixmap ($hash{darea}->style->bg_gc('normal'), $pixmaps_global{ $icon_name . $hash{actual_pixmap} . '_pixmap'}, 0, 0, - ($hash{darea}->allocation->[2]-$hash{PIX_W})/2+($decalage * 10), + ($hash{darea}->allocation->[2]-$hash{PIX_W})/2*0+($decalage * 20), ($hash{darea}->allocation->[3]-$hash{PIX_H})/2, $hash{PIX_W} , $hash{PIX_H} ); }); @@ -208,7 +228,7 @@ sub draw_icon { ($hash{darea}->style->bg_gc('normal'), $pixmaps_global{ $icon_name . $hash{actual_pixmap} . '_pixmap'}, 0, 0, - ($hash{darea}->allocation->[2]-$hash{PIX_W})/2+($decalage * 10), + ($hash{darea}->allocation->[2]-$hash{PIX_W})/2*0+($decalage * 20), ($hash{darea}->allocation->[3]-$hash{PIX_H})/2, $hash{PIX_W} , $hash{PIX_H} ); $hash{save_pixmap}=$hash{actual_pixmap}; @@ -244,15 +264,18 @@ sub draw_icon { #print "yep i : $i ; j : $j\n"; #print Data::Dumper->Dump([$tree[$i]{applis}[$j]{darea}], ['darea-->']) . "\n"; $tree[$i]{applis}[$j]{darea}->show; + $tree[$i]{applis}[$j]{label}->show; } else { #print "nope i : $i ; j : $j\n"; $tree[$i]{applis}[$j]{darea}->hide; + $tree[$i]{applis}[$j]{label}->hide; } } } }); } $vbox_global_left->pack_start($hash{darea},0,1,0); + $vbox_global_left->pack_start($hash{label},0,1,0); } sub item_factory_cb { |