History log of /haiku/src/apps/deskbar/WindowMenuItem.h
Revision Date Author Comments
# fb885767 04-May-2023 John Scipione <jscipione@gmail.com>

Deskbar: Use hvif window icons & scale with font

Add vector rdefs for shown, hidden, shown switch
and hidden switch icons. Remove unused bitmap
resources. Add window switch vector icons to
artwork.

Create window icon cache in TBarApp and cache the
window icons based on font size.
Fixes memory leak in #18357.

Don't draw off-workspace lines in Switcher, use
switch icon for that instead. Fixes crash reported
in #18359. Position icon and window name better in
Switcher.

Put BarTeamInfo icon parameter last and make it
optional, the icon gets set by caching.

Enable team icon cache and window icon cache.

Fixes #14694

Deskbar: Scale Twitcher icons based on font size

Remove the point ctor parameter and deprecate the
switcherLoc setting by not using or setting it and
leaving it at its default value.

Center window on screen resolution change and
workspace change (as resolution may not match).

Fixes #17924

Change-Id: Ib63cc307f14cda397ffb66ea74091be59e6e5535
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6335
Reviewed-by: John Scipione <jscipione@gmail.com>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>


# 27b3dee8 11-Apr-2023 John Scipione <jscipione@gmail.com>

Revert "Deskbar: Use hvif window icons & scale with font"

This reverts commit 2b65e2d808b31a146569dd270b0e3fc0673471ba.


# 2b65e2d8 26-Mar-2023 John Scipione <jscipione@gmail.com>

Deskbar: Use hvif window icons & scale with font

Add rdef vector icons for shown, hidden, shown switch and
hidden switch. Reuse resource ids for vector icons. Remove
unused bitmap resources.

Fixes #17918.

Change-Id: I2ba1b126422f679c91f3272991c78d236198a358
Reviewed-on: https://review.haiku-os.org/c/haiku/+/6260
Tested-by: Automation <automation@haiku-os.org>
Reviewed-by: waddlesplash <waddlesplash@gmail.com>


# c38afcd6 19-Feb-2015 John Scipione <jscipione@gmail.com>

Deskbar: Remove Name() and fName, replace with Label()

... from TeamMenuItem and WindowMenuItem.

It was confusing having Name(), Label(), and TruncatedLabel().

Name() == Label() because Label() never changes, the displayed
Label stored in TruncatedLabel() in both TeamWindowItem and
WindowMenuItem (remember they both inherit from
TruncatableMenuItem so they get that for free). So Name() was
redundant, by getting rid of it there is just Label() and TruncatedLabel()
which is all we need!


# f11e0f20 19-Feb-2015 John Scipione <jscipione@gmail.com>

Deskbar: Rename header gaurds for WindowMenuItem


# c9363f78 19-Feb-2015 John Scipione <jscipione@gmail.com>

Deskbar: Truncate menu item labels refactor

* Create a new TTruncatableMenuItem class to store the truncated string
and share the label truncation code between TTeamMenuItem and
TWindowMenuItem. In the future more shared code may be added to
this class, if so, the class name may change.
* The TTeamMenuItem and TWindowMenuItem classes inherit from
TTruncatableMenuItem, which inherits from BMenuItem.
* Make sure to truncate the label before drawing it in all cases.
* Some other related refactoring.

Fixes #9507


# 5e625ead 12-Feb-2015 John Scipione <jscipione@gmail.com>

Deskbar: Label truncation code refactor & cleanup

* Increase kVPad to 2.0f in ExpandoMenuBar matching the
constant in WindowMenuItem
* Also replace a hardcoded instance of 4.0f with kVPad * 2
* Remove TTeamMenuItem::DrawContentLabel(), move code to DrawContent()
* Cleanup label truncation code in TTeamMenuItem, still needs work.
* Rename WindowMenuItem::FullTitle() to Name() matching TeamMenuItem
* Move the code to set all label related variables in SetLabel() in
TeamMenuItem
* Change WindowMenuItem::SetRequireUpdate() to take a bool parameter
* Make WindowMenuItem::Initialize() private and rename it to _Init()
* Rename WindowMenuItem::ExpandedItem() to SetExpanded()
* Truncate WindowMenuItem label like we are doing TeamMenuItem
* Rename all WindowMenuItem::Title* methods and variables to Label*


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


# 1687edd0 06-Mar-2011 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

Final set of style cleanup patches by John Scipione as part of #7052.


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


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

