mirror of
https://github.com/ErikReider/SwayNotificationCenter.git
synced 2024-11-22 01:33:41 +03:00
Add a way to change No Notifications text (#485)
This commit is contained in:
parent
aef8fd7c56
commit
c5067e6557
@ -126,6 +126,11 @@ config file to be able to detect config errors
|
|||||||
default: true ++
|
default: true ++
|
||||||
description: Hides the control center when clicking on notification action
|
description: Hides the control center when clicking on notification action
|
||||||
|
|
||||||
|
*text-empty* ++
|
||||||
|
type: string ++
|
||||||
|
default: "No Notifications" ++
|
||||||
|
description: Text that appears when there are no notifications to show
|
||||||
|
|
||||||
*fit-to-screen* ++
|
*fit-to-screen* ++
|
||||||
type: bool ++
|
type: bool ++
|
||||||
default: true ++
|
default: true ++
|
||||||
|
@ -28,6 +28,7 @@
|
|||||||
"transition-time": 200,
|
"transition-time": 200,
|
||||||
"hide-on-clear": false,
|
"hide-on-clear": false,
|
||||||
"hide-on-action": true,
|
"hide-on-action": true,
|
||||||
|
"text-empty": "No Notifications",
|
||||||
"script-fail-notify": true,
|
"script-fail-notify": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"example-script": {
|
"example-script": {
|
||||||
|
@ -412,6 +412,9 @@ namespace SwayNotificationCenter {
|
|||||||
/** Hides the control center when clicking on notification action */
|
/** Hides the control center when clicking on notification action */
|
||||||
public bool hide_on_action { get; set; default = true; }
|
public bool hide_on_action { get; set; default = true; }
|
||||||
|
|
||||||
|
/** Text that appears when there are no notifications to show */
|
||||||
|
public string text_empty { get; set; default = "No Notifications"; }
|
||||||
|
|
||||||
/** The controlcenters horizontal alignment. Supersedes `positionX` if not `NONE` */
|
/** The controlcenters horizontal alignment. Supersedes `positionX` if not `NONE` */
|
||||||
public PositionX control_center_positionX { // vala-lint=naming-convention
|
public PositionX control_center_positionX { // vala-lint=naming-convention
|
||||||
get; set; default = PositionX.NONE;
|
get; set; default = PositionX.NONE;
|
||||||
|
@ -176,6 +176,11 @@
|
|||||||
"description": "Hides the control center when clicking on notification action",
|
"description": "Hides the control center when clicking on notification action",
|
||||||
"default": true
|
"default": true
|
||||||
},
|
},
|
||||||
|
"text-empty": {
|
||||||
|
"type": "string",
|
||||||
|
"description": "Text that appears when there are no notifications to show",
|
||||||
|
"default": "No Notifications"
|
||||||
|
},
|
||||||
"script-fail-notify": {
|
"script-fail-notify": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"description": "Sends a notification if a script fails to run",
|
"description": "Sends a notification if a script fails to run",
|
||||||
|
@ -68,7 +68,7 @@
|
|||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkLabel">
|
<object class="GtkLabel" id="text_empty_label">
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can-focus">False</property>
|
<property name="can-focus">False</property>
|
||||||
<property name="label" translatable="yes">No Notifications</property>
|
<property name="label" translatable="yes">No Notifications</property>
|
||||||
|
@ -4,6 +4,8 @@ namespace SwayNotificationCenter {
|
|||||||
[GtkChild]
|
[GtkChild]
|
||||||
unowned Gtk.Box notifications_box;
|
unowned Gtk.Box notifications_box;
|
||||||
[GtkChild]
|
[GtkChild]
|
||||||
|
unowned Gtk.Label text_empty_label;
|
||||||
|
[GtkChild]
|
||||||
unowned Gtk.Stack stack;
|
unowned Gtk.Stack stack;
|
||||||
[GtkChild]
|
[GtkChild]
|
||||||
unowned Gtk.ScrolledWindow scrolled_window;
|
unowned Gtk.ScrolledWindow scrolled_window;
|
||||||
@ -61,11 +63,13 @@ namespace SwayNotificationCenter {
|
|||||||
list_box.get_style_context ().add_class ("control-center-list");
|
list_box.get_style_context ().add_class ("control-center-list");
|
||||||
viewport.add (list_box);
|
viewport.add (list_box);
|
||||||
|
|
||||||
|
text_empty_label.set_text (ConfigModel.instance.text_empty);
|
||||||
|
|
||||||
if (swaync_daemon.use_layer_shell) {
|
if (swaync_daemon.use_layer_shell) {
|
||||||
if (!GtkLayerShell.is_supported ()) {
|
if (!GtkLayerShell.is_supported ()) {
|
||||||
stderr.printf ("GTKLAYERSHELL IS NOT SUPPORTED!\n");
|
stderr.printf ("GTKLAYERSHELL IS NOT SUPPORTED!\n");
|
||||||
stderr.printf ("Swaync only works on Wayland!\n");
|
stderr.printf ("Swaync only works on Wayland!\n");
|
||||||
stderr.printf ("If running waylans session, try running:\n");
|
stderr.printf ("If running wayland session, try running:\n");
|
||||||
stderr.printf ("\tGDK_BACKEND=wayland swaync\n");
|
stderr.printf ("\tGDK_BACKEND=wayland swaync\n");
|
||||||
Process.exit (1);
|
Process.exit (1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user