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
237310c6
Commit
237310c6
authored
Sep 26, 2023
by
Erik Reider
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed notifications list not scrolling when changing focus
parent
3069f712
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
53 deletions
+67
-53
controlCenter.ui
src/controlCenter/controlCenter.ui
+62
-50
controlCenter.vala
src/controlCenter/controlCenter.vala
+5
-3
No files found.
src/controlCenter/controlCenter.ui
View file @
237310c6
...
@@ -20,89 +20,101 @@
...
@@ -20,89 +20,101 @@
<property
name=
"vexpand"
>
True
</property>
<property
name=
"vexpand"
>
True
</property>
<property
name=
"orientation"
>
vertical
</property>
<property
name=
"orientation"
>
vertical
</property>
<child>
<child>
<object
class=
"Gtk
ScrolledWindow"
id=
"scrolled_window
"
>
<object
class=
"Gtk
Box"
id=
"notifications_box
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can-focus"
>
Tru
e
</property>
<property
name=
"can-focus"
>
Fals
e
</property>
<property
name=
"
hscrollbar-policy"
>
never
</property>
<property
name=
"
orientation"
>
vertical
</property>
<child>
<child>
<object
class=
"Gtk
Viewport"
id=
"viewport
"
>
<object
class=
"Gtk
Stack"
id=
"stack
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can-focus"
>
False
</property>
<property
name=
"can-focus"
>
False
</property>
<property
name=
"vexpand"
>
True
</property>
<property
name=
"transition-type"
>
crossfade
</property>
<property
name=
"shadow-type"
>
none
</property>
<child>
<child>
<object
class=
"GtkS
tack"
id=
"stack
"
>
<object
class=
"GtkS
crolledWindow"
id=
"scrolled_window
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can-focus"
>
Fals
e
</property>
<property
name=
"can-focus"
>
Tru
e
</property>
<property
name=
"
transition-type"
>
crossfade
</property>
<property
name=
"
hscrollbar-policy"
>
never
</property>
<child>
<child>
<object
class=
"Gtk
Box
"
>
<object
class=
"Gtk
Viewport"
id=
"viewport
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can-focus"
>
False
</property>
<property
name=
"can-focus"
>
False
</property>
<property
name=
"halign"
>
center
</property>
<property
name=
"valign"
>
center
</property>
<property
name=
"hexpand"
>
True
</property>
<property
name=
"vexpand"
>
True
</property>
<property
name=
"vexpand"
>
True
</property>
<property
name=
"orientation"
>
vertical
</property>
<property
name=
"shadow-type"
>
none
</property>
<property
name=
"spacing"
>
12
</property>
<child>
<object
class=
"GtkImage"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can-focus"
>
False
</property>
<property
name=
"pixel-size"
>
96
</property>
<property
name=
"icon-name"
>
preferences-system-notifications-symbolic
</property>
<property
name=
"use-fallback"
>
True
</property>
<property
name=
"icon_size"
>
0
</property>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
<child>
<child>
<object
class=
"GtkL
abel
"
>
<object
class=
"GtkL
istBox"
id=
"list_box
"
>
<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=
"valign"
>
end
</property>
<property
name=
"selection-mode"
>
none
</property>
<property
name=
"activate-on-single-click"
>
False
</property>
<style>
<class
name=
"control-center-list"
/>
</style>
</object>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
</child>
<style>
</object>
<class
name=
"control-center-list-placeholder"
/>
</child>
</style>
</object>
<packing>
<property
name=
"name"
>
notifications-list
</property>
</packing>
</child>
<child>
<object
class=
"GtkBox"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can-focus"
>
False
</property>
<property
name=
"halign"
>
center
</property>
<property
name=
"valign"
>
center
</property>
<property
name=
"hexpand"
>
True
</property>
<property
name=
"vexpand"
>
True
</property>
<property
name=
"orientation"
>
vertical
</property>
<property
name=
"spacing"
>
12
</property>
<child>
<object
class=
"GtkImage"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"can-focus"
>
False
</property>
<property
name=
"pixel-size"
>
96
</property>
<property
name=
"icon-name"
>
preferences-system-notifications-symbolic
</property>
<property
name=
"use-fallback"
>
True
</property>
<property
name=
"icon_size"
>
0
</property>
</object>
</object>
<packing>
<packing>
<property
name=
"name"
>
notifications-placeholder
</property>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
0
</property>
</packing>
</packing>
</child>
</child>
<child>
<child>
<object
class=
"GtkL
istBox"
id=
"list_box
"
>
<object
class=
"GtkL
abel
"
>
<property
name=
"visible"
>
True
</property>
<property
name=
"visible"
>
True
</property>
<property
name=
"can-focus"
>
False
</property>
<property
name=
"can-focus"
>
False
</property>
<property
name=
"valign"
>
end
</property>
<property
name=
"label"
translatable=
"yes"
>
No Notifications
</property>
<property
name=
"selection-mode"
>
none
</property>
<property
name=
"activate-on-single-click"
>
False
</property>
<style>
<class
name=
"control-center-list"
/>
</style>
</object>
</object>
<packing>
<packing>
<property
name=
"name"
>
notifications-list
</property>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
1
</property>
<property
name=
"position"
>
1
</property>
</packing>
</packing>
</child>
</child>
<style>
<class
name=
"control-center-list-placeholder"
/>
</style>
</object>
</object>
<packing>
<property
name=
"name"
>
notifications-placeholder
</property>
<property
name=
"position"
>
1
</property>
</packing>
</child>
</child>
</object>
</object>
<packing>
<property
name=
"expand"
>
False
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
0
</property>
</packing>
</child>
</child>
</object>
</object>
<packing>
<packing>
<property
name=
"expand"
>
Tru
e
</property>
<property
name=
"expand"
>
Fals
e
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"fill"
>
True
</property>
<property
name=
"position"
>
0
</property>
<property
name=
"position"
>
0
</property>
</packing>
</packing>
...
...
src/controlCenter/controlCenter.vala
View file @
237310c6
...
@@ -3,6 +3,8 @@ namespace SwayNotificationCenter {
...
@@ -3,6 +3,8 @@ namespace SwayNotificationCenter {
public
class
ControlCenter
:
Gtk
.
ApplicationWindow
{
public
class
ControlCenter
:
Gtk
.
ApplicationWindow
{
[
GtkChild
]
[
GtkChild
]
unowned
Gtk
.
Box
notifications_box
;
[
GtkChild
]
unowned
Gtk
.
ScrolledWindow
scrolled_window
;
unowned
Gtk
.
ScrolledWindow
scrolled_window
;
[
GtkChild
]
[
GtkChild
]
unowned
Gtk
.
Viewport
viewport
;
unowned
Gtk
.
Viewport
viewport
;
...
@@ -243,11 +245,11 @@ namespace SwayNotificationCenter {
...
@@ -243,11 +245,11 @@ namespace SwayNotificationCenter {
if
(
w
.
length
==
0
)
w
=
DEFAULT_WIDGETS
;
if
(
w
.
length
==
0
)
w
=
DEFAULT_WIDGETS
;
bool
has_notification
=
false
;
bool
has_notification
=
false
;
foreach
(
string
key
in
w
)
{
foreach
(
string
key
in
w
)
{
// Reposition the
scrolled_window
// Reposition the
notifications_box
if
(
key
==
"notifications"
)
{
if
(
key
==
"notifications"
)
{
has_notification
=
true
;
has_notification
=
true
;
uint
pos
=
box
.
get_children
().
length
();
uint
pos
=
box
.
get_children
().
length
();
box
.
reorder_child
(
scrolled_window
,
(
int
)
(
pos
>
0
?
--
pos
:
0
));
box
.
reorder_child
(
notifications_box
,
(
int
)
(
pos
>
0
?
--
pos
:
0
));
continue
;
continue
;
}
}
// Add the widget if it is valid
// Add the widget if it is valid
...
@@ -261,7 +263,7 @@ namespace SwayNotificationCenter {
...
@@ -261,7 +263,7 @@ namespace SwayNotificationCenter {
if
(!
has_notification
)
{
if
(!
has_notification
)
{
warning
(
"Notification widget not included in \"widgets\" config. Using default bottom position"
);
warning
(
"Notification widget not included in \"widgets\" config. Using default bottom position"
);
uint
pos
=
box
.
get_children
().
length
();
uint
pos
=
box
.
get_children
().
length
();
box
.
reorder_child
(
scrolled_window
,
(
int
)
(
pos
>
0
?
--
pos
:
0
));
box
.
reorder_child
(
notifications_box
,
(
int
)
(
pos
>
0
?
--
pos
:
0
));
}
}
}
}
...
...
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