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