History log of /haiku/src/apps/deskbar/ExpandoMenuBar.h
Revision Date Author Comments
# 4f97a431 07-Apr-2023 John Scipione <jscipione@gmail.com>

Deskbar: Make Vulcan Death Grip work in mini-mode

Refactor so that ExpandoMenuBar and TeamMenu both call the menu item
TeamMenuItem::HandleMouseDown() method to do the actual work and then
send a message to cleanup.

Fixes #17761

Change-Id: I0e13e5fc6c90236936120ff0dda1246123576d37
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6311
Reviewed-by: waddlesplash <waddlesplash@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>


# 26d0a387 08-Aug-2020 Adrien Destugues <pulkomandy@pulkomandy.tk>

DeskBar raise-to-front: reintroduce fLastClickTime

This was removed in hrev33708 when enabling the "double click to raise"
feature. It results in all clicks after the first one just raising the
team again.

Fixes #8471


# 20f2ebae 07-May-2020 Adrien Destugues <adrien.destugues@opensource.viveris.fr>

Remove MouseDownThread and its usages

This code comes from an old Be Newsletter and since then the API
received the addition of SetMouseEventMask. In several places the
MouseDownThread was misused: it would spawn a new thread on every mouse
click and not clear the previous one. This could for example lead to
BSpinner skipping values if you clicked it at the right speed.

There are functional changes in BSpinner, before it updated for the
first time 100ms after mouse down, and then as you moved the mouse
around the button, now it activates immediately on first click and then
every 200ms (which may be a bit short). In other places, no functional
changes intended.

Change-Id: Ie600dc68cbb87d1e237633953e5189918bf36575
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2599
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 0d2645e4 19-Nov-2019 John Scipione <jscipione@gmail.com>

Deskbar: New single line mini-mode

Mini-mode is when Deskbar is in the 4 corners with the application
menu tucked away into the leaf menu bar. This commit changes mini-
mode from putting the clock and replicants below the leaf menu to
attaching them to the side forming a single line.

The main advantage of this is that if Deskbar is in the top right
corner you can maximize a window without losing any access to
Deskbar or any screen real-estate. The other three corners lose screen
real-estate similar to horizontal mode.

Replace team icon with HVIF version kindly donated by meanwhile.
Scale icon size according to font size. Grow the vector rendered icon
size by 1px to match bitmap size. Add Team_Registrar icon to
data/artwork/icons. Tweak Team_Registrar icon to match the area of the
bitmap taken up by the bitmap icon so they will render at the same size.
The bitmap can be now NULL if an invalid icon is passed, handle this
case with an fInitStatus member in BarMenuTitle.

Switch order of leaf and team menus on the left side so that the
team menu is always on the screen edge. The team menu is more in
need of quick corner access than the leaf menu in this mode.

Adjust leaf menu position so that it continues to be cut-off while
allowing the team menu icon to display normally. Center vertically in
horizontal mode but it's still cut-off at 16x16. In vertical mode the
leaf continues to be cut-off at all font sizes. Constrain leaf bitmap
to its menu item frame as it can bleed out into the adjacent team menu
item at larger font sizes.

Grow team menu items to fit the widest label up to the max vertical
expando window width (currently 2x min) before truncating.
LegacyPackageInstaller now fits in the team menu. More on
LegacyPackageInstaller in horizontal mode below.

Update SetSizeLimits for mini-mode - no upper limit on height or width.

Switch to mini-mode using 1/4 screen left and right of screen instead
of using 1/6. Mini mode is now wider and this change makes switching
between mini mode and horizontal mode more reliable.
* Rename frame to screenFrame here for clarity.

Set menu bar height to window tab height in vertical mode. This is
so that when you maximize a window the tab size will match. The menu
bar height is also a few pixels taller (25px vs 21px) than it was in
vertical expando mode at the default 12px font size. The change was
made to match the tab height. 21px was the height of a window tab
on BeOS R5's default decorator.

Adjust the width of the team menu for larger icon sizes. If app
names are hidden limit to half of min width so the menu doesn't
appear too short. SetMaxContentSize to width, this fixes a bug where
the menu item wasn't quite the right size for the menu.

No longer truncate time in vertical mini mode because the time can now
expand itself horizontally without limit (within reason.)

Center replicants vertically in mini-mode based on tab height and max
replicant height. Simplify mini-mode menu width and position calculation.
Fix a bar menu bar placement bug when Deskbar starts hidden in mini-mode.

Fix numerous layout issues. Put replicant tray where it should be in all
modes and then start adjusting things. The Replicant tray is now where
it should be in all modes, any fiddling with replicant icon locations
now can be relegated solely to LocationForReplicant().

Implements bug #5876 step 1.

*** Other related Deskbar improvements also made in this commit ***

Implemented underflow in horizontal mode ExpandoMenuBar to make items
wider when you close a team to take up more of available space. Max item
width is currently set to 1.25x min width so that LegacyPackageInstaller
fits in horizontal mode as well. In team menu it make sense to calculate
the widest label but in horizontal mode it would not be very nice if
ARogueAppWithAVeryVeryLongAndAnnoyingName were to grow all of your team
menu items. 1.25x is a fair compromise that gets us some extra width but
not too much. ExpandoMenuBar will truncate items to minimum width to buy
some space before it turns on the scroll arrows. Eliminate
kMinMenuItemWidth, create convinience methods to calculate limits.

Add BarView pointer to TimeView. Ditch fVertical and SetOrientation
in TTimeView and get the information from BarView instead. This way
we don't have to keep the state in sync. Also pass BarView pointer to
TTeamMenu constructor and use it instead of getting the pointer in a
roundabout way from be_app.

Eliminate kMiniHeight constant, the mini-mode height is now based
on the height of a window tab which changes with be_bold_font size.
Limit maximum height of replicants by be_bold_font size as well.
Also limit team menu and leaf menu icon heights by be_bold_font size.

Eliminate TExpandoMenuBar::fVertical, use fBarView instead. Switch the
order of layout and barView in ctor so that barView can be optional.
Change the ctor vertical param to layout and use the passed-in menu_layout
to pass to BMenuBar only. Once TExpandoMenuBar has been constructed, use
fBarView from then on. In Deskbar the menu_layout can change via
BMenuPrivate::SetLayout, if we needed to know TExpandoMenuBar's menu_layout
for some reason, we can call Layout().

Maintain 2px border around replicants in vertical expando mode on all
sides. Maintain 2px border around replicants in horizontal mode, except for
at 16x16 reduce the border to 1px because we're really short on height.
Improve clock centering in vertical expando mode. Also improve clock
centering in mini-mode across all font sizes. Reduce clock height by 2px
so that it won't draw over the top and bottom borders in horizontal mode.

Refactor TBarView::PlaceTray(). The code is basically the same but the
method is now better layed out. Calculate resize dragger location based
on width setting. This is valid since it is only ever used in vertical
expando mode. Hide the resize control better by moving it off-screen
when not in use. Hide() alone was not enough.

Fix size and position of the drag region to prevent minor drawing glitches
that were occuring in horizontal and left vertical mode because the drag
region was not in quite the right size and place.

Call DrawDragger() from DrawAfterChildren() instead of Draw() (and set
B_DRAW_ON_CHILDREN flag) so that the dragger will always be drawn even if
there are other items on top. In theory this should not be needed but in
practice this fixes a few drawing glitches. Rename DrawDragRegion() to
private DrawDragger() method - the name was confusing and other classes
shouldn't be allowed to draw the dragger directly.

TDragRegion should be renamed to TStatusView since that's what it really is.
Then we should create a new TDragControl class based on TResizeControl that
is a child of TStatusView like everybody else. TDragControl would be
responsible for drawing itself and knowing where its bounds are. For now
DrawAfterChildren() will have to do.

Rework status tray border drawing. It is identical in vertical exando mode
and in the same spirit in horizontal mode just a little bit nicer looking.
Draw hilight on top, left, and bottom edges in horizontal mode. Draw hilight
on top, and left edges in mini-mode this creates the appearance of a shadow.
Best appreciated using Magnify.

May the following (Open Tracker License) code forever be memorialized in
this commit message:

void
TDragRegion::Draw(BRect updateRect)
{
rgb_color menuColor = ViewColor();
rgb_color hilite = tint_color(menuColor, B_DARKEN_1_TINT);
rgb_color ldark = tint_color(menuColor, 1.02);
rgb_color dark = tint_color(menuColor, B_DARKEN_2_TINT);
rgb_color vvdark = tint_color(menuColor, B_DARKEN_4_TINT);
rgb_color light = tint_color(menuColor, B_LIGHTEN_2_TINT);

BRect frame(Bounds());
BeginLineArray(4);

if (be_control_look != NULL) {
if (fBarView->Vertical()) {
AddLine(frame.LeftTop(), frame.RightTop(), dark);
AddLine(BPoint(frame.left, frame.top + 1),
BPoint(frame.right, frame.top + 1), ldark);
AddLine(frame.LeftBottom(), frame.RightBottom(), hilite);
} else if (fBarView->AcrossTop() || fBarView->AcrossBottom()) {
AddLine(frame.LeftTop(),
BPoint(frame.left, frame.bottom), dark);
AddLine(BPoint(frame.left + 1, frame.top + 1),
BPoint(frame.right - 1, frame.top + 1), light);
AddLine(BPoint(frame.right, frame.top + 2),
BPoint(frame.right, frame.bottom), hilite);
AddLine(BPoint(frame.left + 1, frame.bottom),
BPoint(frame.right - 1, frame.bottom), hilite);
}
} else {
if (fBarView->Vertical()) {
AddLine(frame.LeftTop(), frame.RightTop(), light);
AddLine(frame.LeftTop(), frame.LeftBottom(), light);
AddLine(frame.RightBottom(), frame.RightTop(), hilite);
} else if (fBarView->AcrossTop()) {
AddLine(BPoint(frame.left, frame.top + 1),
BPoint(frame.right - 1, frame.top + 1), light);
AddLine(frame.RightTop(), frame.RightBottom(), vvdark);
AddLine(BPoint(frame.right - 1, frame.top + 2),
BPoint(frame.right - 1, frame.bottom - 1), hilite);
AddLine(frame.LeftBottom(),
BPoint(frame.right - 1, frame.bottom), hilite);
} else if (fBarView->AcrossBottom()) {
AddLine(BPoint(frame.left, frame.top + 1), BPoint(frame.right - 1, frame.top + 1), light);
AddLine(frame.LeftBottom(), frame.RightBottom(), hilite);
AddLine(frame.RightTop(), frame.RightBottom(), vvdark);
AddLine(BPoint(frame.right - 1, frame.top + 1),
BPoint(frame.right - 1, frame.bottom - 1), hilite);
}
}

EndLineArray();
}

Refactor mode switching.

Change TDragRegion::SwitchModeForRect() to SwitchModeForRegion() and pass
in BRegion's instead of BRect's. Create a new CalculateRegions() method
which is called once at startup and again on ScreenChanged() instead of
calculating the rect's over and over again inside MouseMoved(). Simplify
calculations using BRegion's.

Get the screen_where parameter from the Window()'s CurrentMessage() instead
of converting the passed in where parameter to screen coordinates. This
makes mode switching work 100% better.

Restore full state, fix all issues, and disable it again.

Fix issue with the window not resizing itself correctly when hiding the
scroller arrows in vertical expando mode because Deskbar was using the
bottom value of a scrolled view rather than its height. We only need to
call CheckForScrolling() once before we resize the window. Consolidate all
the window resizing code into ExpandoMenuBar::SizeWindow(), call
CheckForScrolling() there one time, then resize the window and lay
everything out again.

Simplify expando menu bar background drawing. The only part of this
drawing code that was actually being shown was the part where it stroked a
vertical line like this:

rgb_color menuColor = ui_color(B_MENU_BACKGROUND_COLOR);
SetHighColor(tint_color(menuColor, 1.22));
StrokeLine(bounds.LeftTop(), bounds.LeftBottom());

The rest of the code was never seen. May the following code also be forever
memorialized in this commit message:

void
TExpandoMenuBar::DrawBackground(BRect updateRect)
{
if (Vertical())
return;

BRect bounds(Bounds());
rgb_color menuColor = ui_color(B_MENU_BACKGROUND_COLOR);
rgb_color hilite = tint_color(menuColor, B_DARKEN_1_TINT);
rgb_color vlight = tint_color(menuColor, B_LIGHTEN_2_TINT);

int32 count = CountItems() - 1;
if (count >= 0)
bounds.left = ItemAt(count)->Frame().right + 1;
else
bounds.left = 0;

if (be_control_look != NULL) {
SetHighColor(tint_color(menuColor, 1.22));
StrokeLine(bounds.LeftTop(), bounds.LeftBottom());
bounds.left++;
uint32 borders = BControlLook::B_TOP_BORDER
| BControlLook::B_BOTTOM_BORDER | BControlLook::B_RIGHT_BORDER;

be_control_look->DrawButtonBackground(this, bounds, bounds, menuColor,
0, borders);
} else {
SetHighColor(vlight);
StrokeLine(bounds.LeftTop(), bounds.RightTop());
StrokeLine(BPoint(bounds.left, bounds.top + 1), bounds.LeftBottom());
SetHighColor(hilite);
StrokeLine(BPoint(bounds.left + 1, bounds.bottom),
bounds.RightBottom());
}
}

Change-Id: Id9ddd60c997a785184208ba02938bee1416aeae9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2253
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# 15eb397e 19-Jul-2018 John Scipione <jscipione@gmail.com>

Deskbar: Adjust team menu items with font size.

The Deskbar team menu should look the same at 12pt but much better
at larger (and smaller) font sizes.

Determine team menu item height in TBarView instead of
TTeamMenuItem::GetContentSize() because it is needed earlier in the
process, and also call method in GetContentSize().

The clock is centered horizontally in the first replicant row and the
width can grow to push the replicant icons better at larger font sizes.

The replicant tray and clock go to the bottom in horizontal bottom mode
and go to the top in horizontal top mode for Fitt's Law convinience and
go in the center of the first row in vertical mode.

Grow horizontal team item widths with font size, and shrink them
down to 1/2 of full width to fit more, or 1/2 padding for icon-only.

In horizontal mode the menu item size increases so that you can fit
approximate the same amount of label text based on icon and font size.
hit the width limit the items shrink and the label gets truncated
(like before.)

Scale team menu with font size. Reduce to half width for hide labels.

Change-Id: I93ecc8acded274b994728e7247768455862e31c5
Reviewed-on: https://review.haiku-os.org/c/haiku/+/345
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 037df929 13-Sep-2017 John Scipione <jscipione@gmail.com>

Revert "Revert "Deskbar: eliminate infinite loop bug""

This reverts commit 032a3f45f76d811cb25e76a96a2c817ce3840b99.


# 032a3f45 13-Sep-2017 John Scipione <jscipione@gmail.com>

Revert "Deskbar: eliminate infinite loop bug"

This reverts commit 6d7890478b78265f4670978a58384fb438de0007.

Fixed the bug, but, causes another bug, will revisit.


# 6d789047 13-Sep-2017 John Scipione <jscipione@gmail.com>

Deskbar: eliminate infinite loop bug

TBarWindow::FrameResized() calls TBarView::UpdatePlacement() to
resize the ExpandoMenuBar, however, UpdatePlacement() as part of its
work also resizes the window, which calls TBarWindow::FrameResized()
which in turn calls TBarView::UpdatePlacement() and so on.

