Added option 'center' for 'positionX' in config (#30)

Co-authored-by: Christopher Lübbemeier <luebbemeier@metaventis.com>
This commit is contained in:
christopher-l
2021-12-03 13:40:13 +01:00
committed by GitHub
parent baab0cd9b8
commit 75894f50ff
4 changed files with 16 additions and 2 deletions

View File

@@ -84,7 +84,7 @@ to your `.config/swaync/` folder to customize without needing root access.
To reload the config, you'll need to run `swaync-client --reload-config` To reload the config, you'll need to run `swaync-client --reload-config`
- `positionX`: `left` or `right` - `positionX`: `left`, `right` or `center`
- `positionY`: `top` or `bottom` - `positionY`: `top` or `bottom`
- `timeout`: uint (Any positive number). The notification timeout for notifications with normal priority - `timeout`: uint (Any positive number). The notification timeout for notifications with normal priority
- `timeout-low`: uint (any positive number). The notification timeout for notifications with low priority - `timeout-low`: uint (any positive number). The notification timeout for notifications with low priority

View File

@@ -1,6 +1,6 @@
namespace SwayNotificatonCenter { namespace SwayNotificatonCenter {
public enum PositionX { public enum PositionX {
RIGHT, LEFT; RIGHT, LEFT, CENTER;
public string parse () { public string parse () {
EnumClass enumc = (EnumClass) typeof (PositionX).class_ref (); EnumClass enumc = (EnumClass) typeof (PositionX).class_ref ();

View File

@@ -227,6 +227,14 @@ namespace SwayNotificatonCenter {
GtkLayerShell.Edge.LEFT, GtkLayerShell.Edge.LEFT,
true); true);
break; break;
case PositionX.CENTER:
GtkLayerShell.set_anchor (this,
GtkLayerShell.Edge.RIGHT,
false);
GtkLayerShell.set_anchor (this,
GtkLayerShell.Edge.LEFT,
false);
break;
default: default:
GtkLayerShell.set_anchor (this, GtkLayerShell.set_anchor (this,
GtkLayerShell.Edge.LEFT, GtkLayerShell.Edge.LEFT,

View File

@@ -37,6 +37,12 @@ namespace SwayNotificatonCenter {
GtkLayerShell.set_anchor ( GtkLayerShell.set_anchor (
this, GtkLayerShell.Edge.LEFT, true); this, GtkLayerShell.Edge.LEFT, true);
break; break;
case PositionX.CENTER:
GtkLayerShell.set_anchor (
this, GtkLayerShell.Edge.RIGHT, false);
GtkLayerShell.set_anchor (
this, GtkLayerShell.Edge.LEFT, false);
break;
default: default:
GtkLayerShell.set_anchor ( GtkLayerShell.set_anchor (
this, GtkLayerShell.Edge.LEFT, false); this, GtkLayerShell.Edge.LEFT, false);