summaryrefslogtreecommitdiffstats
path: root/perl-install/standalone/draksplash
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2005-06-06 05:37:42 +0000
committerOlivier Blin <oblin@mandriva.org>2005-06-06 05:37:42 +0000
commit5a53d6cc7eb815332c6195f3d360f916153cb4d4 (patch)
tree44a8eb03012f231e859d93a4a603efd4da32d9a0 /perl-install/standalone/draksplash
parent5d722529d5b15f443f594810a540fc7f896661e6 (diff)
downloaddrakx-backup-do-not-use-5a53d6cc7eb815332c6195f3d360f916153cb4d4.tar
drakx-backup-do-not-use-5a53d6cc7eb815332c6195f3d360f916153cb4d4.tar.gz
drakx-backup-do-not-use-5a53d6cc7eb815332c6195f3d360f916153cb4d4.tar.bz2
drakx-backup-do-not-use-5a53d6cc7eb815332c6195f3d360f916153cb4d4.tar.xz
drakx-backup-do-not-use-5a53d6cc7eb815332c6195f3d360f916153cb4d4.zip
- create update_scales_for_resolution() and update_scale_values_from_conf() out of update_scale_values()
- modify $adj{$_}{value} instead of calling $adj{$_}->set_value to avoid some artefacts caused by callbacks
Diffstat (limited to 'perl-install/standalone/draksplash')
-rwxr-xr-xperl-install/standalone/draksplash24
1 files changed, 10 insertions, 14 deletions
diff --git a/perl-install/standalone/draksplash b/perl-install/standalone/draksplash
index f9f06dcdb..56b7bc622 100755
--- a/perl-install/standalone/draksplash
+++ b/perl-install/standalone/draksplash
@@ -85,8 +85,6 @@ gtkadd($window->{window},
gtksignal_connect(Gtk2::Button->new(N("Quit")), clicked => \&close_all)))),
gtkshow(gtkadd($preview_window->{window}, $scroll));
-update_scale_values();
-
$window->{rwindow}->set_border_width(5);
$window->{rwindow}->set_position('center');
$window->{rwindow}->show_all;
@@ -99,7 +97,7 @@ sub close_all() {
ugtk2->exit(0);
}
-sub read_theme_config {
+sub read_theme_config() {
my $conf = bootsplash::theme_get_config_for_resolution($theme{name}, $theme{res});
-f $conf and $theme{conf} = bootsplash::theme_read_config_for_resolution($theme{name}, $theme{res});
if (-f $theme{conf}{silentjpeg}) {
@@ -109,7 +107,7 @@ sub read_theme_config {
load_image($theme{conf}{jpeg}, 1);
}
$theme{conf}{pc} ||= '0x21459d';
- update_scale_values();
+ update_scale_values_from_conf();
update_rect();
}
@@ -127,6 +125,7 @@ sub set_theme {
my ($res) = @_;
$theme{res} = $res;
($theme{res_w}, $theme{res_h}) = $theme{res} =~ /([^x]+)x([^x]+)/;
+ update_scales_for_resolution();
read_theme_config();
$image_area->set_size_request($theme{res_w}, $theme{res_h});
#- try not to be larger than screen size minus toolbars size
@@ -223,16 +222,13 @@ sub check_scale_value {
my $max = get_scale_max($changed) - $adj{$changed}->get_value;
$adj{$linked}->get_value > $max and $adj{$linked}->set_value($max);
}
-sub update_scale_values {
- foreach (keys %scale_settings) {
- $theme{conf}{$_} eq '' and $theme{conf}{$_} = get_scale_max($_) * $scale_settings{$_}[0];
- }
- foreach (keys %adj) {
- $adj{$_}->upper(get_scale_max($_));
- $adj{$_}->set_value($theme{conf}{$_});
- }
+sub update_scales_for_resolution() {
+ $theme{conf}{$_} ||= get_scale_max($_) * $scale_settings{$_}[0] foreach keys %scale_settings;
+ $adj{$_}->upper(get_scale_max($_)) foreach keys %adj;
+}
+sub update_scale_values_from_conf() {
+ $adj{$_}{value} = $theme{conf}{$_} foreach keys %adj;
}
-
sub create_image_area() {
my $image_area = Gtk2::DrawingArea->new;
@@ -289,7 +285,7 @@ sub update_theme_from_rect() {
} else { #- verbose or console
@{$theme{conf}}{'tx', 'ty', 'tw', 'th'} = bootsplash::rectangle2xywh($current_rect);
}
- update_scale_values();
+ update_scale_values_from_conf();
$image_area->queue_draw;
}