hrev51299 adds 1 changeset to branch 'master'
old head: 1d6af34b9a21c2db96cefb4f5e14e217dd203672
new head: 1416521f1099252bb740e1e3d8991c716501e4da
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=1416521f1099+%5E1d6af34b9a21
----------------------------------------------------------------------------
1416521f1099: Notifications: default to application icon.
It is possible to SetIcon(NULL) to remove it.
But in msot cases we want the application icon to be the default.
as discussed in #13590.
[ Adrien Destugues <pulkomandy@xxxxxxxxxxxxx> ]
----------------------------------------------------------------------------
Revision: hrev51299
Commit: 1416521f1099252bb740e1e3d8991c716501e4da
URL: http://cgit.haiku-os.org/haiku/commit/?id=1416521f1099
Author: Adrien Destugues <pulkomandy@xxxxxxxxxxxxx>
Date: Sat Jul 22 14:11:25 2017 UTC
Ticket: https://dev.haiku-os.org/ticket/13590
----------------------------------------------------------------------------
1 file changed, 15 insertions(+)
src/kits/app/Notification.cpp | 15 +++++++++++++++
----------------------------------------------------------------------------
diff --git a/src/kits/app/Notification.cpp b/src/kits/app/Notification.cpp
index 7f38364..1a14d5e 100644
--- a/src/kits/app/Notification.cpp
+++ b/src/kits/app/Notification.cpp
@@ -19,6 +19,8 @@
#include <Bitmap.h>
#include <Message.h>
+#include <NodeInfo.h>
+#include <Roster.h>
BNotification::BNotification(notification_type type)
@@ -30,6 +32,19 @@ BNotification::BNotification(notification_type type)
fFile(NULL),
fBitmap(NULL)
{
+ int32 iconSize = B_LARGE_ICON;
+ fBitmap = new BBitmap(BRect(0, 0, iconSize - 1, iconSize - 1), 0,
B_RGBA32);
+ if (fBitmap) {
+ team_info teamInfo;
+ get_team_info(B_CURRENT_TEAM, &teamInfo);
+ app_info appInfo;
+ be_roster->GetRunningAppInfo(teamInfo.team, &appInfo);
+ if (BNodeInfo::GetTrackerIcon(&appInfo.ref, fBitmap,
+ icon_size(iconSize)) != B_OK) {
+ delete fBitmap;
+ fBitmap = NULL;
+ }
+ }
}