summaryrefslogtreecommitdiffstats
path: root/perl-install/diskdrake/hd_gtk.pm
diff options
context:
space:
mode:
Diffstat (limited to 'perl-install/diskdrake/hd_gtk.pm')
-rw-r--r--perl-install/diskdrake/hd_gtk.pm16
1 files changed, 7 insertions, 9 deletions
diff --git a/perl-install/diskdrake/hd_gtk.pm b/perl-install/diskdrake/hd_gtk.pm
index e01f65b2b..653320697 100644
--- a/perl-install/diskdrake/hd_gtk.pm
+++ b/perl-install/diskdrake/hd_gtk.pm
@@ -327,7 +327,11 @@ sub create_automatic_notebooks {
sub create_buttons4partitions {
my ($kind, $totalsectors, @parts) = @_;
- $width = $w->{window}->get_allocated_width - first(get_action_box_size()) - 60 if $w->{window}->get_window;
+ if ($w->{window}->get_window) {
+ my $windowwidth = $w->{window}->get_allocated_width;
+ $windowwidth = $::real_windowwidth if $windowwidth <= 1;
+ $width = $windowwidth - first(get_action_box_size()) - 60;
+ }
my $ratio = $totalsectors ? ($width - @parts * $minwidth) / $totalsectors : 1;
my $i = 1;
@@ -352,14 +356,8 @@ sub create_buttons4partitions {
}
my $info = $entry->{mntpoint} || $entry->{device_LABEL} || '';
$info .= "\n" . ($entry->{size} ? formatXiB($entry->{size}, 512) : N("Unknown")) if $info;
- my $w;
- if ($::isInstall) {
- $w = Gtk3::ToggleButton->new();
- }else {
- $w = Gtk3::ToggleButton->new_with_label($info);
- $w->get_child->set_ellipsize('end');
- }
- $w or internal_error('new_with_label');
+ my $w = Gtk3::ToggleButton->new_with_label($info) or internal_error('new_with_label');
+ $w->get_child->set_ellipsize('end');
$w->set_tooltip_text($info);
$w->signal_connect(clicked => sub {
$current_button != $w or return;