From a657e677d9eca2c2c5f5a7b16aacaab1d0dbf5aa Mon Sep 17 00:00:00 2001 From: Brian Hill Date: Sun, 24 Sep 2017 14:49:25 -0400 Subject: [PATCH] Notification preflet and server changes Remove unneeded classes from preflet jamfile Fix some notification layout and bold text issues --- src/preferences/notifications/AppRefFilter.h | 6 +++--- src/preferences/notifications/Jamfile | 2 -- src/servers/notification/AppGroupView.cpp | 6 ++---- src/servers/notification/NotificationView.cpp | 6 ++---- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/preferences/notifications/AppRefFilter.h b/src/preferences/notifications/AppRefFilter.h index df9b4f2199..f882726963 100644 --- a/src/preferences/notifications/AppRefFilter.h +++ b/src/preferences/notifications/AppRefFilter.h @@ -2,8 +2,8 @@ * Copyright 2017, Haiku, Inc. All Rights Reserved. * Distributed under the terms of the MIT License. */ -#ifndef EP_APPREFFILTER_H -#define EP_APPREFFILTER_H +#ifndef _APP_REF_FILTER_H +#define _APP_REF_FILTER_H #include #include @@ -18,4 +18,4 @@ public: const char *filetype); }; -#endif +#endif // _APP_REF_FILTER_H diff --git a/src/preferences/notifications/Jamfile b/src/preferences/notifications/Jamfile index c44f1be4c7..4adc94d7dd 100644 --- a/src/preferences/notifications/Jamfile +++ b/src/preferences/notifications/Jamfile @@ -12,8 +12,6 @@ Application Notifications : SettingsPane.cpp GeneralView.cpp NotificationsView.cpp - ../../servers/notification/NotificationView.cpp - ../../servers/notification/AppGroupView.cpp : be translation tracker libcolumnlistview.a libnotification.a [ TargetLibstdc++ ] localestub : Notifications.rdef ; diff --git a/src/servers/notification/AppGroupView.cpp b/src/servers/notification/AppGroupView.cpp index f0d87c321c..b7d286568b 100644 --- a/src/servers/notification/AppGroupView.cpp +++ b/src/servers/notification/AppGroupView.cpp @@ -38,7 +38,7 @@ AppGroupView::AppGroupView(const BMessenger& messenger, const char* label) { SetFlags(Flags() | B_WILL_DRAW); - fHeaderSize = be_plain_font->Size() + fHeaderSize = be_bold_font->Size() + be_control_look->ComposeSpacing(B_USE_ITEM_SPACING); static_cast(GetLayout())->SetInsets(0, fHeaderSize, 0, 0); } @@ -92,9 +92,7 @@ AppGroupView::Draw(BRect updateRect) if (fCollapsed) label << " (" << fInfo.size() << ")"; - BFont boldFont(be_plain_font); - boldFont.SetFace(B_BOLD_FACE); - SetFont(&boldFont); + SetFont(be_bold_font); font_height fontHeight; GetFontHeight(&fontHeight); float y = (bounds.top + bounds.bottom - ceilf(fontHeight.ascent) diff --git a/src/servers/notification/NotificationView.cpp b/src/servers/notification/NotificationView.cpp index 0f5f98ea6b..aa89d54175 100644 --- a/src/servers/notification/NotificationView.cpp +++ b/src/servers/notification/NotificationView.cpp @@ -457,10 +457,8 @@ NotificationView::SetText(float newMaxWidth) else iconRight += 32; - BFont boldFont(be_plain_font); - boldFont.SetFace(B_BOLD_FACE); font_height fh; - boldFont.GetHeight(&fh); + be_bold_font->GetHeight(&fh); float fontHeight = ceilf(fh.leading) + ceilf(fh.descent) + ceilf(fh.ascent); float y = fontHeight + kEdgePadding * 2; @@ -468,7 +466,7 @@ NotificationView::SetText(float newMaxWidth) // Title LineInfo* titleLine = new LineInfo; titleLine->text = fNotification->Title(); - titleLine->font = boldFont; + titleLine->font = *be_bold_font; titleLine->location = BPoint(iconRight + kEdgePadding, y);