Add positonY center for notifications and CC (#259)
This commit is contained in:
@@ -4,7 +4,7 @@ namespace SwayNotificationCenter {
|
||||
}
|
||||
|
||||
public enum PositionY {
|
||||
TOP, BOTTOM, NONE;
|
||||
TOP, BOTTOM, CENTER, NONE;
|
||||
}
|
||||
|
||||
public enum ImageVisibility {
|
||||
|
@@ -30,7 +30,7 @@
|
||||
"type": "string",
|
||||
"description": "Vertical position of control center and notification window",
|
||||
"default": "top",
|
||||
"enum": ["top", "bottom"]
|
||||
"enum": ["top", "center", "bottom"]
|
||||
},
|
||||
"control-center-positionX": {
|
||||
"type": "string",
|
||||
|
@@ -317,6 +317,12 @@ namespace SwayNotificationCenter {
|
||||
list_reverse = false;
|
||||
list_align = Gtk.Align.START;
|
||||
break;
|
||||
case PositionY.CENTER:
|
||||
align_y = Gtk.Align.CENTER;
|
||||
// Set cc widget position
|
||||
list_reverse = false;
|
||||
list_align = Gtk.Align.START;
|
||||
break;
|
||||
case PositionY.BOTTOM:
|
||||
align_y = Gtk.Align.END;
|
||||
// Set cc widget position
|
||||
|
@@ -87,13 +87,6 @@ namespace SwayNotificationCenter {
|
||||
break;
|
||||
}
|
||||
switch (ConfigModel.instance.positionY) {
|
||||
case PositionY.BOTTOM:
|
||||
GtkLayerShell.set_anchor (
|
||||
this, GtkLayerShell.Edge.TOP, false);
|
||||
GtkLayerShell.set_anchor (
|
||||
this, GtkLayerShell.Edge.BOTTOM, true);
|
||||
list_reverse = true;
|
||||
break;
|
||||
default:
|
||||
case PositionY.TOP:
|
||||
list_reverse = false;
|
||||
@@ -102,6 +95,20 @@ namespace SwayNotificationCenter {
|
||||
GtkLayerShell.set_anchor (
|
||||
this, GtkLayerShell.Edge.TOP, true);
|
||||
break;
|
||||
case PositionY.CENTER:
|
||||
list_reverse = false;
|
||||
GtkLayerShell.set_anchor (
|
||||
this, GtkLayerShell.Edge.BOTTOM, false);
|
||||
GtkLayerShell.set_anchor (
|
||||
this, GtkLayerShell.Edge.TOP, false);
|
||||
break;
|
||||
case PositionY.BOTTOM:
|
||||
GtkLayerShell.set_anchor (
|
||||
this, GtkLayerShell.Edge.TOP, false);
|
||||
GtkLayerShell.set_anchor (
|
||||
this, GtkLayerShell.Edge.BOTTOM, true);
|
||||
list_reverse = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user