Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-shell-notification-center
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximper-shell-notification-center
Commits
a6cf977e
Commit
a6cf977e
authored
Dec 14, 2023
by
Erik Reider
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor grouped notifications fixes
parent
86166a46
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
18 deletions
+23
-18
notificationGroup.vala
src/notificationGroup/notificationGroup.vala
+23
-18
No files found.
src/notificationGroup/notificationGroup.vala
View file @
a6cf977e
...
...
@@ -163,6 +163,23 @@ namespace SwayNotificationCenter {
}
}
private
void
set_icon
()
{
if
(
is_empty
())
return
;
unowned
Notification
first
=
(
Notification
)
group
.
widgets
.
first
().
data
;
unowned
NotifyParams
param
=
first
.
param
;
// Get the app icon
Icon
?
icon
=
null
;
if
(
param
.
desktop_app_info
!=
null
&&
(
icon
=
param
.
desktop_app_info
.
get_icon
())
!=
null
)
{
app_icon
.
set_from_gicon
(
icon
,
Gtk
.
IconSize
.
LARGE_TOOLBAR
);
app_icon
.
show
();
}
else
{
app_icon
.
set_from_icon_name
(
"application-x-executable-symbolic"
,
Gtk
.
IconSize
.
LARGE_TOOLBAR
);
}
}
/// Returns if there's more than one notification
public
bool
only_single_notification
()
{
unowned
Gtk
.
Widget
?
widget
=
group
.
widgets
.
nth_data
(
1
);
...
...
@@ -190,7 +207,11 @@ namespace SwayNotificationCenter {
}
group
.
add
(
noti
);
if
(!
only_single_notification
())
{
group
.
set_sensitive
(
false
);
if
(!
group
.
is_expanded
)
{
group
.
set_sensitive
(
false
);
}
}
else
{
set_icon
();
}
}
...
...
@@ -240,23 +261,7 @@ namespace SwayNotificationCenter {
}
public
void
update
()
{
if
(!
is_empty
())
{
unowned
Notification
first
=
(
Notification
)
group
.
widgets
.
first
().
data
;
unowned
NotifyParams
param
=
first
.
param
;
// Get the app icon
Icon
?
icon
=
null
;
if
(
param
.
desktop_app_info
!=
null
&&
(
icon
=
param
.
desktop_app_info
.
get_icon
())
!=
null
)
{
app_icon
.
set_from_gicon
(
icon
,
Gtk
.
IconSize
.
LARGE_TOOLBAR
);
app_icon
.
show
();
}
else
{
app_icon
.
set_from_icon_name
(
"application-x-executable-symbolic"
,
Gtk
.
IconSize
.
LARGE_TOOLBAR
);
// app_icon.hide ();
}
}
else
{
// app_icon.hide ();
}
set_icon
();
foreach
(
unowned
Gtk
.
Widget
widget
in
group
.
widgets
)
{
var
noti
=
(
Notification
)
widget
;
if
(
noti
!=
null
)
noti
.
set_time
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment