From 25fcb499b439f335a325e0ec3055d312adcf20f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20A=C3=9Fmus?= Date: Thu, 19 Nov 2009 10:07:25 +0000 Subject: [PATCH] Since the window now starts hidden for a brief moment, calling IsHidden() on the views in the FrameResized() hook which does the layout had some unanticipated results. We need to know relative to the views themselves. This fixes the video view being visible despite audio-only content. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34129 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/apps/mediaplayer/MainWin.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/apps/mediaplayer/MainWin.cpp b/src/apps/mediaplayer/MainWin.cpp index 88be077535..6f5024efb9 100644 --- a/src/apps/mediaplayer/MainWin.cpp +++ b/src/apps/mediaplayer/MainWin.cpp @@ -157,7 +157,7 @@ MainWin::MainWin(bool isFirstWindow) // background fBackground = new BView(rect, "background", B_FOLLOW_ALL, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE); - fBackground->SetViewColor(0,0,0); + fBackground->SetViewColor(0, 0, 0); AddChild(fBackground); // menu @@ -184,10 +184,6 @@ MainWin::MainWin(bool isFirstWindow) fControlsHeight = (int)fControls->Frame().Height() + 1; fControlsWidth = (int)fControls->Frame().Width() + 1; fControls->SetResizingMode(B_FOLLOW_BOTTOM | B_FOLLOW_LEFT_RIGHT); -// fControls->MoveTo(0, fBackground->Bounds().bottom - fControlsHeight + 1); - -// fVideoView->ResizeTo(fBackground->Bounds().Width(), -// fBackground->Bounds().Height() - fMenuBarHeight - fControlsHeight); fPlaylist->AddListener(fPlaylistObserver); fController->SetVideoView(fVideoView); @@ -196,10 +192,6 @@ MainWin::MainWin(bool isFirstWindow) peakView->SetPeakNotificationWhat(MSG_PEAK_NOTIFICATION); fController->SetPeakListener(peakView); -// printf("fMenuBarHeight %d\n", fMenuBarHeight); -// printf("fControlsHeight %d\n", fControlsHeight); -// printf("fControlsWidth %d\n", fControlsWidth); - _SetupWindow(); // setup the playlist window now, we need to have it @@ -286,33 +278,33 @@ MainWin::FrameResized(float newWidth, float newHeight) int y = 0; if (noMenu) { - if (!fMenuBar->IsHidden()) + if (!fMenuBar->IsHidden(fMenuBar)) fMenuBar->Hide(); } else { fMenuBar->MoveTo(0, y); fMenuBar->ResizeTo(newWidth, fMenuBarHeight - 1); - if (fMenuBar->IsHidden()) + if (fMenuBar->IsHidden(fMenuBar)) fMenuBar->Show(); y += fMenuBarHeight; } if (maxVideoHeight == 0) { - if (!fVideoView->IsHidden()) + if (!fVideoView->IsHidden(fVideoView)) fVideoView->Hide(); } else { _ResizeVideoView(0, y, maxVideoWidth, maxVideoHeight); - if (fVideoView->IsHidden()) + if (fVideoView->IsHidden(fVideoView)) fVideoView->Show(); y += maxVideoHeight; } if (noControls) { - if (!fControls->IsHidden()) + if (!fControls->IsHidden(fControls)) fControls->Hide(); } else { fControls->MoveTo(0, y); fControls->ResizeTo(newWidth, fControlsHeight - 1); - if (fControls->IsHidden()) + if (fControls->IsHidden(fControls)) fControls->Show(); // y += fControlsHeight; }