To get out of this mess remove TBarView::UpdatePlacement() from
TBarWindow::FrameResized() but that leaves ExpandoMenuBar the
wrong size initially.

To fix this call SizeWindow() on AllAttached() which resizes
ExpandoMenuBar along with the rest of the window, but, just once not in
an infinite loop. Use AllAttached() rather than AttachedToWindow() so that
we are assured that ExpandoMenuBar and all of its children have been
attached thus avoiding the potential for an embarrasing Deskbar crash.

Fixes #13706


# b1967b10 09-Jan-2017 John Scipione <jscipione@gmail.com>

Revert "Deskbar: Scale cut-off leaf icon in horizontal mode"

This reverts commit 066137eb05fc965261d6e50f24e41b9dcf79a5a7.

Reverting while I figure out what is causing Deskbar to crash.


# 066137eb 07-Jan-2017 John Scipione <jscipione@gmail.com>

Deskbar: Scale cut-off leaf icon in horizontal mode

Fixes #8505 restoring the aesthetic integrity of the cut-off leaf.

Add vertically & horizontally centered, whole vector icon to rdef.

Reformat BarMenuTitle.h rename header guard from BARMENUTITLEH to
BAR_MENU_TITLE_H.

Created TDeskbarMenuTitle subclass which deals with Deskbar menu
item stuff like getting the icon from vector data and pushing the
leaf down a few pixels to cut off the leaf (maintaining its aesthetic
integrity).

Made TBarMenuTitle methods virtual. Remove unused expando constructor
parameter and private variable.

Add a TODO to scale the bitmap if we can't find any vector icon data.
With non-vector bitmap it behaves same as before this commit in
horizontal mode.

Adjust kMinimumTrayWidth to restore Deskbar's minimum width to its
classic value since days of yore, 143px. This, perhaps not coincidently,
is exactly the amount fit 7 replicant icons. Update constants in the
code to reflect this reality. Adjustable width coming soon.

replace dynamic_cast<TBarApp*>(be_app) with a static_cast in 1 place.


# 2e95f9e6 12-Jul-2016 looncraz <looncraz@looncraz.net>

Deskbar: Expand already running applications on startup.

Fixes #12480.

Another way to solve this would be to ensure that TExpandoMenuBar was subscribed
to TBarApp's notifications before TExpandoMenuBar::AttachedToWindow() returns,
but creates other problems that this solution does not have.

Signed-off-by: Augustin Cavalier <waddlesplash@gmail.com>


# ae30ad6e 23-Feb-2015 John Scipione <jscipione@gmail.com>

Deskbar: Remove settings member vars

... from expando menu bar. Get them from the BarApp settings instead.

This is so that we don't have to keep the settings and the member vars in sync.


# 4f4cab95 23-Feb-2015 John Scipione <jscipione@gmail.com>

Deskbar: Move ExpandoMenuBar name to constructor

... instead of passing it in from BarView.


# deaae5fc 07-Jan-2014 John Scipione <jscipione@gmail.com>

Deskbar: Persist ExpandoMenuBar

Add private BMenu::_SetMenuLayout() method. Set TExpandoMenuBar
as a friend class in BMenu to call this method. A little hacky,
but, this keeps SetMenuLayout() from being exposed as part of
the public API.

Don't destroy and rebuild the ExpandoMenuBar when switching from
horizontal to vertical mode. Instead build the TExpandoMenuBar
when the application starts and then switch it from B_ITEMS_IN_ROW
to B_ITEMS_IN_COLUMNS by using the newly added _SetMenuLayout()
method.

When we resize from vertical to horizontal, recalc the max
menu item widths, this resizes the application menu items so
that they take up the right amount of space.

Since we no longer destroy the menu bar we no longer have to
save whether menu items are expanded or not in a separate list.
Instead we can store that information in directly in
TExpandoMenuBar. This removes a lot of code.

Fixes #9350


# 4875d5a0 08-Oct-2013 John Scipione <jscipione@gmail.com>

DeskBar: refactor expander code.

With the Tracker thread code in shared now it is possible to use the same
trick for the expanders in Deskbar to open and close in a separate thread
that we use in Tracker. See Find Panel and Info window for examples
of the code being used in Tracker.

Also eliminates the fClickedExpander variable and allow you to expand with any
mouse button.

Hopefully fixes #9676


# c0d45b53 28-May-2013 John Scipione <jscipione@gmail.com>

Remove DOUBLECLICKBRINGSTOFRONT macro

The code that used it has already been removed and if it were
enabled it would do bad things.


# d0f798c8 28-May-2013 John Scipione <jscipione@gmail.com>

Style fixes to ExpandoMenuBar


# e83b2f0b 14-Apr-2013 John Scipione <jscipione@gmail.com>

Create a SetMaxItemWidth() method and set it in horizontal mode on update


# b76cec7d 10-Apr-2013 John Scipione <jscipione@gmail.com>

Pass a pointer to the TBarView object into the ExpandoMenuBar constructor

I fear that perhaps the fBarView variable may be accessed before it has a
chance to be set in AttachedToWindow(). By setting it in the constructor there
is no chance of this. Might fix #9656


# 5b0fd10d 07-Apr-2013 John Scipione <jscipione@gmail.com>

Animate the expander arrow

On MouseDown draw a diagonal arrow, on MouseUp complete the animation and
expand. If you hold down the button it will stay diagonal until you MouseUp
and either return to normal or animate and expand if over the arrow.

Reformatted ExpandoMenuBar.h and TeamMenuItem.h
Renamed fLastClickItem to fLastClickedItem
Added a DrawExpanderArrow() method
Renamed private InitData() method to _InitData() and moved it to the bottom


# 53ec5d1f 11-Mar-2013 John Scipione <jscipione@gmail.com>

Rebuild application menu bar less. Fixes #8539 (I hope)

Instead of destroying and rebuilding the application menu bar each time we
change state, create it at startup and then only update it from there on. This
means that bugs that rely on the app bar being constantly destroyed and rebuilt
will be much less likely to occur.

Unfortunatly, there is still one case where the application menu bar is being
destroyed and recreated and that is when you are switching between horizontal
and vertical mode, and that is because a menu bar cannot be altered from
B_ITEMS_IN_ROWS to B_ITEMS_IN_COLUMNS anywhere but in the constructor.

* Renamed fExpando to fExpandoMenuBar
* Updated TExpandoMenuBar to be more flexible after construction, the menu
items are built in the new BuildItems() method. Also, don't pass the BarView
object in at contruction, that can happen in AttachedToWindow(). Also, set
fDeskbarMenuWidth just once at constructor, no reason to keep setting it over and over again.


# f3ac8bc0 03-Mar-2013 John Scipione <jscipione@gmail.com>

Show the full window title in Deskbar in a tooltip

... if it gets truncated in vertical expando mode.


# c07e6ff2 26-Oct-2012 John Scipione <jscipione@gmail.com>

Make horizontal scrolling work in Deskbar

* Split the Leaf menu and seperator into their own menubar.
* I got rid of a lot of special cases for horizontal in the
ExpandoMenuBar class because now the menubar contains the same
items as in vertical mode. However, it also means that the dreaded
<none> bug also affects horizontal mode.
* Make the application menubar resize itself even in horizontal mode.
This means that the view background shows through so I'm going to have
to fix this up.
* Calculate when to add the scroll arrows and how much to allow the user
to scroll by for horizontal. CheckItemSizes() got a big refactoring.
* Rework the InlineScrollView class a bit. It no longer requires you to
specify the begin and end limits on construction because it can
calculate them instead. It also no longer depends on the screen at all,
this means this class can be extened to be used more generally and in
more places.


# 7ee3b479 21-Jul-2012 John Scipione <jscipione@gmail.com>

Make the MenuScrollView a fixed size...

instead of trying to make it follow fExpando just make it a fixed
size on creation. It is invisible and extends to the bottom of the
screen. fExpando grows inside it, and the window follows fExpando.
When the window grows taller than the screenframe the arrows are
added. You can scroll with the mouse wheel, but I haven't yet gotten
scrolling to work from clicking. Deskbar still crashes when going
from Mini mode to vertical expando mode. I have no idea why.


# 49ff476d 19-Jul-2012 John Scipione <jscipione@gmail.com>

Make ScrollMenu not rely on Menu.cpp

Rename ScrollMenu.cpp to MenuScrollView.cpp

Half step towards making this class work as part of Deskbar without
extending any other classes. Scrolling works both with mouse and
scroll wheel. Redraws on scroll, need to make that work better.
Also need to move classes out of the Interface Kit and into Deskbar.


# 1cd61330 02-May-2012 John Scipione <jscipione@gmail.com>

Style fixes including reordering #include's in Deskbar

* Reorder includes according to the Style Guide.
* Whitespace changes, mostly making sure there are 2 newlines
between things and making sure there is 1 newline at the end of
each file.
* Make end of header files all in the style of
#endif\t/* _HEADER_GAURD_H_ */
* The one change that is not purely style is to #include <Path.h>
in DeskbarUtils.h instead of DeskbarUtils.cpp because it is used
to define entry_ref for the AddRefsToDeskbarMenu() prototype.


# f73d1f4f 24-Apr-2012 John Scipione <jscipione@gmail.com>

Cache the lastMousedOverItem before showing tooltip.

Optimization, only update the tooltip if not the same as the cached
last moused over item. That way the same application name won't
keep getting set over and over again.


# 323b6546 21-Nov-2011 Oliver Tappe <zooey@hirschkaefer.de>

Filtered flat import of Oliver's svn package management branch

Bring the changes that aren't package management related and the ones
that are but don't take effect as long as they are ignored by the build
system into the master.

Summary of changes:
* Introduce private header <directories.h> with constants for a good
deal of paths that should usually be retrieved via find_directory().
* Replace hard-coded paths by using find_directory() or the
<directories.h> constants (e.g. in drivers and the kernel).
* Add find_directory() constants needed for package management.
* Add __HAIKU_ABI_NAME and B_HAIKU_ABI_NAME macros.
* src/apps/deskbar: BeMenu.* -> DeskbarMenu.*,
DeskBarUtils.* -> DeskbarUtils.*
* Change deskbar menu settings directory from ~/config/be to
~/config/settings/deskbar.
* Other smaller cleanups, changes, and fixes.


