History log of /haiku/src/apps/deskbar/BarWindow.cpp
Revision Date Author Comments
# 396f398d 04-May-2023 John Scipione <jscipione@gmail.com>

Deskbar: Fix horizontal mode window size limits

When your font size and team icon size is large
enough horizontal mode Deskbar gets cut off.

Compare composed to composed, this restores the icon
size scaling behavior as indended before compose
changes in Deskbar: label is positioned to the right
of the team icon until after the third icon size
notch regardless of your font size.

Change-Id: Ia1d1418cc3b04536a55860d3889d2437c40986cc
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6415
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 08f748de 24-Feb-2023 Augustin Cavalier <waddlesplash@gmail.com>

Deskbar: Remove B_TRANSLATE_SYSTEM_NAME and leave a comment as to why.

Fixes #18206. Related to #18251; a better way to accomplish finding
views without scripting should be added, really.


# f9b3a3b1 12-Aug-2020 John Scipione <jscipione@gmail.com>

Deskbar: Restore old mini-mode

... with the replicant tray below the menu bar.

Deskbar now has four modes:
1. vertical mini-mode (old mini-mode)
2. horizontal mini-mode (new mini-mode, was vertical)
3. vertical expando-mode (default)
4. horizonal expando-mode

Horizontal mini-mode gets the corner, then it switches to vertical
mini-mode above or below that, then to vertical expando-mode after
that. Horizontal expando mode is in center-screen top and bottom.

Clock vertical centering simplification.

Change-Id: I216008c20feb28f793693046792bbcfdf1e703e3
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3146
Reviewed-by: Adrien Destugues <pulkomandy@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>


# 74ceffa8 25-Feb-2020 John Scipione <jscipione@gmail.com>

Deskbar: Reimplement auto-raise/implement auto-lower

This changes auto-raise so that when the mouse moves over the screen edge
within the Deskbar window it raises Deskbar up and when the mouse leaves
the Deskbar window it lowers it back down again as described in #13304.

Activate Deskbar on click only if not in auto-raise mode and not in
always-on-top mode. In auto-raise mode click activates through foreground
windows, which we don't want. We don't ever want to activate Deskbar in
always-on-top mode because Deskbar is already on top and we don't want to
change the active window.

However, if a menu is opened on click in auto-raise Deskbar is raised and
stays on top as long as a menu remains open. Once menu is closed Deskbar
lowers back down again. Only lower Deskbar on menu close in auto-raise mode
if there isn't another menu open.

Don't raise/lower Deskbar if window has been dragged from the outside in
auto-raise mode.

Change bool fShowingMenu to int32 fMenusShown and use it to store a
reference count of open menus. In the previous design menus could be
opened from multiple locations clobbering the bool.

Add an fBarWindow member to BarView and initialize it in AttachedToWindow()
Use this throughout the class so that we don't have to keep getting it over
and over again. Also add an fBarApp member to BarWindow and use that
instead of creating it again and again.

Change order of methods in BarView to MouseDown(), MouseMoved(), then
MouseUp() because that order is both logical and alphabetical.

Fixes #15678, #13304

Change-Id: I076a452b26250d9eb9a4eccb4a6aa6f939e11d34
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2281
Reviewed-by: Sergei Reznikov <diver@gelios.net>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
Reviewed-by: humdinger <humdingerb@gmail.com>


# 6f114b94 23-Feb-2020 John Scipione <jscipione@gmail.com>

Deskbar: Set no horizontal window size limit in vertical mode

... better so that for scroller arrows will work again.
This regression occurred in hrev53890 trying to fix #15067.

Use B_SIZE_UNLIMITED not -1 for no window size limit.


# d7aa468e 23-Feb-2020 John Scipione <jscipione@gmail.com>

Revert "Deskbar: Set no horizontal window size limit in vertical mode"

This reverts commit bc9e33a5fbd64f442d055d03090debf563f9e1b4.

This can cause other problems though, will need to provide a better fix.


# bc9e33a5 23-Feb-2020 John Scipione <jscipione@gmail.com>

Deskbar: Set no horizontal window size limit in vertical mode

... so that for scroller arrows will work again. This regression
occurred in hrev53890 trying to fix #15067.


# 1c765f5b 18-Feb-2020 John Scipione <jscipione@gmail.com>

Deskbar: Set window limits to hidden dimension in auto-hide mode.

This fixes a bug where the window size limits were not set correctly
causing the window not to be hidden properly in some cases while
Deskbar is in auto-hide mode. This bug was introduced in hrev53585:
Update window resize size limits.

A couple of other auto-hide related bugs were also fixed:

Hide TBarView in constructor if auto-hide is on. This is needed to
size and position the window correctly on Deskbar startup in auto-
hide mode.

Always Check fTime->IsHidden() from the perspective of fTime instead
of the parent view because we were getting false positives that the
clock was hidden in auto-hide mode which caused the replicants not to
realign themselves around the clock on Deskbar startup. The clock
thought it was hidden because the parent view was hidden but that's
not what is needed here.

Bail out of BarView::MouseMoved if resizing. This fixes a bug where
if you resized the window in auto-hide mode once the window had become
as wide as possible dragging beyond the window hidden area slop limit
would confusingly cause the window to hide itself in the middle of your
resize operation.

Fixes #15067 better. Fixes problems related to #8641 and #9469.

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


# 7e27cd8e 17-Nov-2019 John Scipione <jscipione@gmail.com>

Deskbar: Update window resize size limits

With B_NOT_V_RESIZABLE ctrl+alt+rmb can be used to resize the window
in undesired ways. Set window size limits to prevent user from resizing
the window beyond the set size limits.

Update window size limits on ScreenChanged()

Fixes #15067

Change-Id: Ia10eafb9860009019be35ec5c244d034861eeae9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/1968
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>


# ceec04ea 17-Jun-2019 Augustin Cavalier <waddlesplash@gmail.com>

Deskbar: Add a declaration for a constructor to TStartableMenuBar.

Appeases GCC2.


# 74c38cab 16-Jun-2019 Augustin Cavalier <waddlesplash@gmail.com>

BMenuBar & Deskbar: Make the hack to call ShowMenuBar a lot less ugly.

The previous hack, which as the comment (and __MWERKS__) implies
dates all the way back to the Be era, finally broke: int32 is "int"
on non-x86, not "long", and so this generated an undefined symbol
error on ARM.

The best solution seems to be to make StartMenuBar merely protected,
and then make a subclass where it is fully public to call it.
This is a lot less fragile (and much less ugly.)

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


# efafab64 02-Nov-2018 Axel Dörfler <axeld@pinc-software.de>

Deskbar: Resizable tray

* Adds max width and height arguments to
instantiate_deskbar_(item|entry).
* Old applications just stay with a 16x16 scaled icon, though.
* All used apps within the repository are converted to the new call
besides the input_server input method icon (that will need further
API changes in the input_server).

Change-Id: I29cc439396917be2c24135888459d31364997dff
Reviewed-on: https://review.haiku-os.org/656
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# 5fd3bc6d 03-Nov-2018 Axel Dörfler <axeld@pinc-software.de>

BDeskbar: Moved constants to shared header

* Instead of duplicating them in different files.


# fc23c097 26-Nov-2017 John Scipione <jscipione@gmail.com>

BDeskbar & Deskbar: export window bool settings to BDeskbar

Add methods to get and set "Always on top", "Auto raise", and "auto hide"
which are all booleans which control aspects of the Deskbar window to
BDeskbar.

Set the bool to the default value initially. Check if sending the
message succeeds, if so check the reply which also fills out the bool.
Don't check to see if reply succeeded because the bool will only be
overwritten if it did.

Follow the BDeskbar convention Is...() for getter, Set...() for setter
e.g IsAlwaysOnTop() is the getter, SetAlwaysOnTop() is the setter.

Define new message constants to call the newly created methods.
Follow BDeskbar convention: 'gtla' is used for getter, 'stla' for setter.
g/s for getter/setter, tla is an all-lowercase code unique to each
getter/setter pair.

Copy/paste these message constants into BarApp.h unchanged. Replace four
letter codes with imported message constants in BarApp.cpp and
BarWindow.cpp. Much nicer than using bare codes.

The new BDeskbar methods are all handled by TBarApp. The getters send
back a reply message containing the bool while the setters fall through
to existing setter cases.


# 938fd26f 14-Sep-2017 John Scipione <jscipione@gmail.com>

Fix infinite loop bug, take 2

... by calling TBarView::UpdatePlacement() in
TBarWindow::FramedResized() only if the width has changed.

Explanation from take 1:
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.

(now call UpdatePlacement() conditionally instead of removing it)

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.

(we still need to call SizeWindow() on AllAttached())

Fixes #13706


# 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


# 1bb2e623 01-Mar-2013 John Scipione <jscipione@gmail.com>

Deskbar: variable width Deskbar in vertical mode

Feature to make Deskbar width variable via a dragger.

Resize Deskbar by clicking and dragging the mouse on the
horizontal side of Deskbar opposite the screen's edge.
(left side for default top right).

The resize dragger is hidden in horizontal mode.

Details below:
* ExpandoMenuBar is resized with rest of window.
* Rename where to whereScreen to make it clear that the variable
is in screen coordinates.
* Lock focus on window while resizing
* Resize via TResizeControl class which is based on TDragRegion
* Set default width to minimum so everything stays the same.
- don't set the width setting to 0 on quit, use the new setting.
* Set max tray width based on setting
* Make clock area a bit wider preventing replicant icons from
overrunning the clock area.
* Leave more room left of clock makes replicants wrap earlier,
leaving icon gap width between replicants and clock. Before it
would butt flush against the clock before moving down a row.
* Remove FrameMoved from TDragRegion, we are already doing this
in BarView -- no reason to do it twice.
* Need to redraw the drag region after moving or it will be half
drawn.
* Hide resize control in horizontal mode
* Add room for resize dragger when placing replicants
* Update width setting unless window is hidden
- This prevents Deskbar from being set to minimum width after it
is hidden.

Also, constrain width setting within limits but not width of the
BarView which we want to track the window width. In practice they
should be the same but it is possible for them to get out of sync
and that's okay. Obvious example of the setting and actual width
of the window being out of sync is in the hidden case.

unify dragger width and kDragWidth vars

Make drag regions pixel perfect:
* Vertical mode status tray reduced in height by 1px to match height
in horizontal mode exactly.
* move icons over by 2px in horizontal mode so that there is a bit more space
on the left and so that it matches pixel perfect with vertical mode.
- to see this quickly switch between bottom right vertical at the minimum width
and horizontal mode then notice how the icons don't move

Draw drag background then menu color when not active to get rid of drawing
glitches in horizontal mode on the top pixel.

Add some more room between last icon and clock in horizontal mode.


# 0fc30d89 09-Apr-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

Deskbar: Sanitize the usage of BMessage

... especially for SendMessage and SendReply.
* Delete the item's message if AddItem does not return successfully.
* Fixes #11934.

Signed-off-by: Adrien Destugues <pulkomandy@gmail.com>


# 039f5926 03-Mar-2015 John Scipione <jscipione@gmail.com>

Tracker, Deskbar, ShowImage: move public commands

... to tracker_private.h so they may be used by external apps
such as Deskbar and ShowImage. Remove PublicCommands.h


# 85529c12 05-Feb-2015 Jessica Hamilton <jessica.l.hamilton@gmail.com>

Deskbar: fix showing an empty leaf menu, #3105.

* NeedsToRebuild() didn't actually do anything, as this
returns whether it needs to be rebuilt or not.
* Replaced RemoveItems() with ForceRebuild(), which should
already delete the menu items, whilst additionally
letting the leaf menu know that it needs to rebuild itself.

This bug was reproducible 100%; however, with this fix, there
is now a rare race condition where clicking between an app menu
and the leaf menu will result in both menus showing concurrently.


# 26ea7066 29-Jun-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Deskbar: use a virtual directory for the user-configurable menu

* Deskbar now uses ~/config/settings/deskbar/menu_entries for its menu,
falling back to /system/data/deskbar/menu_entries, when the former
doesn't exist. The latter always exists and is a virtual directory
merging the deskbar/menu subdirectories of ~/config/settings/ and
<any installation location>/data/. So, if a package provides a
deskbar menu symlink, it is added automatically when the package is
activated. The user can add own menu items by putting stuff into
~/config/settings/deskbar/menu/, only use their own organization by
symlinking it to menu_entries, or do fun stuff by making menu_entries
a customized virtual directory.
* HaikuImage: No longer create any deskbar menu symlinks in the user's
settings directory. Instead add them to the Haiku package.
* OptionalPackages: At least for the optional packages that do have
hpkgs, no longer create deskbar menu symlinks in the user's settings
directory.
* Move all Deskbar settings files to ~/config/settings/deskbar/ and
drop the "Deskbar_" prefix.


# fe624b39 13-Apr-2013 John Scipione <jscipione@gmail.com>

Style fixes only

Most indentation and newlines with a few comment updates


# e9632898 09-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Added Tracker and Deskbar to x86_64 build.


# 22812ba2 05-May-2012 Rene Gollent <anevilyak@gmail.com>

Fix ticket #8497.

- Rework Deskbar's handling for the autoraise/autohide cases to not
need event masks. This prevents various problems that would occur
if one happened to be working in another window that overlapped part
of Deskbar, as reported in #8497. Instead, we now use a message filter
to redirect the messages as needed.


# 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.


# 546208a5 16-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

More catalog-related cleanup.

* rename B_TRANSLATE_CONTEXT to B_TRANSLATION_CONTEXT and
B_TRANSLATE_WITH_CONTEXT to B_TRANSLATE_CONTEXT, squashing a TODO
* adjust all uses of both macros in Haiku's source tree
* use correct header guard for collecting/Catalog.h

The renamed macros require adjustments to all external applications
using catalogs.


# b932a5a4 15-Apr-2012 John Scipione <jscipione@gmail.com>

Fix bug #8004

Dragging the Deskbar with CTRL+ALT+mouse not possible with
Auto-raise and Auto-hide disabled.

The reason this only worked with auto-raise or auto-hide enabled
is because the EventMask on BarView was only set to received mouse
events when those were settings were enabled. Apparently someone
figured this out. So, to fix this bug I set BarView to always
accept mouse events. Doesn't appear to have any obvious negative
consequences. Auto-hide and auto-raise still work.

I also added a comment in BarWindow::MenusBeginning(). It is
setting the EventMask of BarView to 0 and then back again in
TBarWindow::MenusEnded() to get around a bug in BeOS (according
to the comment anyway). I took out those lines and didn't notice
anything different so I assume that whatever the bug was it is
fixed and now and we can take those lines out permenantly.


# 3cf2d117 14-Apr-2012 John Scipione <jscipione@gmail.com>

Change Time Format Options in Deskbar preferences.

Added two new methods to the Locale Kit in order to create a custom time
formats from a format string. One method is outputs into a char* array,
the other into a BString() and you can set the timezone.

These methods should be cleaned up, we only need 2, one to get
the time in a predefined style, the other to get a custom time format.
Also should probably do the same for dates and datetimes. But I'll let
this go for now.

I added myself to the Locale.cpp file. I retained the copyright instead
of assigning it to Haiku, Inc. because the file is under the OpenBeOS
license and I don't know what the concequences of copyright sharing are
for that license, unlike MIT.

These new methods are used to generate custom time formats in Deskbar.
Instead of using a set of Radio Buttons to choose between the predefined
time options I build my own by creating a format string and passing it
to the Locale Kit. The format string is generated from 3 checkboxes,
show seconds, show day of week, and show time zone. You can mix and match
between them choose any that you like. By default they are all off.

There are 3 new deskbar settings associated with these new options:
showSeconds, showDayOfWeek, and showTimeZone. timeFormat has gone away.

The time format string gets cached and updated only when Update() gets called
on the TimeView class.

In order to fit all the options in (there is 1 more than before) I had to
reduce the font size of the clock to 11pt when all options are turned on in
12 hour mode. For those with no imagination it looks like this:

http://imagebin.org/208162

Renamed "Open time preferences..." menuitem to "Time preferences...".
Renamed "Show Time" and "Hide Time" to "Show time" and "Hide time".

Other changes include refactoring the header files a bit. There were a lot
of headers included by header files uneccessarily. For instance BarWindow.h
now only includes <Window.h> and <Deskbar.h>. This change is mainly to
to speed up the compile time since it takes a while right now.

I copy the fBarView pointer from BarWindow in the BarApp constructor and then
use that throughout the file rather than getting the pointer from the window
each time by calling BarView(). BarView() is still available in the header
for other classes though.

I moved some message constants around since it was getting a bit jumbled.
Most of the messages related to settings are in PreferenceWindow.h.
fChangeState is moved to BarView.h since that is where the ChangeState()
function is and BarView.cpp uses that constant.

The time interval and format constants are in TimeView.h.

Make some methods public in their respective classes where it made sense.
The preference window methods to update dependent items are public, that
might get called from BarWindow when a message gets received at some point.

Also made ShowHideTime() and Time() public in StatusView.h. These methods
activate showing and hiding the clock and return the fTime clock object.
No reason they should be private.

I reindented the StatusView.h and PreferenceWindow.h headers to the standard
style. Question here, are the public: protected: and private: lines inside
of classes suppose to get indented 1 tab or not? I've seen both, the style
guide says no indent but 1 indent seems reasonable and looks pretty good.

Style fixes here and there. That's enough for one commit I think.


# 573f748c 09-Apr-2012 John Scipione <jscipione@gmail.com>

Add 12/24 hour and time formatting options to Deskbar.

* 12/24 hour settings come from and alter BLocale
* Time formats are short, medium, long. Short is default. Come from
Locale kit.
* Don't delete fClock (now fTime) when hiding, just hide and show
the view.
* BarView now has nothing to do with setting or keeping track of
time settings. This is all handled in TTimeView. TReplicantTray
is responsible for updating the replicant tray and doing showing
and hiding. TTimeView is responsible for drawing according to the
clock settings.
* Remove fShowInterval and fShowSeconds from BarView
* Remove ampmMode setting and replace it with timeFormat.
* Reset targets in DeskbarMenu.

Originally I was trying to solve a bug where the TTimeView
was relying on the Deskbar settings too much. The settings
should only by set on quit and accessed on startup or a crash can
cause Deskbar to be in an unusual state.

I realize that the timezone is not very helpful. I'd like to provide
the day of week in a short format instead, i.e. Wed for Wednesday or
similar based on your locale. Blame the Locale Kit for now allowing
me to be able to use a custom TimeFormat. Once a custom TimeFormats
becomes possible from the Locale Kit Deskbar can be updated to use
them.


# d0a49328 07-Apr-2012 John Scipione <jscipione@gmail.com>

Fix a few more bugs in Deskbar, find a new one too.

Hiding in horizontal mode was leaving behind a white bar because the
window was getting hidden but the view not resized. Now fixed.

Moved simple state and member access function implementations from
BarView.cpp to BarView.h. Always use the local variable in BarView.cpp
to avoid a function call.

Rename Expando() to ExpandoState() and add FullState() and MiniState()
methods to BarView.h.

Call just PlaceApplicationBar() in vertical expando mode when resizing
icons. Call the full UpdatePlacement() in horizontal mode because I need
to update the height of the status tray when icons resize. Do not call
any method in MiniState because the icons will get resized when the
menu gets opened later.

The new bug I found is a little subtle. If you hide the clock by right
clicking on the clock and selecting Hide clock then quit deskbar with
'hey Deskbar QUIT' and restart Deskbar with 'Deskbar' the Show seconds
checkbox in the preference is disabled correctly, however, right clicking
Show Clock doesn't undisable the checkbox so you can no longer hide
seconds anymore. I'll fix this in a bit.


# 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.


# 3e6ff860 30-Oct-2011 Rene Gollent <anevilyak@gmail.com>

Rework Deskbar's tray replicant support a bit. Instead of relying on a live query
for be:deskbar_item_status in order to determine which replicants are supposed to
be living in the tray, a list of entry refs is now stored. While the former approach
was cool, it doesn't really work in either a multiuser or a package-aware world, where
executables are generally read-only. Note this means you'll lose your existing replicants
the first time you run this new revision, and need to re-add them.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43004 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


# e2700599 06-Jul-2011 Axel Dörfler <axeld@pinc-software.de>

* Applied a patch of x-ist that implements auto hide functionality with minor
coding style changes by myself.
* Thanks, and sorry for the long delay!


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


# 560ff447 25-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Use resource definition files instead of DoCatalogs rule. Rename B_TRANSLATE_APP_NAME and related macros to the more generic B_TRANSLATE_SYSTEM_NAME, to also fits add-ons, folders, etc, and make 'System name' its standard context. Change CodyCam and PoorMan's app signatures to match the overall x-vnd.Haiku-App pattern. Some clean-up. Make SlideShowSaver build again.

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


# 066522e8 14-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Localization changes. Use of B_TRANSLATE_APP_NAME(). Small cleanups.

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


# 1075cc34 05-Mar-2011 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

Missed these as part of r40817. Style cleanup by John Scipione from bug 7052.


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


# cd7548f5 04-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Some apps get the name lookup attribute.

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


# 74c7ad20 01-Jan-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Set B_NOT_RESIZABLE for the deskbar and the desktop window. Fixes #6999.


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


# 4c139440 17-Jun-2010 Axel Dörfler <axeld@pinc-software.de>

* Only move the window when we were targeted. This fixes #6179.
* I wondered if I should make BWindow::_IsFocusMessage() public - it determines
whether or not the message was retrieved via normal focus, or via the
SetEventMask() functionality. Any opinions?


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


# 59eae96d 22-May-2010 Axel Dörfler <axeld@pinc-software.de>

* Forgot to check against the other modifiers; the Vulcan Death Grip should now
work again, thanks humdinger!


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


# ebed8003 21-May-2010 Axel Dörfler <axeld@pinc-software.de>

* Operator precedence bit me, Deskbar is working again.


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


# ca9acc20 21-May-2010 Axel Dörfler <axeld@pinc-software.de>

* 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


# 5b576468 01-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Removed (incorrect) check in ServerWindow::NotifyMinimize() for
B_NOT_MINIMIZABLE; it should still be possible to hide an application
programmatically.
* The decorators now honor this flag, though.
* And the Deskbar overrides BWindow::Minimize() to ignore all minimize requests.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34404 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


# 72f5ac30 27-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Made Deskbar not minimizable as well.
* Automatic whitespace cleanup.


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


# 35c6651c 30-Aug-2008 Karsten Heimrich <host.haiku@gmx.de>

* remove HIDE_ APPLICATION shortcut, feel free to revert if this is wanted



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


# ced3755c 28-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Fixed a memory leak in Deskbar's BarWindow.cpp when adding a deskbar
replicant failed as pointed out by Mark Hellegers.
* Clarified ownership of the passed in message in TReplicantTray::AddIcon()
as well as BShelf::_AddReplicant().


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


# f8ab4e92 14-Aug-2007 Axel Dörfler <axeld@pinc-software.de>

Fixed the auto-raise "menus don't work anymore" bug.


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


# 0a201be4 14-Aug-2007 Axel Dörfler <axeld@pinc-software.de>

* Found out what the overridden DispatchMessage() is supposed to do.
* Disabled activating the window on mouse click when auto-raise is active, as that
doesn't work well in combination.


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


# 4446e07a 23-Jan-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Use BMenu::RemoveItems() instead of looping... I hope I caught all
occurrences.


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


# a5210ab1 11-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

Imported files from OT-current:
* ExpandoMenuBar.cpp 1.18
* CalendarMenuItem.cpp 1.6
* WindowMenu.cpp 1.3
* TimeView.cpp 1.14
* StatusView.cpp 1.18
* BarWindow.cpp 1.8


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


# 3702e473 17-May-2006 Stephan Aßmus <superstippi@gmx.de>

synced to 1.8 from OpenTracker CVS

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


# 7da06231 01-Jan-2006 Axel Dörfler <axeld@pinc-software.de>

Imported Deskbar from OpenTracker-current.


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


# 4a71b881 14-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Final GCC 4 fixes by Ingo Weinhold (were not visible before, due to a missing -no-undefined).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14918 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


# 0fc30d893468d504ba14cb3685ae45c1309290e3 09-Apr-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

Deskbar: Sanitize the usage of BMessage

... especially for SendMessage and SendReply.
* Delete the item's message if AddItem does not return successfully.
* Fixes #11934.

Signed-off-by: Adrien Destugues <pulkomandy@gmail.com>


# 039f59262a5e56d1a577b183b3ad712c9f690f96 03-Mar-2015 John Scipione <jscipione@gmail.com>

Tracker, Deskbar, ShowImage: move public commands

... to tracker_private.h so they may be used by external apps
such as Deskbar and ShowImage. Remove PublicCommands.h


# 85529c12b84a608d8cdc3e880922e3f60f2a4113 05-Feb-2015 Jessica Hamilton <jessica.l.hamilton@gmail.com>

Deskbar: fix showing an empty leaf menu, #3105.

* NeedsToRebuild() didn't actually do anything, as this
returns whether it needs to be rebuilt or not.
* Replaced RemoveItems() with ForceRebuild(), which should
already delete the menu items, whilst additionally
letting the leaf menu know that it needs to rebuild itself.

This bug was reproducible 100%; however, with this fix, there
is now a rare race condition where clicking between an app menu
and the leaf menu will result in both menus showing concurrently.


# 26ea70667a0c3c6274e6bbe91646a74b59a9e8b1 29-Jun-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Deskbar: use a virtual directory for the user-configurable menu

* Deskbar now uses ~/config/settings/deskbar/menu_entries for its menu,
falling back to /system/data/deskbar/menu_entries, when the former
doesn't exist. The latter always exists and is a virtual directory
merging the deskbar/menu subdirectories of ~/config/settings/ and
<any installation location>/data/. So, if a package provides a
deskbar menu symlink, it is added automatically when the package is
activated. The user can add own menu items by putting stuff into
~/config/settings/deskbar/menu/, only use their own organization by
symlinking it to menu_entries, or do fun stuff by making menu_entries
a customized virtual directory.
* HaikuImage: No longer create any deskbar menu symlinks in the user's
settings directory. Instead add them to the Haiku package.
* OptionalPackages: At least for the optional packages that do have
hpkgs, no longer create deskbar menu symlinks in the user's settings
directory.
* Move all Deskbar settings files to ~/config/settings/deskbar/ and
drop the "Deskbar_" prefix.


# fe624b3937dc8b7a4551dbc66b5e5c81dfb468d6 13-Apr-2013 John Scipione <jscipione@gmail.com>

Style fixes only

Most indentation and newlines with a few comment updates


# e963289800007e623f4a120b27e7bd476230f57f 09-Aug-2012 Alex Smith <alex@alex-smith.me.uk>

Added Tracker and Deskbar to x86_64 build.


# 22812ba24ffdc5c1a1f30257bc01ce9b4b211d47 05-May-2012 Rene Gollent <anevilyak@gmail.com>

Fix ticket #8497.

- Rework Deskbar's handling for the autoraise/autohide cases to not
need event masks. This prevents various problems that would occur
if one happened to be working in another window that overlapped part
of Deskbar, as reported in #8497. Instead, we now use a message filter
to redirect the messages as needed.


# 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.


# 546208a53940a26c6379c48a7854ade1a8250fc5 16-Apr-2012 Oliver Tappe <zooey@hirschkaefer.de>

More catalog-related cleanup.

* rename B_TRANSLATE_CONTEXT to B_TRANSLATION_CONTEXT and
B_TRANSLATE_WITH_CONTEXT to B_TRANSLATE_CONTEXT, squashing a TODO
* adjust all uses of both macros in Haiku's source tree
* use correct header guard for collecting/Catalog.h

The renamed macros require adjustments to all external applications
using catalogs.


# b932a5a45f86add0cdfca66be71bba585b338588 15-Apr-2012 John Scipione <jscipione@gmail.com>

Fix bug #8004

Dragging the Deskbar with CTRL+ALT+mouse not possible with
Auto-raise and Auto-hide disabled.

The reason this only worked with auto-raise or auto-hide enabled
is because the EventMask on BarView was only set to received mouse
events when those were settings were enabled. Apparently someone
figured this out. So, to fix this bug I set BarView to always
accept mouse events. Doesn't appear to have any obvious negative
consequences. Auto-hide and auto-raise still work.

I also added a comment in BarWindow::MenusBeginning(). It is
setting the EventMask of BarView to 0 and then back again in
TBarWindow::MenusEnded() to get around a bug in BeOS (according
to the comment anyway). I took out those lines and didn't notice
anything different so I assume that whatever the bug was it is
fixed and now and we can take those lines out permenantly.


# 3cf2d117e570356c8487e67a0e38b09b1639ab6c 14-Apr-2012 John Scipione <jscipione@gmail.com>

Change Time Format Options in Deskbar preferences.

Added two new methods to the Locale Kit in order to create a custom time
formats from a format string. One method is outputs into a char* array,
the other into a BString() and you can set the timezone.

These methods should be cleaned up, we only need 2, one to get
the time in a predefined style, the other to get a custom time format.
Also should probably do the same for dates and datetimes. But I'll let
this go for now.

I added myself to the Locale.cpp file. I retained the copyright instead
of assigning it to Haiku, Inc. because the file is under the OpenBeOS
license and I don't know what the concequences of copyright sharing are
for that license, unlike MIT.

These new methods are used to generate custom time formats in Deskbar.
Instead of using a set of Radio Buttons to choose between the predefined
time options I build my own by creating a format string and passing it
to the Locale Kit. The format string is generated from 3 checkboxes,
show seconds, show day of week, and show time zone. You can mix and match
between them choose any that you like. By default they are all off.

There are 3 new deskbar settings associated with these new options:
showSeconds, showDayOfWeek, and showTimeZone. timeFormat has gone away.

The time format string gets cached and updated only when Update() gets called
on the TimeView class.

In order to fit all the options in (there is 1 more than before) I had to
reduce the font size of the clock to 11pt when all options are turned on in
12 hour mode. For those with no imagination it looks like this:

http://imagebin.org/208162

Renamed "Open time preferences..." menuitem to "Time preferences...".
Renamed "Show Time" and "Hide Time" to "Show time" and "Hide time".

Other changes include refactoring the header files a bit. There were a lot
of headers included by header files uneccessarily. For instance BarWindow.h
now only includes <Window.h> and <Deskbar.h>. This change is mainly to
to speed up the compile time since it takes a while right now.

I copy the fBarView pointer from BarWindow in the BarApp constructor and then
use that throughout the file rather than getting the pointer from the window
each time by calling BarView(). BarView() is still available in the header
for other classes though.

I moved some message constants around since it was getting a bit jumbled.
Most of the messages related to settings are in PreferenceWindow.h.
fChangeState is moved to BarView.h since that is where the ChangeState()
function is and BarView.cpp uses that constant.

The time interval and format constants are in TimeView.h.

Make some methods public in their respective classes where it made sense.
The preference window methods to update dependent items are public, that
might get called from BarWindow when a message gets received at some point.

Also made ShowHideTime() and Time() public in StatusView.h. These methods
activate showing and hiding the clock and return the fTime clock object.
No reason they should be private.

I reindented the StatusView.h and PreferenceWindow.h headers to the standard
style. Question here, are the public: protected: and private: lines inside
of classes suppose to get indented 1 tab or not? I've seen both, the style
guide says no indent but 1 indent seems reasonable and looks pretty good.

Style fixes here and there. That's enough for one commit I think.


# 573f748c5f8fb7ed75beb0ceb7eb097d3ab0c038 09-Apr-2012 John Scipione <jscipione@gmail.com>

Add 12/24 hour and time formatting options to Deskbar.

* 12/24 hour settings come from and alter BLocale
* Time formats are short, medium, long. Short is default. Come from
Locale kit.
* Don't delete fClock (now fTime) when hiding, just hide and show
the view.
* BarView now has nothing to do with setting or keeping track of
time settings. This is all handled in TTimeView. TReplicantTray
is responsible for updating the replicant tray and doing showing
and hiding. TTimeView is responsible for drawing according to the
clock settings.
* Remove fShowInterval and fShowSeconds from BarView
* Remove ampmMode setting and replace it with timeFormat.
* Reset targets in DeskbarMenu.

Originally I was trying to solve a bug where the TTimeView
was relying on the Deskbar settings too much. The settings
should only by set on quit and accessed on startup or a crash can
cause Deskbar to be in an unusual state.

I realize that the timezone is not very helpful. I'd like to provide
the day of week in a short format instead, i.e. Wed for Wednesday or
similar based on your locale. Blame the Locale Kit for now allowing
me to be able to use a custom TimeFormat. Once a custom TimeFormats
becomes possible from the Locale Kit Deskbar can be updated to use
them.


# d0a49328634b3702d647e27b8704a3ce706074b8 07-Apr-2012 John Scipione <jscipione@gmail.com>

Fix a few more bugs in Deskbar, find a new one too.

Hiding in horizontal mode was leaving behind a white bar because the
window was getting hidden but the view not resized. Now fixed.

Moved simple state and member access function implementations from
BarView.cpp to BarView.h. Always use the local variable in BarView.cpp
to avoid a function call.

Rename Expando() to ExpandoState() and add FullState() and MiniState()
methods to BarView.h.

Call just PlaceApplicationBar() in vertical expando mode when resizing
icons. Call the full UpdatePlacement() in horizontal mode because I need
to update the height of the status tray when icons resize. Do not call
any method in MiniState because the icons will get resized when the
menu gets opened later.

The new bug I found is a little subtle. If you hide the clock by right
clicking on the clock and selecting Hide clock then quit deskbar with
'hey Deskbar QUIT' and restart Deskbar with 'Deskbar' the Show seconds
checkbox in the preference is disabled correctly, however, right clicking
Show Clock doesn't undisable the checkbox so you can no longer hide
seconds anymore. I'll fix this in a bit.


# 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.


# 3e6ff860b4f9cd789a091250a8923023bbe0ce91 30-Oct-2011 Rene Gollent <anevilyak@gmail.com>

Rework Deskbar's tray replicant support a bit. Instead of relying on a live query
for be:deskbar_item_status in order to determine which replicants are supposed to
be living in the tray, a list of entry refs is now stored. While the former approach
was cool, it doesn't really work in either a multiuser or a package-aware world, where
executables are generally read-only. Note this means you'll lose your existing replicants
the first time you run this new revision, and need to re-add them.



git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43004 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


# e27005998f2cb3d61a7a95e97ff9b5bcbd3eadd6 06-Jul-2011 Axel Dörfler <axeld@pinc-software.de>

* Applied a patch of x-ist that implements auto hide functionality with minor
coding style changes by myself.
* Thanks, and sorry for the long delay!


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


# 560ff4478d5c85455ea3e5ed5e392ef93132d545 25-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Use resource definition files instead of DoCatalogs rule. Rename B_TRANSLATE_APP_NAME and related macros to the more generic B_TRANSLATE_SYSTEM_NAME, to also fits add-ons, folders, etc, and make 'System name' its standard context. Change CodyCam and PoorMan's app signatures to match the overall x-vnd.Haiku-App pattern. Some clean-up. Make SlideShowSaver build again.

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


