History log of /haiku/src/apps/deskbar/BarWindow.h
Revision Date Author Comments
# 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>


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


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


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


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


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


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


# 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


# 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


# 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


# 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


# 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


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


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


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


# 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


# 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


# 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


# 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


# 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