diff options
Diffstat (limited to 'perl-install')
-rw-r--r-- | perl-install/ugtk3.pm | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/perl-install/ugtk3.pm b/perl-install/ugtk3.pm index 3cc54b5f7..725097ba1 100644 --- a/perl-install/ugtk3.pm +++ b/perl-install/ugtk3.pm @@ -1490,96 +1490,6 @@ sub new { } -package Gtk3::MDV::CellRendererPixWithLabel; - -use MDK::Common; -use Glib::Object::Subclass "Gtk3::CellRenderer", - properties => [ - Glib::ParamSpec->string("label", "Label", "A meaningfull label", "", [qw(readable writable)]), - Glib::ParamSpec->object("pixbuf", "Pixbuf file", "Something nice to display", 'Gtk3::Gdk::Pixbuf', [qw(readable writable)]), - ]; - -my $x_padding = 2; -my $y_padding = 2; - -sub INIT_INSTANCE {} - -sub pixbuf_size { - my ($cell) = @_; - my $pixbuf = $cell->get('pixbuf'); - $pixbuf ? ($pixbuf->get_width, $pixbuf->get_height) : (0, 0); -} - -sub calc_size { - my ($cell, $layout) = @_; - my ($width, $height) = $layout->get_pixel_size; - my ($pwidth, $pheight) = pixbuf_size($cell); - - return 0, 0, - $width + $x_padding * 3 + $pwidth, - max($pheight, $height + $y_padding * 2); -} - -sub GET_SIZE { - my ($cell, $widget, $_cell_area) = @_; - - my $layout = get_layout($cell, $widget); - $layout->set_text($cell->get('label')); - - return calc_size($cell, $layout); -} - -sub get_layout { - my ($_cell, $widget) = @_; - return $widget->create_pango_layout(""); -} - -sub RENDER { # not that efficient... - my ($cell, $window, $widget, $_background_area, $cell_area, $_expose_area, $flags) = @_; - my $state; - if ($flags & 'selected') { - $state = $widget->has_focus - ? 'selected' - : 'active'; - } else { - $state = $widget->get_state eq 'insensitive' - ? 'insensitive' - : 'normal'; - } - - my $layout = get_layout($cell, $widget); - $layout->set_text($cell->get('label')); - - my $is_rtl = lang::text_direction_rtl(); - my $txt_width = first($layout->get_pixel_size); - - my ($x_offset, $y_offset, $_width, $_height) = calc_size($cell, $layout); - my $pixbuf = $cell->get('pixbuf'); - my ($pwidth, $pheight) = pixbuf_size($cell); - my $txt_offset = $cell_area->{x} + $x_offset + $x_padding * 2 + $pwidth; - - if ($pixbuf) { - $pixbuf->render_to_drawable($window, $widget->style->fg_gc('normal'), - 0, 0, - $is_rtl ? $cell_area->{width} - $cell_area->{x} - $pwidth : $cell_area->{x} ,#+ $x_padding, - $cell_area->{y}, #+ $y_padding, - $pwidth, $pheight, 'none', 0, 0); - } - $widget->get_style->paint_layout($window, - $state, - 1, - $cell_area, - $widget, - "cellrenderertext", - $is_rtl ? $cell_area->{width} - $txt_width - $txt_offset : $txt_offset, - $cell_area->{y} + $y_offset + $y_padding, - $layout); - -} - -1; - - package Gtk3::Notify::Queue; sub new { |