* 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:
parent
249efd04b3
commit
8f30149c06
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -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();
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user