Patch by Oliver Coursiere:
Center the TV window on start. Fixes ticket #3041. Thanks! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29363 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -132,6 +132,8 @@ MainWin::MainWin(BRect frame_rect)
|
|||||||
SetChannelMenuMarker();
|
SetChannelMenuMarker();
|
||||||
|
|
||||||
VideoFormatChange(fSourceWidth, fSourceHeight, fWidthScale, fHeightScale);
|
VideoFormatChange(fSourceWidth, fSourceHeight, fWidthScale, fHeightScale);
|
||||||
|
|
||||||
|
CenterWindow();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1175,3 +1177,25 @@ MainWin::MessageReceived(BMessage *msg)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
MainWin::CenterWindow()
|
||||||
|
{
|
||||||
|
BScreen screen(this);
|
||||||
|
if (!screen.IsValid())
|
||||||
|
return;
|
||||||
|
|
||||||
|
BRect frame = screen.Frame();
|
||||||
|
BRect windowFrame = Frame();
|
||||||
|
|
||||||
|
float left = floor((frame.Width() - windowFrame.Width()) / 2);
|
||||||
|
float top = floor((frame.Height() - windowFrame.Height()) / 2);
|
||||||
|
|
||||||
|
if (left < 20)
|
||||||
|
left = 20;
|
||||||
|
if (top < 20)
|
||||||
|
top = 20;
|
||||||
|
|
||||||
|
MoveTo(left, top);
|
||||||
|
}
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ public:
|
|||||||
void ToggleNoBorder();
|
void ToggleNoBorder();
|
||||||
void ToggleNoMenu();
|
void ToggleNoMenu();
|
||||||
void ToggleNoBorderNoMenu();
|
void ToggleNoBorderNoMenu();
|
||||||
|
void CenterWindow();
|
||||||
|
|
||||||
void ShowContextMenu(const BPoint &screen_point);
|
void ShowContextMenu(const BPoint &screen_point);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user