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
1207af86
Commit
1207af86
authored
Aug 17, 2025
by
Erik Reider
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed the unneeded FixedViewportLayout hack
parent
07530e39
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
70 deletions
+0
-70
controlCenter.vala
src/controlCenter/controlCenter.vala
+0
-70
No files found.
src/controlCenter/controlCenter.vala
View file @
1207af86
namespace
SwayNotificationCenter
{
namespace
SwayNotificationCenter
{
/* Only to be used by the Viewport in the Control Center */
private
class
FixedViewportLayout
:
Gtk
.
LayoutManager
{
private
unowned
Gtk
.
ScrolledWindow
parent
;
public
FixedViewportLayout
(
Gtk
.
ScrolledWindow
parent
)
{
this
.
parent
=
parent
;
}
public
override
void
measure
(
Gtk
.
Widget
widget
,
Gtk
.
Orientation
orientation
,
int
for_size
,
out
int
minimum
,
out
int
natural
,
out
int
minimum_baseline
,
out
int
natural_baseline
)
{
minimum
=
0
;
natural
=
0
;
minimum_baseline
=
0
;
natural_baseline
=
0
;
if
(
widget
==
null
||
!
widget
.
should_layout
())
{
return
;
}
unowned
Gtk
.
Widget
child
=
((
Gtk
.
Viewport
)
widget
).
child
;
if
(!
child
.
should_layout
())
{
return
;
}
child
.
measure
(
orientation
,
for_size
,
out
minimum
,
out
natural
,
out
minimum_baseline
,
out
natural_baseline
);
}
public
override
void
allocate
(
Gtk
.
Widget
widget
,
int
width
,
int
height
,
int
baseline
)
{
if
(
widget
==
null
||
!
widget
.
should_layout
())
{
return
;
}
unowned
Gtk
.
Widget
child
=
((
Gtk
.
Viewport
)
widget
).
child
;
if
(!
child
.
should_layout
())
{
return
;
}
if
(
ConfigModel
.
instance
.
fit_to_screen
)
{
child
.
allocate
(
width
,
height
,
baseline
,
null
);
return
;
}
int
m_height
,
n_height
;
child
.
measure
(
Gtk
.
Orientation
.
VERTICAL
,
-
1
,
out
m_height
,
out
n_height
,
null
,
null
);
int
m_width
,
n_width
;
child
.
measure
(
Gtk
.
Orientation
.
HORIZONTAL
,
-
1
,
out
m_width
,
out
n_width
,
null
,
null
);
int
parent_width
=
parent
.
get_width
();
int
parent_height
=
parent
.
get_height
();
// Limit the size to the ScrolledWindows size
child
.
allocate
(
n_width
.
clamp
((
int
)
Math
.
fmin
(
m_width
,
parent_width
),
parent_width
),
n_height
.
clamp
((
int
)
Math
.
fmin
(
m_height
,
parent_height
),
parent_height
),
baseline
,
null
);
}
}
[
GtkTemplate
(
ui
=
"/org/erikreider/swaync/ui/control_center.ui"
)]
[
GtkTemplate
(
ui
=
"/org/erikreider/swaync/ui/control_center.ui"
)]
public
class
ControlCenter
:
Gtk
.
ApplicationWindow
{
public
class
ControlCenter
:
Gtk
.
ApplicationWindow
{
[
GtkChild
]
[
GtkChild
]
...
@@ -416,9 +349,6 @@ namespace SwayNotificationCenter {
...
@@ -416,9 +349,6 @@ namespace SwayNotificationCenter {
ConfigModel
.
instance
.
control_center_height
);
ConfigModel
.
instance
.
control_center_height
);
box
.
set_size_request
(
ConfigModel
.
instance
.
control_center_width
,
box
.
set_size_request
(
ConfigModel
.
instance
.
control_center_width
,
ConfigModel
.
instance
.
control_center_height
);
ConfigModel
.
instance
.
control_center_height
);
// Use a custom layout to limit the minimum size above to the size
// of the window so that it doesn't exceed the monitors edge
window
.
child
.
set_layout_manager
(
new
FixedViewportLayout
(
window
));
// Set the preferred monitor
// Set the preferred monitor
string
?
monitor_name
=
ConfigModel
.
instance
.
control_center_preferred_output
;
string
?
monitor_name
=
ConfigModel
.
instance
.
control_center_preferred_output
;
...
...
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