… | |
… | |
1082 | my $self = $class->SUPER::new ( |
1082 | my $self = $class->SUPER::new ( |
1083 | bg => [1, 1, 1, 1], |
1083 | bg => [1, 1, 1, 1], |
1084 | border_bg => [1, 1, 1, 1], |
1084 | border_bg => [1, 1, 1, 1], |
1085 | border => 0.6, |
1085 | border => 0.6, |
1086 | can_events => 1, |
1086 | can_events => 1, |
1087 | min_w => 16, |
1087 | min_w => 64, |
1088 | min_h => 16, |
1088 | min_h => 32, |
1089 | %arg, |
1089 | %arg, |
1090 | ); |
1090 | ); |
1091 | |
1091 | |
1092 | $self->{title_widget} = new CFClient::UI::Label |
1092 | $self->{title_widget} = new CFClient::UI::Label |
1093 | align => 0, |
1093 | align => 0, |
… | |
… | |
3816 | my ($w, $h) = @$widget{qw(alloc_w alloc_h)}; |
3816 | my ($w, $h) = @$widget{qw(alloc_w alloc_h)}; |
3817 | |
3817 | |
3818 | $w = 0 if $w < 0; |
3818 | $w = 0 if $w < 0; |
3819 | $h = 0 if $h < 0; |
3819 | $h = 0 if $h < 0; |
3820 | |
3820 | |
|
|
3821 | $w = max $widget->{min_w}, $w; |
|
|
3822 | $h = max $widget->{min_h}, $h; |
|
|
3823 | |
|
|
3824 | $w = min $widget->{max_w}, $w if exists $widget->{max_w}; |
|
|
3825 | $h = min $widget->{max_h}, $h if exists $widget->{max_h}; |
|
|
3826 | |
3821 | $w = int $w + 0.5; |
3827 | $w = int $w + 0.5; |
3822 | $h = int $h + 0.5; |
3828 | $h = int $h + 0.5; |
3823 | |
3829 | |
3824 | if ($widget->{w} != $w || $widget->{h} != $h || delete $widget->{force_size_alloc}) { |
3830 | if ($widget->{w} != $w || $widget->{h} != $h || delete $widget->{force_size_alloc}) { |
3825 | $widget->{old_w} = $widget->{w}; |
3831 | $widget->{old_w} = $widget->{w}; |