Added cases for Minimize buttons in decorators
Buttons on up-to-date decorators now work properly git-svn-id: file:///srv/svn/repos/haiku/trunk/current@7957 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -379,6 +379,10 @@ bool ServerWindow::IsHidden(void)
|
|||||||
|
|
||||||
void ServerWindow::Minimize(bool status)
|
void ServerWindow::Minimize(bool status)
|
||||||
{
|
{
|
||||||
|
// This function doesn't need much -- check to make sure that we should and
|
||||||
|
// send the message to the client. According to the BeBook, the BWindow hook function
|
||||||
|
// does all the heavy lifting for us. :)
|
||||||
|
|
||||||
bool sendMessages = false;
|
bool sendMessages = false;
|
||||||
|
|
||||||
if (status)
|
if (status)
|
||||||
@@ -400,14 +404,12 @@ void ServerWindow::Minimize(bool status)
|
|||||||
|
|
||||||
if (sendMessages)
|
if (sendMessages)
|
||||||
{
|
{
|
||||||
BMessage msg;
|
BMessage msg;
|
||||||
msg.what = B_MINIMIZE;
|
msg.what = B_MINIMIZE;
|
||||||
msg.AddInt64("when", real_time_clock_usecs());
|
msg.AddInt64("when", real_time_clock_usecs());
|
||||||
msg.AddBool("minimize", status);
|
msg.AddBool("minimize", status);
|
||||||
|
|
||||||
SendMessageToClient(&msg);
|
SendMessageToClient(&msg);
|
||||||
|
|
||||||
// TODO: Do we need to notify Tracker? The Deskbar? If so, how?
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2248,6 +2250,17 @@ int32 ServerWindow::MonitorWin(void *data)
|
|||||||
delete win;
|
delete win;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
// TODO: This message is never received.... why?
|
||||||
|
/* case AS_QUIT_APP:
|
||||||
|
{
|
||||||
|
// We receive this _only_ when the server is shutting down. The app_server
|
||||||
|
// is not asking the app to quit - it's *telling* it to quit because
|
||||||
|
// in just a short time, the server itself is going to disappear.
|
||||||
|
|
||||||
|
BMessage msg(_QUIT_);
|
||||||
|
win->SendMessageToClient(&msg);
|
||||||
|
}
|
||||||
|
*/
|
||||||
case B_QUIT_REQUESTED:
|
case B_QUIT_REQUESTED:
|
||||||
{
|
{
|
||||||
STRACE(("ServerWindow %s received Quit request\n",win->Title()));
|
STRACE(("ServerWindow %s received Quit request\n",win->Title()));
|
||||||
|
|||||||
@@ -222,6 +222,14 @@ void WinBorder::MouseDown(PortMessage *msg)
|
|||||||
STRACE_CLICK(("===> DEC_ZOOM\n"));
|
STRACE_CLICK(("===> DEC_ZOOM\n"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case DEC_MINIMIZE:
|
||||||
|
{
|
||||||
|
fIsMinimizing = true;
|
||||||
|
fDecorator->SetMinimize(true);
|
||||||
|
fDecorator->DrawMinimize();
|
||||||
|
STRACE_CLICK(("===> DEC_MINIMIZE\n"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
case DEC_RESIZE:
|
case DEC_RESIZE:
|
||||||
{
|
{
|
||||||
fIsResizing = true;
|
fIsResizing = true;
|
||||||
@@ -342,6 +350,7 @@ void WinBorder::MouseUp(PortMessage *msg)
|
|||||||
fIsZooming = false;
|
fIsZooming = false;
|
||||||
fDecorator->SetZoom(false);
|
fDecorator->SetZoom(false);
|
||||||
fDecorator->DrawZoom();
|
fDecorator->DrawZoom();
|
||||||
|
Window()->Zoom();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (fIsClosing)
|
if (fIsClosing)
|
||||||
@@ -349,6 +358,7 @@ void WinBorder::MouseUp(PortMessage *msg)
|
|||||||
fIsClosing = false;
|
fIsClosing = false;
|
||||||
fDecorator->SetClose(false);
|
fDecorator->SetClose(false);
|
||||||
fDecorator->DrawClose();
|
fDecorator->DrawClose();
|
||||||
|
Window()->Quit();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if(fIsMinimizing)
|
if(fIsMinimizing)
|
||||||
@@ -356,6 +366,7 @@ void WinBorder::MouseUp(PortMessage *msg)
|
|||||||
fIsMinimizing = false;
|
fIsMinimizing = false;
|
||||||
fDecorator->SetMinimize(false);
|
fDecorator->SetMinimize(false);
|
||||||
fDecorator->DrawMinimize();
|
fDecorator->DrawMinimize();
|
||||||
|
Window()->Minimize(true);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user