# 7eb3210e 05-Nov-2011 John Scipione <jscipione@gmail.com>

Sort application windows in Deskbar in 'natural' order yielding this:

window 1
window 2
window 3
window 4
window 5
window 6
window 7
window 8
window 9
window 10
window 11

Instead of this:

window 1
window 10
window 11
window 2
window 3
window 4
window 5
window 6
window 7
window 8
window 9

The natural order comparison method used in Deskbar is the same method used
to sort file names in natural order in Tracker.

Also when comparing window titles to their corresponding window menu item
labels use the FullTitle() method instead of the Label() method because the
label might get truncated.

Fixes #7774

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43195 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3dfd9cb9 16-Jun-2011 Oliver Tappe <zooey@hirschkaefer.de>

Flat commit of all changes from package-management branch in svn


# 57a09638 28-Feb-2011 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

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


# 1192454d 21-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Enabled and simplified the "double click team to front" feature, as it
actually works under Haiku (with a caveat, as there is apparently an
app_server bug that prevents that most of the time).
* Simplified ExpandoMenuBar::MouseDown().
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33708 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 71bd3ba5 30-Sep-2009 Jonas Sundström <jonas@kirilla.com>

Removing ifdefs and code for non-Haiku build targets. Partial clean-up. Enforcing the 80-char limit, renaming constants, newline at end of file.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33377 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 290c9039 29-Sep-2009 Jonas Sundström <jonas@kirilla.com>

Partial clean-up. Asterisks and k-prefix constants.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33366 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cb6afcb1 21-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

* Give Deskbar a refreshed and cleaner look.
* Fixed a bunch of problems in layouting the various views. (For example,
the last app menu entry is no longer one pixel too short, but there was
more...)
* Fixed Deskbar being not wide enough for the Haiku logo in certain modes.
* Enabled the mount menu. I think it's a good idea to have at a more prominent
location where new Haiku users may look for it (Gnome also has this in
the main panel).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29631 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 249a4a18 13-Oct-2008 Stephan Aßmus <superstippi@gmx.de>

zooey + stippi:
Reimplemented the drag message over the team entries dragging. The previous
implementation used the menu bar tracking by faking a B_MOUSE_DOWN event. The
problem was that in Haiku menus are always sticky and therefor the tracking
thread was not exited when the user released the mouse (which was supposed to
trigger the drop event in the Deskbar). The new implementation follows the
drag in the asynchronous mouse hooks and uses it's own selection state in
TTeamMenuItem to highlight the eventual drop targets.
Fixes #2771.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28063 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 243fcbe2 02-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

Since SF cannot be reached currently, this fix gets into the Haiku tree first:
ExpandoMenuBar::ItemAtPoint() was broken, which could cause a crash when doing
the "vulcan death grip" over a window item. This fixes bug #379.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16964 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 41281cf3 22-May-2005 Axel Dörfler <axeld@pinc-software.de>

Added Tracker and Deskbar from OpenTracker-current to the repository.
They both build fine.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12773 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ae30ad6e234d04584b3fe7149e11fee63d9cf509 23-Feb-2015 John Scipione <jscipione@gmail.com>

Deskbar: Remove settings member vars

... from expando menu bar. Get them from the BarApp settings instead.

This is so that we don't have to keep the settings and the member vars in sync.


# 4f4cab958e7d4dac805d3f715889ec8854606264 23-Feb-2015 John Scipione <jscipione@gmail.com>

Deskbar: Move ExpandoMenuBar name to constructor

... instead of passing it in from BarView.


# deaae5fc20b5cf44115441d34a1e33436df885b2 07-Jan-2014 John Scipione <jscipione@gmail.com>

Deskbar: Persist ExpandoMenuBar

Add private BMenu::_SetMenuLayout() method. Set TExpandoMenuBar
as a friend class in BMenu to call this method. A little hacky,
but, this keeps SetMenuLayout() from being exposed as part of
the public API.

Don't destroy and rebuild the ExpandoMenuBar when switching from
horizontal to vertical mode. Instead build the TExpandoMenuBar
when the application starts and then switch it from B_ITEMS_IN_ROW
to B_ITEMS_IN_COLUMNS by using the newly added _SetMenuLayout()
method.

When we resize from vertical to horizontal, recalc the max
menu item widths, this resizes the application menu items so
that they take up the right amount of space.

Since we no longer destroy the menu bar we no longer have to
save whether menu items are expanded or not in a separate list.
Instead we can store that information in directly in
TExpandoMenuBar. This removes a lot of code.

Fixes #9350


# 4875d5a09172e873caa55fe60039e0db80e64fde 08-Oct-2013 John Scipione <jscipione@gmail.com>

DeskBar: refactor expander code.

With the Tracker thread code in shared now it is possible to use the same
trick for the expanders in Deskbar to open and close in a separate thread
that we use in Tracker. See Find Panel and Info window for examples
of the code being used in Tracker.

Also eliminates the fClickedExpander variable and allow you to expand with any
mouse button.

Hopefully fixes #9676


# c0d45b53edad9a1e4f37e53c6bf547f0168fbd2d 28-May-2013 John Scipione <jscipione@gmail.com>

