History log of /haiku/src/apps/deskbar/TruncatableMenuItem.cpp
Revision Date Author Comments
# 15eb397e 19-Jul-2018 John Scipione <jscipione@gmail.com>

Deskbar: Adjust team menu items with font size.

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

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

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

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

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

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

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

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


# 9e11c3ad 02-Apr-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

Deskbar: No need to use dynamic allocation, remove unused headers.

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


# 4473bf2c 20-Feb-2015 John Scipione <jscipione@gmail.com>

Deskbar: truncate full window titles

The truncation code was truncating window titles earlier than it should because
it was mistakenly leaving room for the expander arrows when it should only be
looking for those on team menu items, not window menu items.

Sorry for the regression.


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

Deskbar: Save String object instead of pointer

And add a SetLabel() that sets the truncated label when the label gets set.

This will be useful so we can compare the truncated label to the normal label
to tell if the label is truncated or not.


# 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


# 9e11c3adb1eb18ab7cce6b8cf32dfc005369af03 02-Apr-2015 Dario Casalinuovo <b.vitruvio@gmail.com>

Deskbar: No need to use dynamic allocation, remove unused headers.

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


# 4473bf2ceada738be4b86a41b69dbcc7b60daaaa 20-Feb-2015 John Scipione <jscipione@gmail.com>

Deskbar: truncate full window titles

The truncation code was truncating window titles earlier than it should because
it was mistakenly leaving room for the expander arrows when it should only be
looking for those on team menu items, not window menu items.

Sorry for the regression.


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

Deskbar: Save String object instead of pointer

And add a SetLabel() that sets the truncated label when the label gets set.

This will be useful so we can compare the truncated label to the normal label
to tell if the label is truncated or not.


# 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