Also hide the full screen controls when the mouse is over them.
* We just wait a little longer in this case, like 4.5s. * Changed the code to only send the messages when needed, before they were being sent every 1.5s. * However, this is untested as of yet, as the layout changes didn't allow me to run the MediaPlayer on my system. Will do so in a minute on another one.
This commit is contained in:
parent
7dde214bc0
commit
7532547c06
|
@ -975,7 +975,8 @@ MainWin::MessageReceived(BMessage* msg)
|
||||||
if (fIsFullscreen) {
|
if (fIsFullscreen) {
|
||||||
BPoint videoViewWhere;
|
BPoint videoViewWhere;
|
||||||
if (msg->FindPoint("where", &videoViewWhere) == B_OK) {
|
if (msg->FindPoint("where", &videoViewWhere) == B_OK) {
|
||||||
if (!fControls->Frame().Contains(videoViewWhere)) {
|
if (msg->FindBool("force")
|
||||||
|
|| !fControls->Frame().Contains(videoViewWhere)) {
|
||||||
_ShowFullscreenControls(false);
|
_ShowFullscreenControls(false);
|
||||||
// hide the mouse cursor until the user moves it
|
// hide the mouse cursor until the user moves it
|
||||||
be_app->ObscureCursor();
|
be_app->ObscureCursor();
|
||||||
|
@ -2333,6 +2334,7 @@ MainWin::_ShowFullscreenControls(bool show, bool animate)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fShowsFullscreenControls = show;
|
fShowsFullscreenControls = show;
|
||||||
|
fVideoView->SetFullscreenControlsVisible(show);
|
||||||
|
|
||||||
if (show) {
|
if (show) {
|
||||||
fControls->RemoveSelf();
|
fControls->RemoveSelf();
|
||||||
|
@ -2341,6 +2343,7 @@ MainWin::_ShowFullscreenControls(bool show, bool animate)
|
||||||
fVideoView->AddChild(fControls);
|
fVideoView->AddChild(fControls);
|
||||||
if (fScaleFullscreenControls)
|
if (fScaleFullscreenControls)
|
||||||
fControls->SetSymbolScale(1.5f);
|
fControls->SetSymbolScale(1.5f);
|
||||||
|
|
||||||
while (fControls->IsHidden())
|
while (fControls->IsHidden())
|
||||||
fControls->Show();
|
fControls->Show();
|
||||||
}
|
}
|
||||||
|
@ -2364,18 +2367,17 @@ MainWin::_ShowFullscreenControls(bool show, bool animate)
|
||||||
finalMessage.AddFloat("offset", originalY + moveDist);
|
finalMessage.AddFloat("offset", originalY + moveDist);
|
||||||
finalMessage.AddBool("show", show);
|
finalMessage.AddBool("show", show);
|
||||||
PostMessage(&finalMessage, this);
|
PostMessage(&finalMessage, this);
|
||||||
} else {
|
} else if (!show) {
|
||||||
if (!show) {
|
|
||||||
fControls->RemoveSelf();
|
fControls->RemoveSelf();
|
||||||
fControls->MoveTo(fVideoView->Frame().left,
|
fControls->MoveTo(fVideoView->Frame().left,
|
||||||
fVideoView->Frame().bottom + 1);
|
fVideoView->Frame().bottom + 1);
|
||||||
fBackground->AddChild(fControls);
|
fBackground->AddChild(fControls);
|
||||||
fControls->SetSymbolScale(1.0f);
|
fControls->SetSymbolScale(1.0f);
|
||||||
|
|
||||||
while (!fControls->IsHidden())
|
while (!fControls->IsHidden())
|
||||||
fControls->Hide();
|
fControls->Hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
|
@ -31,6 +31,8 @@ VideoView::VideoView(BRect frame, const char* name, uint32 resizeMask)
|
||||||
fOverlayMode(false),
|
fOverlayMode(false),
|
||||||
fIsPlaying(false),
|
fIsPlaying(false),
|
||||||
fIsFullscreen(false),
|
fIsFullscreen(false),
|
||||||
|
fFullscreenControlsVisible(false),
|
||||||
|
fSendHideCounter(0),
|
||||||
fLastMouseMove(system_time()),
|
fLastMouseMove(system_time()),
|
||||||
|
|
||||||
fSubtitleBitmap(new SubtitleBitmap),
|
fSubtitleBitmap(new SubtitleBitmap),
|
||||||
|
@ -127,9 +129,17 @@ VideoView::Pulse()
|
||||||
uint32 buttons;
|
uint32 buttons;
|
||||||
GetMouse(&where, &buttons, false);
|
GetMouse(&where, &buttons, false);
|
||||||
if (buttons == 0) {
|
if (buttons == 0) {
|
||||||
|
if (fFullscreenControlsVisible) {
|
||||||
|
if (fSendHideCounter == 0 || fSendHideCounter == 3) {
|
||||||
|
// Send after 1.5s and after 4.5s
|
||||||
BMessage message(M_HIDE_FULL_SCREEN_CONTROLS);
|
BMessage message(M_HIDE_FULL_SCREEN_CONTROLS);
|
||||||
message.AddPoint("where", where);
|
message.AddPoint("where", where);
|
||||||
|
if (fSendHideCounter > 0)
|
||||||
|
message.AddBool("force", true);
|
||||||
Window()->PostMessage(&message, Window());
|
Window()->PostMessage(&message, Window());
|
||||||
|
}
|
||||||
|
fSendHideCounter++;
|
||||||
|
}
|
||||||
|
|
||||||
ConvertToScreen(&where);
|
ConvertToScreen(&where);
|
||||||
set_mouse_position((int32)where.x, (int32)where.y);
|
set_mouse_position((int32)where.x, (int32)where.y);
|
||||||
|
@ -292,6 +302,15 @@ void
|
||||||
VideoView::SetFullscreen(bool fullScreen)
|
VideoView::SetFullscreen(bool fullScreen)
|
||||||
{
|
{
|
||||||
fIsFullscreen = fullScreen;
|
fIsFullscreen = fullScreen;
|
||||||
|
fSendHideCounter = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void
|
||||||
|
VideoView::SetFullscreenControlsVisible(bool visible)
|
||||||
|
{
|
||||||
|
fFullscreenControlsVisible = visible;
|
||||||
|
fSendHideCounter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@ public:
|
||||||
|
|
||||||
void SetPlaying(bool playing);
|
void SetPlaying(bool playing);
|
||||||
void SetFullscreen(bool fullScreen);
|
void SetFullscreen(bool fullScreen);
|
||||||
|
void SetFullscreenControlsVisible(bool visible);
|
||||||
void SetVideoFrame(const BRect& frame);
|
void SetVideoFrame(const BRect& frame);
|
||||||
|
|
||||||
void SetSubTitle(const char* text);
|
void SetSubTitle(const char* text);
|
||||||
|
@ -68,6 +69,8 @@ private:
|
||||||
rgb_color fOverlayKeyColor;
|
rgb_color fOverlayKeyColor;
|
||||||
bool fIsPlaying;
|
bool fIsPlaying;
|
||||||
bool fIsFullscreen;
|
bool fIsFullscreen;
|
||||||
|
bool fFullscreenControlsVisible;
|
||||||
|
uint8 fSendHideCounter;
|
||||||
bigtime_t fLastMouseMove;
|
bigtime_t fLastMouseMove;
|
||||||
|
|
||||||
SubtitleBitmap* fSubtitleBitmap;
|
SubtitleBitmap* fSubtitleBitmap;
|
||||||
|
|
Loading…
Reference in New Issue