* Made the refresh slider/menu take the monitor's capabilities into account.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32048 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-08-01 01:46:53 +00:00
parent 6e58de0288
commit 70a2b1b51b

View File

@ -310,7 +310,16 @@ ScreenWindow::ScreenWindow(ScreenSettings* settings)
fRefreshMenu->AddItem(item = new BMenuItem(name.String(), message)); fRefreshMenu->AddItem(item = new BMenuItem(name.String(), message));
item->SetEnabled(false); item->SetEnabled(false);
} else { } else {
monitor_info info;
if (fScreenMode.GetMonitorInfo(info) == B_OK) {
min = max_c(info.min_vertical_frequency, min);
max = min_c(info.max_vertical_frequency, max);
}
for (int32 i = 0; i < kRefreshRateCount; ++i) { for (int32 i = 0; i < kRefreshRateCount; ++i) {
if (kRefreshRates[i] < min || kRefreshRates[i] > max)
continue;
BString name; BString name;
name << kRefreshRates[i] << " Hz"; name << kRefreshRates[i] << " Hz";
@ -880,8 +889,15 @@ ScreenWindow::MessageReceived(BMessage* message)
if (max > gMaxRefresh) if (max > gMaxRefresh)
max = gMaxRefresh; max = gMaxRefresh;
monitor_info info;
if (fScreenMode.GetMonitorInfo(info) == B_OK) {
min = max_c(info.min_vertical_frequency, min);
max = min_c(info.max_vertical_frequency, max);
}
RefreshWindow *fRefreshWindow = new RefreshWindow( RefreshWindow *fRefreshWindow = new RefreshWindow(
fRefreshField->ConvertToScreen(B_ORIGIN), fSelected.refresh, min, max); fRefreshField->ConvertToScreen(B_ORIGIN), fSelected.refresh,
min, max);
fRefreshWindow->Show(); fRefreshWindow->Show();
break; break;
} }