Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

make a few scrolledwindows request a minimal height

these scrolledwindows previously only requested enough for the scrollbars
but with ubuntu's special scrollbars it makes them request nothing
  • Loading branch information...
commit 3d75f91e331ca3d8fee493542297df27aa909b1e 1 parent 504a577
@squentin authored
Showing with 8 additions and 2 deletions.
  1. +7 −2 gmusicbrowser_tags.pm
  2. +1 −0  plugins/desktopwidget.pm
View
9 gmusicbrowser_tags.pm
@@ -928,7 +928,9 @@ sub new
my $sw = Gtk2::ScrolledWindow->new;
$sw->set_shadow_type('etched-in');
$sw->set_policy('automatic','automatic');
- $sw->add( $self->{textview}=Gtk2::TextView->new );
+ my $textview= $self->{textview}= Gtk2::TextView->new;
+ $textview->set_size_request(100,($textview->create_pango_layout("X")->get_pixel_size)[1]*4); #request 4 lines of height
+ $sw->add($textview);
$self->add($sw);
my $val;
if (ref $IDs)
@@ -1939,7 +1941,9 @@ sub new
my $self = bless Gtk2::ScrolledWindow->new, $class;
$self->set_shadow_type('etched-in');
$self->set_policy('automatic','automatic');
- $self->add( $self->{textview}=Gtk2::TextView->new );
+ my $textview= $self->{textview}= Gtk2::TextView->new;
+ $textview->set_size_request(100,($textview->create_pango_layout("X")->get_pixel_size)[1]*4); #request 4 lines of height
+ $self->add($textview);
$self->set_text($init);
$self->{init}=$self->get_text;
return $self;
@@ -2191,6 +2195,7 @@ sub view
$sw->set_policy('never', 'automatic');
$sw->add($textview);
$dialog->vbox->add($sw);
+ $dialog->set_default_size(100,100);
$dialog->show_all;
$dialog->signal_connect( response => sub { $_[0]->destroy; });
}
View
1  plugins/desktopwidget.pm
@@ -37,6 +37,7 @@ sub prefbox
my $store=Gtk2::ListStore->new('Glib::String','Glib::Boolean','Glib::String');
$Treeview=Gtk2::TreeView->new($store);
+ $Treeview->set_size_request(100,($Treeview->create_pango_layout("X")->get_pixel_size)[1]*5.5); #request 5.5 lines of height (not counting row spacing)
$Treeview->set_headers_visible(::FALSE);
my $togglerenderer=Gtk2::CellRendererToggle->new;
$togglerenderer->signal_connect(toggled => \&toggled);
Please sign in to comment.
Something went wrong with that request. Please try again.