* The Deskbar will now intercept control+alt-clicks, and will start to move the

Deskbar around as other windows do (more or less), as suggested in ticket
  #6029.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36889 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2010-05-21 21:50:26 +00:00
parent 0dd68c866c
commit ca9acc20e8
3 changed files with 27 additions and 16 deletions
+4 -2
View File
@@ -118,7 +118,7 @@ class TBarView : public BView {
int32 CountItems(DeskbarShelf shelf);
status_t AddItem(BMessage* , DeskbarShelf shelf, int32* id);
status_t AddItem(BMessage* archive, DeskbarShelf shelf, int32* id);
void RemoveItem(int32 id);
void RemoveItem(const char* name, DeskbarShelf shelf);
@@ -134,10 +134,12 @@ class TBarView : public BView {
TExpandoMenuBar* ExpandoMenuBar() const;
TBarMenuBar* BarMenuBar() const;
TDragRegion* DragRegion() const { return fDragRegion; }
private:
friend class TBeMenu;
friend class PreferencesWindow;
private:
status_t SendDragMessage(const char* signature, entry_ref* ref = NULL);
void PlaceBeMenu();
+12 -3
View File
@@ -101,9 +101,18 @@ TBarWindow::DispatchMessage(BMessage* message, BHandler* handler)
{
// Activate the window when you click on it (ie. on the tray area,
// the menu part will do this automatically)
if (message->what == B_MOUSE_DOWN
&& !((TBarApp*)be_app)->Settings()->autoRaise)
Activate(true);
if (message->what == B_MOUSE_DOWN) {
if (!((TBarApp*)be_app)->Settings()->autoRaise)
Activate(true);
if ((modifiers() & (B_CONTROL_KEY | B_COMMAND_KEY))
== B_CONTROL_KEY | B_COMMAND_KEY) {
// The window key was pressed - enter dragging code
fBarView->DragRegion()->MouseDown(
fBarView->DragRegion()->DragRegion().LeftTop());
return;
}
}
BWindow::DispatchMessage(message, handler);
}
+11 -11
View File
@@ -1419,16 +1419,16 @@ TReplicantTray::SetMultiRow(bool state)
// #pragma mark -
/** draggable region that is asynchronous so that
* dragging does not block other activities
*/
/*! Draggable region that is asynchronous so that dragging does not block
other activities.
*/
TDragRegion::TDragRegion(TBarView* parent, BView* child)
: BControl(BRect(0, 0, 0, 0), "", "", NULL, B_FOLLOW_NONE,
B_WILL_DRAW | B_FRAME_EVENTS),
fBarView(parent),
fChild(child),
fDragLocation(kAutoPlaceDragRegion)
:
BControl(BRect(0, 0, 0, 0), "", "", NULL, B_FOLLOW_NONE,
B_WILL_DRAW | B_FRAME_EVENTS),
fBarView(parent),
fChild(child),
fDragLocation(kAutoPlaceDragRegion)
{
}
@@ -1464,8 +1464,8 @@ TDragRegion::GetPreferredSize(float* width, float* height)
void
TDragRegion::FrameMoved(BPoint)
{
if (fBarView->Left() && fBarView->Vertical() && fDragLocation
!= kNoDragRegion)
if (fBarView->Left() && fBarView->Vertical()
&& fDragLocation != kNoDragRegion)
fChild->MoveTo(5, 2);
else
fChild->MoveTo(2, 2);