* Moved the window item sort logic as static method into the TWindowMenuItem
class.
* Changed ExpandoMenuBar to use that logic as well, so that your entries will
always keep the same sort order.


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


# b8beeb35 12-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* The Switcher now uses the new application/window order functions to sort
the application/window lists before using them.
* This means that you can now switch just between the two topmost apps when
pressing Control-Tab. If you press it fast enough, it will fall back to the
old method of iterating through all apps.
* Only define the private BeOS window management API for BeOS itself, for
Haiku, better use the private WindowInfo.h header.
* Changed BeOS's window_info structure to match how Haiku does it (improved
naming, separation between client_window_info and window_info).
* Whitespace cleanup.


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


# f6742aab 13-Jan-2008 Jérôme Duval <korli@users.berlios.de>

whitespaces => tab


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


# 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


# c38afcd62ca869cd169ed52fa171db35352bbd00 19-Feb-2015 John Scipione <jscipione@gmail.com>

Deskbar: Remove Name() and fName, replace with Label()

... from TeamMenuItem and WindowMenuItem.

It was confusing having Name(), Label(), and TruncatedLabel().

Name() == Label() because Label() never changes, the displayed
Label stored in TruncatedLabel() in both TeamWindowItem and
WindowMenuItem (remember they both inherit from
TruncatableMenuItem so they get that for free). So Name() was
redundant, by getting rid of it there is just Label() and TruncatedLabel()
which is all we need!


# f11e0f209c267b46ce366835a196fde363e7321d 19-Feb-2015 John Scipione <jscipione@gmail.com>

Deskbar: Rename header gaurds for WindowMenuItem


# c9363f78d67001545182ce032918648ccb3d6e16 19-Feb-2015 John Scipione <jscipione@gmail.com>

Deskbar: Truncate menu item labels refactor

* Create a new TTruncatableMenuItem class to store the truncated string
and share the label truncation code between TTeamMenuItem and
TWindowMenuItem. In the future more shared code may be added to
this class, if so, the class name may change.
* The TTeamMenuItem and TWindowMenuItem classes inherit from
TTruncatableMenuItem, which inherits from BMenuItem.
* Make sure to truncate the label before drawing it in all cases.
* Some other related refactoring.

Fixes #9507


# 5e625ead65c3e04f9246a0b47ba24cea15e75428 12-Feb-2015 John Scipione <jscipione@gmail.com>

Deskbar: Label truncation code refactor & cleanup

* Increase kVPad to 2.0f in ExpandoMenuBar matching the
constant in WindowMenuItem
* Also replace a hardcoded instance of 4.0f with kVPad * 2
* Remove TTeamMenuItem::DrawContentLabel(), move code to DrawContent()
* Cleanup label truncation code in TTeamMenuItem, still needs work.
* Rename WindowMenuItem::FullTitle() to Name() matching TeamMenuItem
* Move the code to set all label related variables in SetLabel() in
TeamMenuItem
* Change WindowMenuItem::SetRequireUpdate() to take a bool parameter
* Make WindowMenuItem::Initialize() private and rename it to _Init()
* Rename WindowMenuItem::ExpandedItem() to SetExpanded()
* Truncate WindowMenuItem label like we are doing TeamMenuItem
* Rename all WindowMenuItem::Title* methods and variables to Label*


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


# 1687edd0fde594cd6f7c88f58a264c4787b4327d 06-Mar-2011 Fredrik Holmqvist <fredrik.holmqvist@gmail.com>

Final set of style cleanup patches by John Scipione as part of #7052.


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


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

* Moved the window item sort logic as static method into the TWindowMenuItem
class.
* Changed ExpandoMenuBar to use that logic as well, so that your entries will
always keep the same sort order.


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


# b8beeb35eab7170de9f204f6e8c8fd60ea821d4f 12-Aug-2008 Axel Dörfler <axeld@pinc-software.de>

* The Switcher now uses the new application/window order functions to sort
the application/window lists before using them.
* This means that you can now switch just between the two topmost apps when
pressing Control-Tab. If you press it fast enough, it will fall back to the
old method of iterating through all apps.
* Only define the private BeOS window management API for BeOS itself, for
Haiku, better use the private WindowInfo.h header.
* Changed BeOS's window_info structure to match how Haiku does it (improved
naming, separation between client_window_info and window_info).
* Whitespace cleanup.


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


# f6742aab04209bd1973fb743c30c6c71578f25be 13-Jan-2008 Jérôme Duval <korli@users.berlios.de>

whitespaces => tab


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


# 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