aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-09-09 13:51:36 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2023-09-09 13:51:36 +0200
commitff70460acbf19702464fcf22dc4c21fc20665d0e (patch)
treeb72c36d0a279e44b6deeebda91ebebe5ce5ec94e /src
parent38dc2dd6af7a7bca030e18783a3b9f84c642e6e6 (diff)
parentcf943b8c9564a0cc8d215a7bc76a147bdd027aaf (diff)
downloadayatana-indicator-sound-ff70460acbf19702464fcf22dc4c21fc20665d0e.tar.gz
ayatana-indicator-sound-ff70460acbf19702464fcf22dc4c21fc20665d0e.tar.bz2
ayatana-indicator-sound-ff70460acbf19702464fcf22dc4c21fc20665d0e.zip
Merge branch 'tari01-pr/fix-notification'
Attributes GH PR #92: https://github.com/AyatanaIndicators/ayatana-indicator-sound/pull/92
Diffstat (limited to 'src')
-rw-r--r--src/info-notification.vala18
-rw-r--r--src/warn-notification.vala5
2 files changed, 13 insertions, 10 deletions
diff --git a/src/info-notification.vala b/src/info-notification.vala
index bd43a91..4379acf 100644
--- a/src/info-notification.vala
+++ b/src/info-notification.vala
@@ -1,6 +1,6 @@
/*
* Copyright 2015 Canonical Ltd.
- * Copyright 2021 Robert Tari
+ * Copyright 2021-2023 Robert Tari
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -30,22 +30,26 @@ public class IndicatorSound.InfoNotification: Notification
public void show (VolumeControl.ActiveOutput active_output,
double volume,
bool is_high_volume) {
- if (!notify_server_supports ("x-lomiri-private-synchronous"))
- return;
/* Determine Label */
- unowned string volume_label = get_notification_label (active_output);
+ string volume_label = get_notification_label (active_output);
/* Choose an icon */
unowned string icon = get_volume_notification_icon (active_output, volume, is_high_volume);
/* Reset the notification */
var n = _notification;
+
+ uint nChars = ((int32)((volume * 20) + 0.5)).clamp(0, 20);
+ volume_label += "\n";
+
+ for (uint nChar = 0; nChar < nChars; nChar++)
+ {
+ volume_label += "◼";
+ }
+
n.update (_("Volume"), volume_label, icon);
n.clear_hints();
- n.set_hint ("x-lomiri-non-shaped-icon", "true");
- n.set_hint ("x-lomiri-private-synchronous", "true");
- n.set_hint ("x-lomiri-value-bar-tint", is_high_volume ? "true" : "false");
n.set_hint ("value", ((int32)((volume * 100.0) + 0.5)).clamp(0, 100));
show_notification ();
}
diff --git a/src/warn-notification.vala b/src/warn-notification.vala
index 6a08431..203758e 100644
--- a/src/warn-notification.vala
+++ b/src/warn-notification.vala
@@ -1,5 +1,6 @@
/*
* Copyright 2015 Canonical Ltd.
+ * Copyright 2021-2023 Robert Tari
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -15,6 +16,7 @@
*
* Authors:
* Charles Kerr <charles.kerr@canonical.com>
+ * Robert Tari <robert@tari.in>
*/
public class IndicatorSound.WarnNotification: Notification
@@ -31,9 +33,6 @@ public class IndicatorSound.WarnNotification: Notification
_("Volume"),
_("Allow volume above safe level?\nHigh volume can damage your hearing."),
"audio-volume-high");
- n.set_hint ("x-lomiri-non-shaped-icon", "true");
- n.set_hint ("x-lomiri-snap-decisions", "true");
- n.set_hint ("x-lomiri-private-affirmative-tint", "true");
n.closed.connect ((n) => {
n.clear_actions ();
});