diff options
author | Thierry Vignaud <tv@mandriva.org> | 2008-01-09 16:41:22 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mandriva.org> | 2008-01-09 16:41:22 +0000 |
commit | c1ce94813e1d939daf8bef6f703720998e062be5 (patch) | |
tree | d18760755f5991b808a09ffdf04b2c1d8b69351a | |
parent | fc9d7699d819868d05049d2e596352d99dbcac56 (diff) | |
download | control-center-c1ce94813e1d939daf8bef6f703720998e062be5.tar control-center-c1ce94813e1d939daf8bef6f703720998e062be5.tar.gz control-center-c1ce94813e1d939daf8bef6f703720998e062be5.tar.bz2 control-center-c1ce94813e1d939daf8bef6f703720998e062be5.tar.xz control-center-c1ce94813e1d939daf8bef6f703720998e062be5.zip |
size horizontal & vertical sizes independently & support height of 480
so that strange laptops have reasonnable sizing
-rwxr-xr-x | control-center | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/control-center b/control-center index e9679703..50784010 100755 --- a/control-center +++ b/control-center @@ -47,9 +47,13 @@ my $themes_dir = "$mcc_dir/themes/"; my (%tool_pids, %tool_feedback); my ($version, $conffile, $class_install) = (`cat /etc/mandrakelinux-release` =~ /\b(\d+\.{1}.+\))/, "/etc/mcc.conf", "/etc/sysconfig/system"); -my $root_size = join('x', gtkroot()->get_size()); -my ($default_width, $default_height) = member($root_size, '640x480', '800x600') ? (720, 523) : (800, 600); +my ($rootwin_width, $rootwin_height) = gtkroot()->get_size(); +my $default_width = $rootwin_width <= 800 ? 720 : 800; +my $default_height = $rootwin_height <= 480 ? 420 : $rootwin_height <= 600 ? 523 : 600; + +my $min_width = $rootwin_width == 640 ? 620 : 680; +my $min_height = $rootwin_height == 480 ? 420 : 500; require_root_capability() if !$::testing; # just to get root capabilities @@ -1181,9 +1185,7 @@ my ($timeout, %check_boxes, $emb_socket); # set default size: -my @min_size = $root_size eq '640x480' ? (620, 460) : (680, 500); - -my $window_global = gtkset_size_request(Gtk2::Window->new('toplevel'), @min_size); +my $window_global = gtkset_size_request(Gtk2::Window->new('toplevel'), $min_width, $min_height); $::main_window = $window_global; if ($geometry) { @@ -1192,7 +1194,7 @@ if ($geometry) { $window_global->set_uposition($x, $y) if $x || $y; } else { } -$window_global->resize(max($default_width, $h{WIDTH}, $min_size[0]), max($h{HEIGTH}, $default_height, $min_size[1])); +$window_global->resize(max($default_width, $h{WIDTH}, $min_width), max($h{HEIGTH}, $default_height, $min_height)); $window_global->set_icon(gtkcreate_pixbuf("/usr/share/icons/drakconf.png")); |