summaryrefslogtreecommitdiffstats
path: root/lib/Xconfig/resolution_and_depth.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-12-08 09:59:02 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-12-08 09:59:02 +0000
commit065a9d8b6082a756e4b3697ffe99d3eb13f149b8 (patch)
tree4e6050eddd18be9e6bf1b7ea7774868d2c1b67ca /lib/Xconfig/resolution_and_depth.pm
parent85747bfdd9418740058545902e2bd5fda5f81ea7 (diff)
downloaddrakx-kbd-mouse-x11-065a9d8b6082a756e4b3697ffe99d3eb13f149b8.tar
drakx-kbd-mouse-x11-065a9d8b6082a756e4b3697ffe99d3eb13f149b8.tar.gz
drakx-kbd-mouse-x11-065a9d8b6082a756e4b3697ffe99d3eb13f149b8.tar.bz2
drakx-kbd-mouse-x11-065a9d8b6082a756e4b3697ffe99d3eb13f149b8.tar.xz
drakx-kbd-mouse-x11-065a9d8b6082a756e4b3697ffe99d3eb13f149b8.zip
- XFdrake
o there is no reason "automatic" resolution should imply "automatic" color depth
Diffstat (limited to 'lib/Xconfig/resolution_and_depth.pm')
-rw-r--r--lib/Xconfig/resolution_and_depth.pm14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/Xconfig/resolution_and_depth.pm b/lib/Xconfig/resolution_and_depth.pm
index 09bc74b..6e4e0f0 100644
--- a/lib/Xconfig/resolution_and_depth.pm
+++ b/lib/Xconfig/resolution_and_depth.pm
@@ -71,8 +71,9 @@ sub to_string {
my ($resolution) = @_;
$resolution or return '';
- $resolution->{automatic} ? N("Automatic") :
- $resolution->{X} ? sprintf("%sx%s %dbpp", @$resolution{'X', 'Y', 'Depth'}) : 'frame-buffer';
+ $resolution->{automatic}
+ ? N("Automatic") . ($resolution->{Depth} ? sprintf(" (%dbpp)", $resolution->{Depth}) : '')
+ : $resolution->{X} ? sprintf("%sx%s %dbpp", @$resolution{'X', 'Y', 'Depth'}) : 'frame-buffer';
}
sub allowed {
@@ -127,11 +128,13 @@ sub filter_using_HorizSync_VertRefresh {
sub choose {
my ($in, $default_resolution, @resolutions) = @_;
+ my @Depths = uniq(reverse map { $_->{Depth} } @resolutions);
my $resolution = $default_resolution || {};
$in->ask_from(N("Resolutions"), "",
[ {
val => \$resolution, type => 'list', sort => 0,
- list => [ (sort { $a->{X} <=> $b->{X} } @resolutions), { automatic => 1 } ],
+ list => [ (sort { $a->{X} <=> $b->{X} } @resolutions),
+ (map { { automatic => 1, Depth => $_ } } @Depths) ],
format => \&to_string,
} ]) or return;
$resolution;
@@ -153,7 +156,7 @@ sub choices {
$_->{ratio} ||= Xconfig::xfree::resolution2ratio($_) foreach @resolutions;
if ($resolution_wanted->{automatic} || !$resolution_wanted->{X} && !$monitors->[0]{HorizSync}) {
- return { automatic => 1 }, @resolutions;
+ return { automatic => 1, Depth => $resolution_wanted->{Depth} }, @resolutions;
}
if ($resolution_wanted->{X} && !$resolution_wanted->{Y}) {
@@ -420,8 +423,6 @@ sub choose_gtk {
format => sub { $_[0]{text} ? translate($_[0]{text}) : &$res2text },
list_ref => \$proposed_resolutions,
changed => sub {
- $pix_colors->set_sensitive(!$chosen_res->{automatic});
- $depth_combo->set_sensitive(!$chosen_res->{automatic});
if ($chosen_res->{text} eq 'Other') {
undef $chosen_ratio;
$set_proposed_resolutions->($previous_res);
@@ -464,6 +465,7 @@ sub choose_gtk {
$W->main or return;
if ($chosen_res->{automatic}) {
+ $chosen_res->{Depth} = $chosen_Depth;
$chosen_res;
} else {
find { $_->{X} == $chosen_res->{X} &&