Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
ximper-shell-notification-center
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
ximper-shell-notification-center
Commits
c246bca8
Unverified
Commit
c246bca8
authored
May 16, 2023
by
Erik Reider
Committed by
GitHub
May 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added control-center layer config option (#263)
parent
b91e39c1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
85 additions
and
61 deletions
+85
-61
blankWindow.vala
src/blankWindow/blankWindow.vala
+3
-2
config.json.in
src/config.json.in
+2
-1
configModel.vala
src/configModel/configModel.vala
+8
-4
configSchema.json
src/configSchema.json
+8
-2
controlCenter.vala
src/controlCenter/controlCenter.vala
+3
-2
notificationWindow.vala
src/notificationWindow/notificationWindow.vala
+61
-50
No files found.
src/blankWindow/blankWindow.vala
View file @
c246bca8
...
...
@@ -48,8 +48,8 @@ namespace SwayNotificationCenter {
GtkLayerShell
.
set_exclusive_zone
(
this
,
-
1
);
GtkLayerShell
.
Layer
layer
=
GtkLayerShell
.
Layer
.
TOP
;
switch
(
ConfigModel
.
instance
.
layer
)
{
GtkLayerShell
.
Layer
layer
;
switch
(
ConfigModel
.
instance
.
control_center_
layer
)
{
case
Layer
.
BACKGROUND
:
layer
=
GtkLayerShell
.
Layer
.
BACKGROUND
;
break
;
...
...
@@ -59,6 +59,7 @@ namespace SwayNotificationCenter {
case
Layer
.
TOP
:
layer
=
GtkLayerShell
.
Layer
.
TOP
;
break
;
default
:
case
Layer
.
OVERLAY
:
layer
=
GtkLayerShell
.
Layer
.
OVERLAY
;
break
;
...
...
src/config.json.in
View file @
c246bca8
...
...
@@ -2,7 +2,8 @@
"$schema": @JSONPATH@,
"positionX": "right",
"positionY": "top",
"layer": "top",
"layer": "overlay",
"control-center-layer": "top",
"layer-shell": true,
"cssPriority": "application",
"control-center-margin-top": 0,
...
...
src/configModel/configModel.vala
View file @
c246bca8
...
...
@@ -27,14 +27,13 @@ namespace SwayNotificationCenter {
public
string
parse
()
{
switch
(
this
)
{
default
:
return
"top"
;
case
BACKGROUND
:
return
"background"
;
case
BOTTOM
:
return
"bottom"
;
case
TOP
:
return
"top"
;
default
:
case
OVERLAY
:
return
"overlay"
;
}
...
...
@@ -346,9 +345,9 @@ namespace SwayNotificationCenter {
get
;
set
;
default
=
PositionY
.
TOP
;
}
/** Layer of
control center
*/
/** Layer of
notification window
*/
public
Layer
layer
{
get
;
set
;
default
=
Layer
.
TOP
;
get
;
set
;
default
=
Layer
.
OVERLAY
;
}
/**
...
...
@@ -483,6 +482,11 @@ namespace SwayNotificationCenter {
}
}
/** Layer of Control Center window */
public
Layer
control_center_layer
{
get
;
set
;
default
=
Layer
.
TOP
;
}
/** Categories settings */
public
OrderedHashTable
<
Category
>
categories_settings
{
get
;
...
...
src/configSchema.json
View file @
c246bca8
...
...
@@ -16,8 +16,8 @@
},
"layer"
:
{
"type"
:
"string"
,
"description"
:
"Layer of
control center
window"
,
"default"
:
"
top
"
,
"description"
:
"Layer of
notification
window"
,
"default"
:
"
overlay
"
,
"enum"
:
[
"background"
,
"bottom"
,
"top"
,
"overlay"
]
},
"layer-shell"
:
{
...
...
@@ -69,6 +69,12 @@
"description"
:
"The margin (in pixels) at the left of the notification center. 0 to disable"
,
"default"
:
0
},
"control-center-layer"
:
{
"type"
:
"string"
,
"description"
:
"Layer of control center window"
,
"default"
:
"none"
,
"enum"
:
[
"background"
,
"bottom"
,
"top"
,
"overlay"
,
"none"
]
},
"notification-2fa-action"
:
{
"type"
:
"boolean"
,
"description"
:
"If each notification should display a 'COPY
\"
1234
\"
' action"
,
...
...
src/controlCenter/controlCenter.vala
View file @
c246bca8
...
...
@@ -270,8 +270,8 @@ namespace SwayNotificationCenter {
#endif
// Set layer
GtkLayerShell
.
Layer
layer
=
GtkLayerShell
.
Layer
.
TOP
;
switch
(
ConfigModel
.
instance
.
layer
)
{
GtkLayerShell
.
Layer
layer
;
switch
(
ConfigModel
.
instance
.
control_center_
layer
)
{
case
Layer
.
BACKGROUND
:
layer
=
GtkLayerShell
.
Layer
.
BACKGROUND
;
break
;
...
...
@@ -281,6 +281,7 @@ namespace SwayNotificationCenter {
case
Layer
.
TOP
:
layer
=
GtkLayerShell
.
Layer
.
TOP
;
break
;
default
:
case
Layer
.
OVERLAY
:
layer
=
GtkLayerShell
.
Layer
.
OVERLAY
;
break
;
...
...
src/notificationWindow/notificationWindow.vala
View file @
c246bca8
...
...
@@ -53,7 +53,6 @@ namespace SwayNotificationCenter {
}
GtkLayerShell
.
init_for_window
(
this
);
GtkLayerShell
.
set_namespace
(
this
,
"swaync-notification-window"
);
GtkLayerShell
.
set_layer
(
this
,
GtkLayerShell
.
Layer
.
OVERLAY
);
}
this
.
set_anchor
();
...
...
@@ -68,56 +67,68 @@ namespace SwayNotificationCenter {
}
private
void
set_anchor
()
{
switch
(
ConfigModel
.
instance
.
positionX
)
{
case
PositionX
.
LEFT
:
if
(!
swaync_daemon
.
use_layer_shell
)
break
;
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
RIGHT
,
false
);
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
LEFT
,
true
);
break
;
case
PositionX
.
CENTER
:
if
(!
swaync_daemon
.
use_layer_shell
)
break
;
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
RIGHT
,
false
);
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
LEFT
,
false
);
break
;
default
:
if
(!
swaync_daemon
.
use_layer_shell
)
break
;
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
LEFT
,
false
);
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
RIGHT
,
true
);
break
;
}
switch
(
ConfigModel
.
instance
.
positionY
)
{
default
:
case
PositionY
.
TOP
:
list_reverse
=
false
;
if
(!
swaync_daemon
.
use_layer_shell
)
break
;
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
BOTTOM
,
false
);
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
TOP
,
true
);
break
;
case
PositionY
.
CENTER
:
list_reverse
=
false
;
if
(!
swaync_daemon
.
use_layer_shell
)
break
;
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
BOTTOM
,
false
);
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
TOP
,
false
);
break
;
case
PositionY
.
BOTTOM
:
list_reverse
=
true
;
if
(!
swaync_daemon
.
use_layer_shell
)
break
;
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
TOP
,
false
);
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
BOTTOM
,
true
);
break
;
if
(
swaync_daemon
.
use_layer_shell
)
{
GtkLayerShell
.
Layer
layer
;
switch
(
ConfigModel
.
instance
.
layer
)
{
case
Layer
.
BACKGROUND
:
layer
=
GtkLayerShell
.
Layer
.
BACKGROUND
;
break
;
case
Layer
.
BOTTOM
:
layer
=
GtkLayerShell
.
Layer
.
BOTTOM
;
break
;
case
Layer
.
TOP
:
layer
=
GtkLayerShell
.
Layer
.
TOP
;
break
;
default
:
case
Layer
.
OVERLAY
:
layer
=
GtkLayerShell
.
Layer
.
OVERLAY
;
break
;
}
GtkLayerShell
.
set_layer
(
this
,
layer
);
switch
(
ConfigModel
.
instance
.
positionX
)
{
case
PositionX
.
LEFT
:
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
RIGHT
,
false
);
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
LEFT
,
true
);
break
;
case
PositionX
.
CENTER
:
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
RIGHT
,
false
);
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
LEFT
,
false
);
break
;
default
:
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
LEFT
,
false
);
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
RIGHT
,
true
);
break
;
}
switch
(
ConfigModel
.
instance
.
positionY
)
{
default
:
case
PositionY
.
TOP
:
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
BOTTOM
,
false
);
GtkLayerShell
.
set_anchor
(
this
,
GtkLayerShell
.
Edge
.
TOP
,
true
);
break
;
case
PositionY
.
CENTER
:
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
);
break
;
}
}
list_reverse
=
ConfigModel
.
instance
.
positionY
==
PositionY
.
BOTTOM
;
}
private
void
size_alloc
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment