History log of /haiku/src/apps/deskbar/StatusView.h
Revision Date Author Comments
# 605761f4 01-Sep-2022 John Scipione <jscipione@gmail.com>

Deskbar: Calculate clock margin based on font size

Based off of tray padding instead of hard-coding 12. Calculate tray
padding once in AttachedToWindow() and use that value everywhere.
Create some class float member variables to keep track of these values.

Fixes #17923

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


# fac73deb 29-Aug-2022 Augustin Cavalier <waddlesplash@gmail.com>

Deskbar: Compute basic metrics earlier, in TBarApp::InitSettings().

This way we know the minimum and maximum window width earlier
and consumers of them do not come up with "0" incorrectly.

Fixes #17890.


# 9f4bb0f5 26-Aug-2022 Augustin Cavalier <waddlesplash@gmail.com>

Deskbar: Compute more metrics instead of hardcoding them.


# 1e0308a8 25-Aug-2022 Augustin Cavalier <waddlesplash@gmail.com>

Deskbar: Use BControlLook::ComposeIconSize() and other metrics routines.

This gets Deskbar looking somewhat more like its usual self in HiDPI
environments. There are still some hardcoded sizes which need to be
refactored, however.


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


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


# 1dd1976f 03-Jan-2018 John Scipione <jscipione@gmail.com>

Deskbar: update time width based on Deskbar orientation.

Fixes #8641

To fix this bug first I had to fix a long-standing todo:
TODO: SetOrientation never gets called, fix that when in vertical mode,
we want to limit the width so that it can't overlap the bevels in the
parent view.

I made TBarView a friend class of TReplicantTray and called
fReplicantTray->fTime->SetOrientation() when switching between
horizontal and vertical mode. I could have added a setter method
instead but I didn't feel like it was worth it.

SetOrientation calls ResizedToPreferred which calls GetPreferredSize,
which resizes the text width, then it calls CalculateTextPlacement
which places the time string correctly.

Removed GetCurrentTime invocation from GetPreferredSize since that
happens in Update already. Was added in
573f748c5f8fb7ed75beb0ceb7eb097d3ab0c038 originally.

Also need to call SetOrientation in TReplicantTray::AttachedToWindow
just after creating the TTime object in order for it to resize the
time view correctly on startup in horizontal mode. It needs to know
that it is horizontal so that it will expand to fit longer than
default time string.


# 7b7bf68d 23-Oct-2017 John Scipione <jscipione@gmail.com>

Deskbar: create new constant kClockMargin and use it

defines the (minimum) margin between clock and replicant icons

Was used in a couple different forms, now all in 1 constant


# d8357181 23-Oct-2017 John Scipione <jscipione@gmail.com>

Minor whitespace style fix in TReplicantTray class

spacing private variables, no functional change intended.


# 32b0035a 23-Oct-2017 John Scipione <jscipione@gmail.com>

Deskbar: Rename some methods, variables, and call method

Rename IconCount() method to ReplicantCount()

Rename fChild and child to fReplicantTray and replicantTray


# 70ad5289 19-Oct-2017 John Scipione <jscipione@gmail.com>

Deskbar: Position clock & replicants better

This fixes some subtle layout issues. The replicant icon
positions and clock position has been made more consistent
in both vertical mode, and horizontal mode.

There is a fixed amount of space between the last replicant
and the clock before it wraps to next row. This now works
at different font sizes.

Use matching 3px of space between the clock and the dragger
on one side and and between the replicant and the dragger
on the other side.

Reparent ResizeControl from ReplicantTray onto DragRegion and
readjust everything.


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


# e4d65fe7 13-Dec-2016 John Scipione <jscipione@gmail.com>

Deskbar: Style fixes to StatusView
Deskbar: Minor style fixes in TimeView.cpp


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


# b49e806d 30-Mar-2015 Axel Dörfler <axeld@pinc-software.de>

Deskbar: minor style cleanup.


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


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


# 2ce9bab8 27-Jun-2011 John Scipione <jscipione@gmail.com>

Fisher Price Deskbar icon support

Implements the feature described in #7132
Also fixes #2387 (menu items too big in horizontal mode when font size > 12)

Adds a slider to Deskbar preferences which allows you to resize your Deskbar
team icons from 16x16 to 96x96. The default is 16x16. This works both in vertical
and horizontal mode.

In vertical mode when icon sizes are greater than 32x32 the label moves
underneath the icon where there is more room. In horizontal mode the width of
the menu item increases to make room for the icon while keeping room for the
label the same. As many applications are added the labels are truncated as usual.