Remove DOUBLECLICKBRINGSTOFRONT macro

The code that used it has already been removed and if it were
enabled it would do bad things.


# d0f798c8d2d9fc5851029a328eba9b6f7d7d9a25 28-May-2013 John Scipione <jscipione@gmail.com>

Style fixes to ExpandoMenuBar


# e83b2f0b9cf71e3830bce4041401d48e033f8696 14-Apr-2013 John Scipione <jscipione@gmail.com>

Create a SetMaxItemWidth() method and set it in horizontal mode on update


# b76cec7d9c445a3f058ec4100fdde780b5c8cc78 10-Apr-2013 John Scipione <jscipione@gmail.com>

Pass a pointer to the TBarView object into the ExpandoMenuBar constructor

I fear that perhaps the fBarView variable may be accessed before it has a
chance to be set in AttachedToWindow(). By setting it in the constructor there
is no chance of this. Might fix #9656


# 5b0fd10d23d2c57ab32c256784daafa2b97860fa 07-Apr-2013 John Scipione <jscipione@gmail.com>

Animate the expander arrow

On MouseDown draw a diagonal arrow, on MouseUp complete the animation and
expand. If you hold down the button it will stay diagonal until you MouseUp
and either return to normal or animate and expand if over the arrow.

Reformatted ExpandoMenuBar.h and TeamMenuItem.h
Renamed fLastClickItem to fLastClickedItem
Added a DrawExpanderArrow() method
Renamed private InitData() method to _InitData() and moved it to the bottom


# 53ec5d1f33912441da3ad5786dfd300282cdfcf0 11-Mar-2013 John Scipione <jscipione@gmail.com>

Rebuild application menu bar less. Fixes #8539 (I hope)

Instead of destroying and rebuilding the application menu bar each time we
change state, create it at startup and then only update it from there on. This
means that bugs that rely on the app bar being constantly destroyed and rebuilt
will be much less likely to occur.

Unfortunatly, there is still one case where the application menu bar is being
destroyed and recreated and that is when you are switching between horizontal
and vertical mode, and that is because a menu bar cannot be altered from
B_ITEMS_IN_ROWS to B_ITEMS_IN_COLUMNS anywhere but in the constructor.

* Renamed fExpando to fExpandoMenuBar
* Updated TExpandoMenuBar to be more flexible after construction, the menu
items are built in the new BuildItems() method. Also, don't pass the BarView
object in at contruction, that can happen in AttachedToWindow(). Also, set
fDeskbarMenuWidth just once at constructor, no reason to keep setting it over and over again.


# f3ac8bc08985fe1ca60569001f7e914eaa3e62e3 03-Mar-2013 John Scipione <jscipione@gmail.com>

Show the full window title in Deskbar in a tooltip

... if it gets truncated in vertical expando mode.


# c07e6ff292cbe19ab758ce8bcb6c5cde38a3e662 26-Oct-2012 John Scipione <jscipione@gmail.com>

Make horizontal scrolling work in Deskbar

* Split the Leaf menu and seperator into their own menubar.
* I got rid of a lot of special cases for horizontal in the
ExpandoMenuBar class because now the menubar contains the same
items as in vertical mode. However, it also means that the dreaded
<none> bug also affects horizontal mode.
* Make the application menubar resize itself even in horizontal mode.
This means that the view background shows through so I'm going to have
to fix this up.
* Calculate when to add the scroll arrows and how much to allow the user
to scroll by for horizontal. CheckItemSizes() got a big refactoring.
* Rework the InlineScrollView class a bit. It no longer requires you to
specify the begin and end limits on construction because it can
calculate them instead. It also no longer depends on the screen at all,
this means this class can be extened to be used more generally and in
more places.


# 7ee3b479d14579e4a9db2709499c4706850e53c9 21-Jul-2012 John Scipione <jscipione@gmail.com>

Make the MenuScrollView a fixed size...

instead of trying to make it follow fExpando just make it a fixed
size on creation. It is invisible and extends to the bottom of the
screen. fExpando grows inside it, and the window follows fExpando.
When the window grows taller than the screenframe the arrows are
added. You can scroll with the mouse wheel, but I haven't yet gotten
scrolling to work from clicking. Deskbar still crashes when going
from Mini mode to vertical expando mode. I have no idea why.


# 49ff476d139dc28ebaa95d65b7820423b6061d60 19-Jul-2012 John Scipione <jscipione@gmail.com>

Make ScrollMenu not rely on Menu.cpp

Rename ScrollMenu.cpp to MenuScrollView.cpp

Half step towards making this class work as part of Deskbar without
extending any other classes. Scrolling works both with mouse and
scroll wheel. Redraws on scroll, need to make that work better.
Also need to move classes out of the Interface Kit and into Deskbar.


# 1cd61330ecd8257551d58f204332d00145c855ec 02-May-2012 John Scipione <jscipione@gmail.com>

Style fixes including reordering #include's in Deskbar

* Reorder includes according to the Style Guide.
* Whitespace changes, mostly making sure there are 2 newlines
between things and making sure there is 1 newline at the end of
each file.
* Make end of header files all in the style of
#endif\t/* _HEADER_GAURD_H_ */
* The one change that is not purely style is to #include <Path.h>
in DeskbarUtils.h instead of DeskbarUtils.cpp because it is used
to define entry_ref for the AddRefsToDeskbarMenu() prototype.


