Starting to apply style cleanup patches by John Scipione from bug 7052.
This will force me to practice our code style. (As a sidenote, we are aware of the no of patches in the bug). git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40744 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -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
|
used in advertising or otherwise to promote the sale, use or other dealings in
|
||||||
this Software without prior written authorization from Be Incorporated.
|
this Software without prior written authorization from Be Incorporated.
|
||||||
|
|
||||||
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
|
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
|
||||||
of Be Incorporated in the United States and other countries. Other brand product
|
trademarks of Be Incorporated in the United States and other countries. Other
|
||||||
names are registered trademarks or trademarks of their respective holders.
|
brand product names are registered trademarks or trademarks of their respective
|
||||||
|
holders.
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@@ -118,8 +119,8 @@ TExpandoMenuBar::AttachedToWindow()
|
|||||||
R_BeLogoIcon);
|
R_BeLogoIcon);
|
||||||
if (logoBitmap != NULL)
|
if (logoBitmap != NULL)
|
||||||
fBeMenuWidth = logoBitmap->Bounds().Width() + 16;
|
fBeMenuWidth = logoBitmap->Bounds().Width() + 16;
|
||||||
fBeMenuItem = new TBarMenuTitle(fBeMenuWidth, Frame().Height(),
|
fBeMenuItem = new TBarMenuTitle(fBeMenuWidth, Frame().Height(),
|
||||||
logoBitmap, beMenu, true);
|
logoBitmap, beMenu, true);
|
||||||
AddItem(fBeMenuItem);
|
AddItem(fBeMenuItem);
|
||||||
|
|
||||||
fSeparatorItem = new TTeamMenuItem(kSepItemWidth, height, fVertical);
|
fSeparatorItem = new TTeamMenuItem(kSepItemWidth, height, fVertical);
|
||||||
@@ -584,10 +585,10 @@ TExpandoMenuBar::RemoveTeam(team_id team, bool partial)
|
|||||||
RemoveItem(i);
|
RemoveItem(i);
|
||||||
|
|
||||||
if (fVertical) {
|
if (fVertical) {
|
||||||
// instead of resizing the window here and there in the
|
// instead of resizing the window here and there in the
|
||||||
// code the resize method will be centered in one place
|
// code the resize method will be centered in one place
|
||||||
// thus, the same behavior (good or bad) will be used
|
// thus, the same behavior (good or bad) will be used
|
||||||
// whereever window sizing is done
|
// whereever window sizing is done
|
||||||
fBarView->SizeWindow(BScreen(Window()).Frame());
|
fBarView->SizeWindow(BScreen(Window()).Frame());
|
||||||
} else
|
} else
|
||||||
CheckItemSizes(-1);
|
CheckItemSizes(-1);
|
||||||
@@ -613,8 +614,8 @@ TExpandoMenuBar::CheckItemSizes(int32 delta)
|
|||||||
|
|
||||||
if (!fBarView->Vertical()) {
|
if (!fBarView->Vertical()) {
|
||||||
// in this case there are 2 extra items:
|
// in this case there are 2 extra items:
|
||||||
// The Be Menu
|
// - The Be Menu
|
||||||
// The little separator item
|
// - The little separator item
|
||||||
fullWidth = fullWidth - (sMinimumWindowWidth * 2)
|
fullWidth = fullWidth - (sMinimumWindowWidth * 2)
|
||||||
+ (fBeMenuWidth + kSepItemWidth);
|
+ (fBeMenuWidth + kSepItemWidth);
|
||||||
width -= (fBeMenuWidth + kSepItemWidth);
|
width -= (fBeMenuWidth + kSepItemWidth);
|
||||||
@@ -624,11 +625,11 @@ TExpandoMenuBar::CheckItemSizes(int32 delta)
|
|||||||
if (delta >= 0 && fullWidth > width) {
|
if (delta >= 0 && fullWidth > width) {
|
||||||
fOverflow = true;
|
fOverflow = true;
|
||||||
reset = true;
|
reset = true;
|
||||||
newWidth = floorf(width/count);
|
newWidth = floorf(width / count);
|
||||||
} else if (delta < 0 && fOverflow) {
|
} else if (delta < 0 && fOverflow) {
|
||||||
reset = true;
|
reset = true;
|
||||||
if (fullWidth > width)
|
if (fullWidth > width)
|
||||||
newWidth = floorf(width/count);
|
newWidth = floorf(width / count);
|
||||||
else
|
else
|
||||||
newWidth = sMinimumWindowWidth;
|
newWidth = sMinimumWindowWidth;
|
||||||
}
|
}
|
||||||
@@ -713,10 +714,9 @@ void
|
|||||||
TExpandoMenuBar::CheckForSizeOverrun()
|
TExpandoMenuBar::CheckForSizeOverrun()
|
||||||
{
|
{
|
||||||
BRect screenFrame = (BScreen(Window())).Frame();
|
BRect screenFrame = (BScreen(Window())).Frame();
|
||||||
if (fVertical)
|
|
||||||
fIsScrolling = Window()->Frame().bottom > screenFrame.bottom;
|
fIsScrolling = fVertical ? Window()->Frame().bottom > screenFrame.bottom
|
||||||
else
|
: false;
|
||||||
fIsScrolling = false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -744,7 +744,7 @@ TExpandoMenuBar::monitor_team_windows(void* arg)
|
|||||||
// Set all WindowMenuItems to require an update.
|
// Set all WindowMenuItems to require an update.
|
||||||
TWindowMenuItem* item = NULL;
|
TWindowMenuItem* item = NULL;
|
||||||
for (int32 i = 0; i < totalItems; i++) {
|
for (int32 i = 0; i < totalItems; i++) {
|
||||||
if (!teamMenu->SubmenuAt(i)){
|
if (!teamMenu->SubmenuAt(i)) {
|
||||||
item = static_cast<TWindowMenuItem*>(teamMenu->ItemAt(i));
|
item = static_cast<TWindowMenuItem*>(teamMenu->ItemAt(i));
|
||||||
item->SetRequireUpdate();
|
item->SetRequireUpdate();
|
||||||
}
|
}
|
||||||
@@ -814,7 +814,7 @@ TExpandoMenuBar::monitor_team_windows(void* arg)
|
|||||||
|
|
||||||
// Remove any remaining items which require an update.
|
// Remove any remaining items which require an update.
|
||||||
for (int32 i = 0; i < totalItems; i++) {
|
for (int32 i = 0; i < totalItems; i++) {
|
||||||
if (!teamMenu->SubmenuAt(i)){
|
if (!teamMenu->SubmenuAt(i)) {
|
||||||
item = static_cast<TWindowMenuItem*>(teamMenu->ItemAt(i));
|
item = static_cast<TWindowMenuItem*>(teamMenu->ItemAt(i));
|
||||||
if (item && item->RequiresUpdate()) {
|
if (item && item->RequiresUpdate()) {
|
||||||
item = static_cast<TWindowMenuItem*>
|
item = static_cast<TWindowMenuItem*>
|
||||||
|
|||||||
@@ -26,17 +26,18 @@ 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
|
used in advertising or otherwise to promote the sale, use or other dealings in
|
||||||
this Software without prior written authorization from Be Incorporated.
|
this Software without prior written authorization from Be Incorporated.
|
||||||
|
|
||||||
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
|
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
|
||||||
of Be Incorporated in the United States and other countries. Other brand product
|
trademarks of Be Incorporated in the United States and other countries. Other
|
||||||
names are registered trademarks or trademarks of their respective holders.
|
brand product names are registered trademarks or trademarks of their respective
|
||||||
|
holders.
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
*/
|
*/
|
||||||
#ifndef EXPANDO_MENU_BAR_H
|
#ifndef EXPANDO_MENU_BAR_H
|
||||||
#define EXPANDO_MENU_BAR_H
|
#define EXPANDO_MENU_BAR_H
|
||||||
|
|
||||||
// application list
|
// application list
|
||||||
// top level at window
|
// top level at window
|
||||||
// in expanded mode horizontal and vertical
|
// in expanded mode horizontal and vertical
|
||||||
|
|
||||||
|
|
||||||
#include <MenuBar.h>
|
#include <MenuBar.h>
|
||||||
|
|||||||
@@ -25,7 +25,8 @@ 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
|
used in advertising or otherwise to promote the sale, use or other dealings in
|
||||||
this Software without prior written authorization from Be Incorporated.
|
this Software without prior written authorization from Be Incorporated.
|
||||||
|
|
||||||
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered trademarks
|
Tracker(TM), Be(R), BeOS(R), and BeIA(TM) are trademarks or registered
|
||||||
of Be Incorporated in the United States and other countries. Other brand product
|
trademarks of Be Incorporated in the United States and other countries. Other
|
||||||
names are registered trademarks or trademarks of their respective holders.
|
brand product names are registered trademarks or trademarks of their respective
|
||||||
|
holders.
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|||||||
Reference in New Issue
Block a user