* Work-in-progress commit.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32023 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler 2009-07-31 15:16:11 +00:00
parent 249efd04b3
commit 8f30149c06
3 changed files with 28 additions and 1 deletions

View File

@ -322,6 +322,26 @@ ScreenMode::GetRefreshLimits(const screen_mode& mode, float& min, float& max)
} }
status_t
ScreenMode::GetMonitorInfo(monitor_info& info, float* _diagonalInches)
{
BScreen screen(fWindow);
status_t status = screen.GetMonitorInfo(&info);
if (status != B_OK)
return status;
if (_diagonalInches != NULL) {
*_diagonalInches = sqrt(info.width * info.width
+ info.height * info.height) / 2.54;
}
if (!strcmp(info.vendor, "LEN"))
strcpy(info.vendor, "Lenovo");
// TODO: replace more vendor strings with something readable
return B_OK;
}
screen_mode screen_mode
ScreenMode::ModeAt(int32 index) ScreenMode::ModeAt(int32 index)
{ {

View File

@ -49,7 +49,9 @@ class ScreenMode {
void UpdateOriginalModes(); void UpdateOriginalModes();
bool SupportsColorSpace(const screen_mode& mode, color_space space); bool SupportsColorSpace(const screen_mode& mode, color_space space);
status_t GetRefreshLimits(const screen_mode& mode, float& min, float& max); status_t GetRefreshLimits(const screen_mode& mode, float& min,
float& max);
status_t GetMonitorInfo(monitor_info& info, float* _diagonalInches);
screen_mode ModeAt(int32 index); screen_mode ModeAt(int32 index);
int32 CountModes(); int32 CountModes();

View File

@ -34,6 +34,11 @@ ScreenSettings::ScreenSettings()
file.Read(&fWindowFrame, sizeof(BRect)); file.Read(&fWindowFrame, sizeof(BRect));
// make sure the window is visible on screen // make sure the window is visible on screen
if (fWindowFrame.Width() > screenFrame.Width())
fWindowFrame.right = fWindowFrame.left + 450;
if (fWindowFrame.Height() > screenFrame.Height())
fWindowFrame.bottom = fWindowFrame.top + 250;
if (screenFrame.right >= fWindowFrame.left + 40 if (screenFrame.right >= fWindowFrame.left + 40
&& screenFrame.bottom >= fWindowFrame.top + 40 && screenFrame.bottom >= fWindowFrame.top + 40
&& screenFrame.left <= fWindowFrame.right - 40 && screenFrame.left <= fWindowFrame.right - 40