Tracker: Fixup hardcoded values for ModelMenuItem padding

This is to make BMenuBar and BMenu margins the same.

The hardcoded menu item margin numbers come from this math on what the
BMenu and BMenuBar item margins respectively used to be a long time ago:
14 - 8 = 6 // for left margin
(14 + 20) - (8 + 8) = 18 // for left + right margin

We have since updated these margins so they need to be recalculated.
Use BPrivate::MenuPrivate to get the new margin deltas.

IconMenuItem and ModelMenuItem classes are used by Tracker add-ons and
those can be in the menu bar as well.

Change-Id: Ie4147c31e6b19764cb36b9c414f7e91c47b7d9bd
Reviewed-on: https://review.haiku-os.org/c/haiku/+/8905
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Adrien Destugues <[email protected]>
This commit is contained in:
John Scipione
2025-02-05 16:38:08 +00:00
committed by Adrien Destugues
parent b5eb38ec58
commit 49d3b2a142
2 changed files with 63 additions and 7 deletions
+5
View File
@@ -104,6 +104,11 @@ class ModelMenuItem : public BMenuItem {
private:
void DrawIcon();
private:
float _ExtraLeftPadding();
float _ExtraPadding();
void _GetHorizontalItemMarginDelta(float* _leftDelta, float* _rightDelta);
Model fModel;
float fHeightDelta;
bool fDrawText;