Patches from John Scipione as part of bug 7052.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40815 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Fredrik Holmqvist
2011-03-05 15:52:49 +00:00
parent 62a78b3566
commit 4ec67d2b37
6 changed files with 87 additions and 79 deletions
+10 -8
View File
@@ -26,9 +26,10 @@ Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
of Be Incorporated in the United States and other countries. Other brand product
names are registered trademarks or trademarks of their respective holders.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
trademarks of Be Incorporated in the United States and other countries. Other
brand product names are registered trademarks or trademarks of their respective
holders.
All rights reserved.
*/
@@ -179,9 +180,10 @@ init_tracking_hook(BMenuItem* item, bool (*hookFunction)(BMenu*, void*),
return;
BMenu* windowMenu = item->Submenu();
if (windowMenu)
// have a menu, set the tracking hook
if (windowMenu) {
// have a menu, set the tracking hook
windowMenu->SetTrackingHook(hookFunction, state);
}
}
@@ -192,9 +194,9 @@ TBarMenuBar::InitTrackingHook(bool (*hookFunction)(BMenu*, void*),
BPoint loc;
uint32 buttons;
GetMouse(&loc, &buttons);
// set the hook functions for the two menus
// will always have the be menu
// may have the app menu as well (mini mode)
// set the hook functions for the two menus
// will always have the be menu
// may have the app menu as well (mini mode)
if (fBeMenuItem->Frame().Contains(loc) || both)
init_tracking_hook(fBeMenuItem, hookFunction, state);
+7 -6
View File
@@ -26,15 +26,16 @@ Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
of Be Incorporated in the United States and other countries. Other brand product
names are registered trademarks or trademarks of their respective holders.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
trademarks of Be Incorporated in the United States and other countries. Other
brand product names are registered trademarks or trademarks of their respective
holders.
All rights reserved.
*/
// Be Menu, used in vertical mode, expanded and mini
// in mini mode will have team menu next to Be menu
// Be menu in horizontal mode is embedded in ExpandoMenuBar
// Be Menu, used in vertical mode, expanded and mini
// - in mini mode will have team menu next to Be menu
// - Be menu in horizontal mode is embedded in ExpandoMenuBar
#ifndef BARMENUBAR_H
#define BARMENUBAR_H
+4 -3
View File
@@ -26,9 +26,10 @@ Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
of Be Incorporated in the United States and other countries. Other brand product
names are registered trademarks or trademarks of their respective holders.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
trademarks of Be Incorporated in the United States and other countries. Other
brand product names are registered trademarks or trademarks of their respective
holders.
All rights reserved.
*/
+6 -5
View File
@@ -26,9 +26,10 @@ Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
of Be Incorporated in the United States and other countries. Other brand product
names are registered trademarks or trademarks of their respective holders.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
trademarks of Be Incorporated in the United States and other countries. Other
brand product names are registered trademarks or trademarks of their respective
holders.
All rights reserved.
*/
@@ -46,8 +47,8 @@ class BMenu;
class TBarMenuTitle : public BMenuItem {
public:
TBarMenuTitle(float width,float height, const BBitmap* icon,
BMenu* menu, bool inexpando = false);
TBarMenuTitle(float width, float height, const BBitmap* icon,
BMenu* menu, bool inexpando = false);
virtual ~TBarMenuTitle();
void SetWidthHeight(float width, float height);
+18 -16
View File
@@ -26,9 +26,10 @@ Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
of Be Incorporated in the United States and other countries. Other brand product
names are registered trademarks or trademarks of their respective holders.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
trademarks of Be Incorporated in the United States and other countries. Other
brand product names are registered trademarks or trademarks of their respective
holders.
All rights reserved.
*/
@@ -206,9 +207,9 @@ TBarView::PlaceBeMenu()
fBarMenuBar = NULL;
}
// top or bottom expando mode has Be menu built in for tracking
// only for vertical mini or expanded
// mini mode will have team menu added as part of BarMenuBar
// top or bottom expando mode has Be menu built in for tracking
// only for vertical mini or expanded
// mini mode will have team menu added as part of BarMenuBar
if (fVertical && !fBarMenuBar) {
// create the Be menu
BRect mbarFrame(Bounds());
@@ -217,8 +218,8 @@ TBarView::PlaceBeMenu()
AddChild(fBarMenuBar);
}
// if there isn't a bemenu at this point,
// DB should be in top/bottom mode, else error
// if there isn't a bemenu at this point,
// DB should be in top/bottom mode, else error
if (!fBarMenuBar)
return;
@@ -237,9 +238,10 @@ TBarView::PlaceBeMenu()
else
width = floorf(width) / 2;
loc = Bounds().LeftTop();
} else
} else {
// mini mode, BeMenu next to team menu
fBarMenuBar->AddTeamMenu();
}
fBarMenuBar->SmartResize(width, menuFrame.Height());
fBarMenuBar->MoveTo(loc);
@@ -406,8 +408,8 @@ TBarView::SaveSettings()
settings->showTime = ShowingClock();
fReplicantTray->RememberClockSettings();
settings->alwaysOnTop = (Window()->Feel() & B_FLOATING_ALL_WINDOW_FEEL)
!= 0;
settings->alwaysOnTop
= (Window()->Feel() & B_FLOATING_ALL_WINDOW_FEEL) != 0;
}
@@ -469,10 +471,10 @@ TBarView::ChangeState(int32 state, bool vertical, bool left, bool top)
}
}
PlaceApplicationBar(screenFrame);
SizeWindow(screenFrame);
PositionWindow(screenFrame);
Window()->UpdateIfNeeded();
PlaceApplicationBar(screenFrame);
SizeWindow(screenFrame);
PositionWindow(screenFrame);
Window()->UpdateIfNeeded();
// Re-expand those apps.
if (expandedItems.CountItems() > 0) {
@@ -505,7 +507,7 @@ TBarView::ChangeState(int32 state, bool vertical, bool left, bool top)
}
// window placement functions
// window placement functions
bool
TBarView::Vertical() const
+5 -4
View File
@@ -26,9 +26,10 @@ Except as contained in this notice, the name of Be Incorporated shall not be
used in advertising or otherwise to promote the sale, use or other dealings in
this Software without prior written authorization from Be Incorporated.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
of Be Incorporated in the United States and other countries. Other brand product
names are registered trademarks or trademarks of their respective holders.
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
trademarks of Be Incorporated in the United States and other countries. Other
brand product names are registered trademarks or trademarks of their respective
holders.
All rights reserved.
*/
@@ -98,7 +99,7 @@ class TBarView : public BView {
void CacheDragData(const BMessage* incoming);
status_t DragStart();
static bool MenuTrackingHook(BMenu* menu, void* castToThis);
void DragStop(bool full=false);
void DragStop(bool full = false);
TrackingHookData* GetTrackingHookData();
bool Dragging() const;
const BMessage* DragMessage() const;