Improve dragger hiding, replicant sizing
This commit is contained in:
parent
a6877e0385
commit
a0897d1401
|
@ -31,13 +31,13 @@ MainWindow::_InitInterface()
|
|||
|
||||
BView* controlsView = new BView("Controls", B_WILL_DRAW);
|
||||
BLayoutBuilder::Group<>(controlsView, B_VERTICAL)
|
||||
.Add(new VolumeView(BRect(BPoint(0,0), BSize(200.0, 20.0))))
|
||||
.Add(new VolumeView(BRect(BPoint(0,0), BSize(100.0, 20.0))))
|
||||
.AddGlue()
|
||||
.End();
|
||||
|
||||
BTabView* tabView = new BTabView("appletTabView");
|
||||
tabView->AddTab(new LyricsView(BRect(BPoint(0,0), BSize(300.0, 200.0))));
|
||||
tabView->AddTab(new CoverView(BRect(BPoint(0,0), BSize(300.0, 200.0))));
|
||||
tabView->AddTab(new LyricsView(BRect(BPoint(0,0), BSize(100.0, 100.0))));
|
||||
tabView->AddTab(new CoverView(BRect(BPoint(0,0), BSize(100.0, 100.0))));
|
||||
tabView->AddTab(controlsView);
|
||||
|
||||
BLayoutBuilder::Group<>(this, B_VERTICAL, 0.0f)
|
||||
|
|
|
@ -29,7 +29,7 @@ ReplicantView::ReplicantView(BRect frame, const char* name, uint32 draggerPlacem
|
|||
fDragger->SetViewColor(B_TRANSPARENT_COLOR);
|
||||
AddChild(fDragger);
|
||||
|
||||
fTransparentInactivity = true;
|
||||
fTransparentInactivity = false;
|
||||
fTransparentDragger = false;
|
||||
fInactive = true;
|
||||
|
||||
|
@ -110,6 +110,15 @@ ReplicantView::MouseDown(BPoint where)
|
|||
}
|
||||
|
||||
|
||||
void
|
||||
ReplicantView::Show()
|
||||
{
|
||||
BView::Show();
|
||||
if (!IsHidden())
|
||||
SetInactive(fInactive);
|
||||
}
|
||||
|
||||
|
||||
BPopUpMenu*
|
||||
ReplicantView::RightClickPopUp(BPopUpMenu* menu)
|
||||
{
|
||||
|
@ -140,10 +149,13 @@ ReplicantView::SetInactive(bool inactive)
|
|||
{
|
||||
fInactive = inactive;
|
||||
|
||||
if (IsHidden())
|
||||
return;
|
||||
|
||||
if (inactive && fTransparentInactivity)
|
||||
if (!fDragger->IsHidden() && fTransparentDragger)
|
||||
fDragger->Hide();
|
||||
if (fDragger->IsHidden() && (!fTransparentDragger || !fTransparentInactivity))
|
||||
if (fDragger->IsHidden() && (!inactive || !fTransparentDragger || !fTransparentInactivity))
|
||||
fDragger->Show();
|
||||
|
||||
Invalidate();
|
||||
|
|
|
@ -45,6 +45,8 @@ public:
|
|||
|
||||
virtual void MouseDown(BPoint where);
|
||||
|
||||
void Show();
|
||||
|
||||
// Populates the given menu with default items
|
||||
virtual BPopUpMenu* RightClickPopUp(BPopUpMenu* menu = NULL);
|
||||
|
||||
|
|
Ŝarĝante…
Reference in New Issue