# 066522e87b5aa9f25957e3f419ac3a0565edbb4f 14-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Localization changes. Use of B_TRANSLATE_APP_NAME(). Small cleanups.

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


# 1075cc34a094612437a6c05c4c4b6cb9863cbe2d 05-Mar-2011 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

Missed these as part of r40817. Style cleanup by John Scipione from bug 7052.


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


# cd7548f537d5833b7ec6e6c09f0cf984fd53b422 04-Mar-2011 Jonas Sundström <jonas@kirilla.com>

Some apps get the name lookup attribute.

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


# 74c7ad20f4ede5bc7fb21cde26a3ee44b599e232 01-Jan-2011 Ingo Weinhold <ingo_weinhold@gmx.de>

Set B_NOT_RESIZABLE for the deskbar and the desktop window. Fixes #6999.


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


# 4c139440d0a017d214046b7db310c8bad6fd1a58 17-Jun-2010 Axel Dörfler <axeld@pinc-software.de>

* Only move the window when we were targeted. This fixes #6179.
* I wondered if I should make BWindow::_IsFocusMessage() public - it determines
whether or not the message was retrieved via normal focus, or via the
SetEventMask() functionality. Any opinions?


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


# 59eae96d68114e5c957d8cc222df5f7c42b46603 22-May-2010 Axel Dörfler <axeld@pinc-software.de>

* Forgot to check against the other modifiers; the Vulcan Death Grip should now
work again, thanks humdinger!


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


# ebed80035f35a962cce684bd102e25b40ed22af6 21-May-2010 Axel Dörfler <axeld@pinc-software.de>

* Operator precedence bit me, Deskbar is working again.


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


# ca9acc20e8829812353a19093c3e9cfa076a06b1 21-May-2010 Axel Dörfler <axeld@pinc-software.de>

* 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


# 5b576468d3f483cb15a5408ec955b60e5dcbfa84 01-Dec-2009 Axel Dörfler <axeld@pinc-software.de>

* Removed (incorrect) check in ServerWindow::NotifyMinimize() for
B_NOT_MINIMIZABLE; it should still be possible to hide an application
programmatically.
* The decorators now honor this flag, though.
* And the Deskbar overrides BWindow::Minimize() to ignore all minimize requests.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34404 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


# 72f5ac30dfd90c4057e736a0cf3995dc714483cd 27-Jul-2009 Axel Dörfler <axeld@pinc-software.de>

* Made Deskbar not minimizable as well.
* Automatic whitespace cleanup.


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


# 35c6651cfd40a771f9fdee08343bd79de2492f37 30-Aug-2008 Karsten Heimrich <host.haiku@gmx.de>

* remove HIDE_ APPLICATION shortcut, feel free to revert if this is wanted



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


# ced3755c30e6d91cb23175a888f32355401fe39d 28-Mar-2008 Axel Dörfler <axeld@pinc-software.de>

* Fixed a memory leak in Deskbar's BarWindow.cpp when adding a deskbar
replicant failed as pointed out by Mark Hellegers.
* Clarified ownership of the passed in message in TReplicantTray::AddIcon()
as well as BShelf::_AddReplicant().


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


# f8ab4e92ed4e5b3bf3b0b2030ade7e6d8bf6048a 14-Aug-2007 Axel Dörfler <axeld@pinc-software.de>

Fixed the auto-raise "menus don't work anymore" bug.


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


# 0a201be444cf2248a29e63a4e100ab3e6456fd0d 14-Aug-2007 Axel Dörfler <axeld@pinc-software.de>

* Found out what the overridden DispatchMessage() is supposed to do.
* Disabled activating the window on mouse click when auto-raise is active, as that
doesn't work well in combination.


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


# 4446e07ae9dd2e256bb46cde35f05890515a1f70 23-Jan-2007 Stefano Ceccherini <stefano.ceccherini@gmail.com>

Use BMenu::RemoveItems() instead of looping... I hope I caught all
occurrences.


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


# a5210ab17da5a6784a814bb69c59ba6bf5401432 11-Aug-2006 Axel Dörfler <axeld@pinc-software.de>

Imported files from OT-current:
* ExpandoMenuBar.cpp 1.18
* CalendarMenuItem.cpp 1.6
* WindowMenu.cpp 1.3
* TimeView.cpp 1.14
* StatusView.cpp 1.18
* BarWindow.cpp 1.8


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


# 3702e4734ea90aa8f3fad41348975048a22fa2b6 17-May-2006 Stephan Aßmus <superstippi@gmx.de>

synced to 1.8 from OpenTracker CVS

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


# 7da062312a13b77ed1aac63bdd67c44c44ad5824 01-Jan-2006 Axel Dörfler <axeld@pinc-software.de>

Imported Deskbar from OpenTracker-current.


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


# 4a71b881a912026bb1d59922b619c17edd72771b 14-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

Final GCC 4 fixes by Ingo Weinhold (were not visible before, due to a missing -no-undefined).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14918 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