summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mandriva.org>2008-09-24 22:16:21 +0000
committerThierry Vignaud <tv@mandriva.org>2008-09-24 22:16:21 +0000
commit35512db3c2e8755be7cf256d6189848ed0ec3e9c (patch)
tree8db7187e371c5b263d5b8d71df6dad5a1a6bf54c
parent328721c712890d9a34fb302a6e5ca33faa446904 (diff)
downloadcontrol-center-35512db3c2e8755be7cf256d6189848ed0ec3e9c.tar
control-center-35512db3c2e8755be7cf256d6189848ed0ec3e9c.tar.gz
control-center-35512db3c2e8755be7cf256d6189848ed0ec3e9c.tar.bz2
control-center-35512db3c2e8755be7cf256d6189848ed0ec3e9c.tar.xz
control-center-35512db3c2e8755be7cf256d6189848ed0ec3e9c.zip
some code was moved & renamed into mygtk2 in order to be reused:
new_pixbuf() => mygtk2::_new_alpha_pixbuf() render_alpha() => mygtk2::_pixbuf_render_alpha()
-rwxr-xr-xcontrol-center19
1 files changed, 2 insertions, 17 deletions
diff --git a/control-center b/control-center
index fe2d3384..312a16ed 100755
--- a/control-center
+++ b/control-center
@@ -940,7 +940,7 @@ $wait_darea->signal_connect(expose_event => sub {
return unless $run_pixbuf; # some people got an expose event before we start an embedded tool
return unless $wait_darea->{size};
$wait_darea->{layout} ||= $wait_darea->create_pango_layout(N("Loading... Please wait"));
- my $pixbuf = $run_pixbufs{$run_counter} ||= render_alpha($run_pixbuf, $run_counter);
+ my $pixbuf = $run_pixbufs{$run_counter} ||= mygtk2::_pixbuf_render_alpha($run_pixbuf, $run_counter);
if (!$wait_darea->{first_expose}) {
$wait_darea->{first_expose} = 1;
my $size = $wait_darea->{size};
@@ -1421,24 +1421,9 @@ sub rtl_gtkcreate_img {
mygtk2::text_direction_rtl() ? ugtk2::gtkcreate_img($icon . "_rtl") : ugtk2::gtkcreate_img($icon);
}
-sub new_pixbuf {
- my ($pixbuf) = @_;
- my ($height, $width) = ($pixbuf->get_height, $pixbuf->get_width);
- my $new_pixbuf = Gtk2::Gdk::Pixbuf->new('rgb', 1, 8, $width, $height);
- $new_pixbuf->fill(0x00000000); # transparent white
- $width, $height, $new_pixbuf;
-}
-
-sub render_alpha {
- my ($pixbuf, $alpha_threshold) = @_;
- my ($width, $height, $new_pixbuf) = new_pixbuf($pixbuf);
- $pixbuf->composite($new_pixbuf, 0, 0, $width, $height, 0, 0, 1, 1, 'nearest', $alpha_threshold);
- $new_pixbuf;
-}
-
sub render_shiner {
my ($pixbuf, $shine_value) = @_;
- my $new_pixbuf = (new_pixbuf($pixbuf))[2];
+ my $new_pixbuf = (mygtk2::_new_alpha_pixbuf($pixbuf))[2];
$pixbuf->saturate_and_pixelate($new_pixbuf, $shine_value, 0);
$new_pixbuf;
}