1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:17:36 +00:00

NotificationServer: Allow showing an icon in notifications

We currently use icon paths for this because I didn't want to deal with
implementing icon bitmap sharing right now. In the future it would be
better to post a bitmap somehow instead of a path.
This commit is contained in:
Andreas Kling 2020-03-26 20:38:28 +01:00
parent 3c29818048
commit faedb763ca
7 changed files with 24 additions and 9 deletions

View file

@ -36,13 +36,16 @@ int main(int argc, char** argv)
Core::ArgsParser args_parser;
const char* title = nullptr;
const char* message = nullptr;
const char* icon_path = nullptr;
args_parser.add_positional_argument(title, "Title of the notification", "title");
args_parser.add_positional_argument(message, "Message to display in the notification", "message");
args_parser.add_positional_argument(icon_path, "Path of icon to display in the notification", "icon-path", Core::ArgsParser::Required::No);
args_parser.parse(argc, argv);
auto notification = GUI::Notification::construct();
notification->set_text(message);
notification->set_title(title);
notification->set_icon_path(icon_path);
notification->show();
return 0;