This patch also adds a checkbox to the Deskbar preferences to hide application
names to make more room for icons if you wish. It doesn't make a lot of sense
at 16x16 but does >32x32.

If the kResizeTeamIcons message gets dropped, don't resize to current value,
just do nothing. This fixes a bug where sometimes the slider wouldn't trigger
a resize. Fix a spelling error in a comment. Take out a redundant paren pair.


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

Build fix.



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


# 7625ce51 30-Oct-2011 Rene Gollent <anevilyak@gmail.com>

Factor out an _SaveSettings() call to write back settings. Use it to commit tray item changes immediately instead of at Deskbar exit.


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


# 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


# 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


# 1ad8c760 06-Mar-2011 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

More style cleanup patches from John Scipione as part of #7052.


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


# 908d7185 22-Jan-2011 Rene Gollent <anevilyak@gmail.com>

Remove unused Draw function. Fixes CID 10350.


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


# 9e9c8091 20-Oct-2010 Rene Gollent <anevilyak@gmail.com>

Remove the "Full Date" setting and associated madness with respect to
the deskbar's current orientation. Instead, we now always show the full
date, but as a tooltip rather than switching the timeview's display
based on a mouse click.



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


# 2f0eb7b1 02-Jul-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* Introduce a new method in BCountry to get the first day of week (monday or sunday)
* Localize date in deskbar properly, and use the new API to show the calendar. The "show european date" checkbox is now gone.


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


# 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


# 6d01b66d 13-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

GCC 4 fixes by Ingo Weinhold.


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


# b49e806d3d560677f968daf1758d01cd791a1ba8 30-Mar-2015 Axel Dörfler <axeld@pinc-software.de>

Deskbar: minor style cleanup.


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


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


# 2ce9bab873e024bb515a95faf384df62b88bbb8c 27-Jun-2011 John Scipione <jscipione@gmail.com>

Fisher Price Deskbar icon support

Implements the feature described in #7132
Also fixes #2387 (menu items too big in horizontal mode when font size > 12)

Adds a slider to Deskbar preferences which allows you to resize your Deskbar
team icons from 16x16 to 96x96. The default is 16x16. This works both in vertical
and horizontal mode.

In vertical mode when icon sizes are greater than 32x32 the label moves
underneath the icon where there is more room. In horizontal mode the width of
the menu item increases to make room for the icon while keeping room for the
label the same. As many applications are added the labels are truncated as usual.

This patch also adds a checkbox to the Deskbar preferences to hide application
names to make more room for icons if you wish. It doesn't make a lot of sense
at 16x16 but does >32x32.

If the kResizeTeamIcons message gets dropped, don't resize to current value,
just do nothing. This fixes a bug where sometimes the slider wouldn't trigger
a resize. Fix a spelling error in a comment. Take out a redundant paren pair.


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

Build fix.



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


# 7625ce51505cad2b0b3b51cbc63ac0b205f2a9da 30-Oct-2011 Rene Gollent <anevilyak@gmail.com>

Factor out an _SaveSettings() call to write back settings. Use it to commit tray item changes immediately instead of at Deskbar exit.


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


# 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


# 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


# 1ad8c760ed6f0e7e30f5f3154b0c4639a77b0a1b 06-Mar-2011 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

More style cleanup patches from John Scipione as part of #7052.


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


# 908d7185b01b1a5a4d1fc23ed550d2c97117b06f 22-Jan-2011 Rene Gollent <anevilyak@gmail.com>

Remove unused Draw function. Fixes CID 10350.


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


# 9e9c8091e7ebc92a8808463b05dd4249ccb2f6d9 20-Oct-2010 Rene Gollent <anevilyak@gmail.com>

Remove the "Full Date" setting and associated madness with respect to
the deskbar's current orientation. Instead, we now always show the full
date, but as a tooltip rather than switching the timeview's display
based on a mouse click.



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


# 2f0eb7b11e9cdb428b2da5bfaac25c9998b02e03 02-Jul-2010 Adrien Destugues <pulkomandy@pulkomandy.ath.cx>

* Introduce a new method in BCountry to get the first day of week (monday or sunday)
* Localize date in deskbar properly, and use the new API to show the calendar. The "show european date" checkbox is now gone.


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


# 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


# 6d01b66d300c2841dba033705f120a7f6e709696 13-Nov-2005 Axel Dörfler <axeld@pinc-software.de>

GCC 4 fixes by Ingo Weinhold.


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