# f73d1f4f28fd80835f299830063a61a3ee3e3efd 24-Apr-2012 John Scipione <jscipione@gmail.com>

Cache the lastMousedOverItem before showing tooltip.

Optimization, only update the tooltip if not the same as the cached
last moused over item. That way the same application name won't
keep getting set over and over again.


# 323b65468e5836bb27a5e373b14027d902349437 21-Nov-2011 Oliver Tappe <zooey@hirschkaefer.de>

Filtered flat import of Oliver's svn package management branch

Bring the changes that aren't package management related and the ones
that are but don't take effect as long as they are ignored by the build
system into the master.

Summary of changes:
* Introduce private header <directories.h> with constants for a good
deal of paths that should usually be retrieved via find_directory().
* Replace hard-coded paths by using find_directory() or the
<directories.h> constants (e.g. in drivers and the kernel).
* Add find_directory() constants needed for package management.
* Add __HAIKU_ABI_NAME and B_HAIKU_ABI_NAME macros.
* src/apps/deskbar: BeMenu.* -> DeskbarMenu.*,
DeskBarUtils.* -> DeskbarUtils.*
* Change deskbar menu settings directory from ~/config/be to
~/config/settings/deskbar.
* Other smaller cleanups, changes, and fixes.


# 7eb3210e8f56c924148b23f129dbdc3f2670d828 05-Nov-2011 John Scipione <jscipione@gmail.com>

Sort application windows in Deskbar in 'natural' order yielding this:

window 1
window 2
window 3
window 4
window 5
window 6
window 7
window 8
window 9
window 10
window 11

Instead of this:

window 1
window 10
window 11
window 2
window 3
window 4
window 5
window 6
window 7
window 8
window 9

The natural order comparison method used in Deskbar is the same method used
to sort file names in natural order in Tracker.

Also when comparing window titles to their corresponding window menu item
labels use the FullTitle() method instead of the Label() method because the
label might get truncated.

Fixes #7774

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43195 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3dfd9cb95ce45f59160d50975210bc55e3fc0709 16-Jun-2011 Oliver Tappe <zooey@hirschkaefer.de>

Flat commit of all changes from package-management branch in svn


# 57a096382ac42f4002b14c6e39540814110833c9 28-Feb-2011 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

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


# 1192454dfc58e4f9a92f4ff4494a4cf1e1ea4a69 21-Oct-2009 Axel Dörfler <axeld@pinc-software.de>

* Enabled and simplified the "double click team to front" feature, as it
actually works under Haiku (with a caveat, as there is apparently an
app_server bug that prevents that most of the time).
* Simplified ExpandoMenuBar::MouseDown().
* Minor cleanup.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33708 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 71bd3ba59c06b130115c3ddd44457d8f9dd78997 30-Sep-2009 Jonas Sundström <jonas@kirilla.com>

Removing ifdefs and code for non-Haiku build targets. Partial clean-up. Enforcing the 80-char limit, renaming constants, newline at end of file.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33377 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 290c903985a449fa86c501366b6fcddf7f55b46a 29-Sep-2009 Jonas Sundström <jonas@kirilla.com>

Partial clean-up. Asterisks and k-prefix constants.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33366 a95241bf-73f2-0310-859d-f6bbb57e9c96


# cb6afcb1464e92f0134232e6179215295e17bc79 21-Mar-2009 Stephan Aßmus <superstippi@gmx.de>

* Give Deskbar a refreshed and cleaner look.
* Fixed a bunch of problems in layouting the various views. (For example,
the last app menu entry is no longer one pixel too short, but there was
more...)
* Fixed Deskbar being not wide enough for the Haiku logo in certain modes.
* Enabled the mount menu. I think it's a good idea to have at a more prominent
location where new Haiku users may look for it (Gnome also has this in
the main panel).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29631 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 249a4a187ee9e9e24aa41146e071ad1c01e27283 13-Oct-2008 Stephan Aßmus <superstippi@gmx.de>

zooey + stippi:
Reimplemented the drag message over the team entries dragging. The previous
implementation used the menu bar tracking by faking a B_MOUSE_DOWN event. The
problem was that in Haiku menus are always sticky and therefor the tracking
thread was not exited when the user released the mouse (which was supposed to
trigger the drop event in the Deskbar). The new implementation follows the
drag in the asynchronous mouse hooks and uses it's own selection state in
TTeamMenuItem to highlight the eventual drop targets.
Fixes #2771.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@28063 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 243fcbe279044852cf007df093a2e5a62d1b7e16 02-Apr-2006 Axel Dörfler <axeld@pinc-software.de>

Since SF cannot be reached currently, this fix gets into the Haiku tree first:
ExpandoMenuBar::ItemAtPoint() was broken, which could cause a crash when doing
the "vulcan death grip" over a window item. This fixes bug #379.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16964 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 41281cf362916855e6eb9ad1d728d919863a1e81 22-May-2005 Axel Dörfler <axeld@pinc-software.de>

Added Tracker and Deskbar from OpenTracker-current to the repository.
They both build fine.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@12773 a95241bf-73f2-0310-859d-f6bbb57e9c96