From ac121994b122349558d8621012759d23c8609c8d Mon Sep 17 00:00:00 2001 From: John Scipione Date: Fri, 13 Oct 2023 13:09:58 -0400 Subject: [PATCH] Deskbar: Set sub-menus to menu font Top level "menu" still uses be_plain_font, submenus use menu font. Window submenus use menu font, but in super-expando mode they use the plain font since they are on top level. Change-Id: I704e9baa1ec46d1cbf7b9401ba4e49b5e2dff27c Reviewed-on: https://review.haiku-os.org/c/haiku/+/7041 Reviewed-by: waddlesplash Tested-by: Commit checker robot --- src/apps/deskbar/DeskbarMenu.cpp | 2 -- src/apps/deskbar/StatusView.cpp | 1 - src/apps/deskbar/TeamMenu.cpp | 1 - src/apps/deskbar/TeamMenuItem.cpp | 7 ++++++- src/apps/deskbar/WindowMenu.cpp | 1 - src/apps/deskbar/WindowMenuItem.cpp | 7 ++++++- 6 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/apps/deskbar/DeskbarMenu.cpp b/src/apps/deskbar/DeskbarMenu.cpp index 1381089378..3e0085189f 100644 --- a/src/apps/deskbar/DeskbarMenu.cpp +++ b/src/apps/deskbar/DeskbarMenu.cpp @@ -315,7 +315,6 @@ B_TRANSLATE_MARK_VOID("About this system") } #endif - shutdownMenu->SetFont(be_plain_font); shutdownMenu->SetTargetForItems(be_app); BMessage* message = new BMessage(kShutdownSystem); @@ -655,7 +654,6 @@ TRecentsMenu::ResetTargets() DeskbarMountMenu::DeskbarMountMenu(const char* name) : BPrivate::MountMenu(name) { - SetFont(be_plain_font); } diff --git a/src/apps/deskbar/StatusView.cpp b/src/apps/deskbar/StatusView.cpp index a86ae9a730..830bdab37d 100644 --- a/src/apps/deskbar/StatusView.cpp +++ b/src/apps/deskbar/StatusView.cpp @@ -432,7 +432,6 @@ void TReplicantTray::ShowReplicantMenu(BPoint point) { BPopUpMenu* menu = new BPopUpMenu("", false, false); - menu->SetFont(be_plain_font); // If clock is visible show the extended menu, otherwise show "Show clock" diff --git a/src/apps/deskbar/TeamMenu.cpp b/src/apps/deskbar/TeamMenu.cpp index 87d6b1389e..1adac2c884 100644 --- a/src/apps/deskbar/TeamMenu.cpp +++ b/src/apps/deskbar/TeamMenu.cpp @@ -63,7 +63,6 @@ TTeamMenu::TTeamMenu(TBarView* barView) fBarView(barView) { SetItemMargins(0.0f, 0.0f, 0.0f, 0.0f); - SetFont(be_plain_font); } diff --git a/src/apps/deskbar/TeamMenuItem.cpp b/src/apps/deskbar/TeamMenuItem.cpp index 9113437636..5ed2491ccd 100644 --- a/src/apps/deskbar/TeamMenuItem.cpp +++ b/src/apps/deskbar/TeamMenuItem.cpp @@ -512,7 +512,12 @@ TTeamMenuItem::_Init(BList* team, BBitmap* icon, char* name, char* signature, fBarView = static_cast(be_app)->BarView(); - BFont font(be_plain_font); + // use menu font (parent font not available yet) + menu_info info; + get_menu_info(&info); + BFont font; + font.SetFamilyAndStyle(info.f_family, info.f_style); + font.SetSize(info.font_size); fLabelWidth = ceilf(font.StringWidth(name)); font_height fontHeight; font.GetHeight(&fontHeight); diff --git a/src/apps/deskbar/WindowMenu.cpp b/src/apps/deskbar/WindowMenu.cpp index 8d1781a37c..6c07d1ffd5 100644 --- a/src/apps/deskbar/WindowMenu.cpp +++ b/src/apps/deskbar/WindowMenu.cpp @@ -82,7 +82,6 @@ TWindowMenu::TWindowMenu(const BList* team, const char* signature) void TWindowMenu::AttachedToWindow() { - SetFont(be_plain_font); RemoveItems(0, CountItems(), true); int32 miniCount = 0; diff --git a/src/apps/deskbar/WindowMenuItem.cpp b/src/apps/deskbar/WindowMenuItem.cpp index ced98e7f2d..e1b98f97e0 100644 --- a/src/apps/deskbar/WindowMenuItem.cpp +++ b/src/apps/deskbar/WindowMenuItem.cpp @@ -272,7 +272,12 @@ TWindowMenuItem::_Init(const char* name) TBarApp* app = static_cast(be_app); fBitmap = app->FetchWindowIcon(fIsLocal, fIsMinimized); - BFont font(be_plain_font); + // use menu font (parent font not available yet) + menu_info info; + get_menu_info(&info); + BFont font; + font.SetFamilyAndStyle(info.f_family, info.f_style); + font.SetSize(info.font_size); fLabelWidth = ceilf(font.StringWidth(name)); font_height fontHeight; font.GetHeight(&fontHeight);