1
1
namespace SwayNotificationCenter {
2
+ /* Only to be used by the Viewport in the Control Center */
2
3
private class FixedViewportLayout : Gtk .LayoutManager {
3
4
private unowned Gtk . ScrolledWindow parent;
4
5
@@ -40,6 +41,11 @@ namespace SwayNotificationCenter {
40
41
return ;
41
42
}
42
43
44
+ if (ConfigModel . instance. fit_to_screen) {
45
+ child. allocate (width, height, baseline, null );
46
+ return ;
47
+ }
48
+
43
49
int m_height, n_height;
44
50
child. measure (Gtk . Orientation . VERTICAL , width,
45
51
out m_height, out n_height,
@@ -49,13 +55,13 @@ namespace SwayNotificationCenter {
49
55
out m_width, out n_width,
50
56
null , null );
51
57
52
- int window_width = parent. get_width ();
53
- int window_height = parent. get_height ();
58
+ int parent_width = parent. get_width ();
59
+ int parent_height = parent. get_height ();
54
60
55
61
// Limit the size to the ScrolledWindows size
56
62
child. allocate (
57
- n_width. clamp ((int ) Math . fmin (m_width, window_width ), window_width ),
58
- n_height. clamp ((int ) Math . fmin (m_height, window_height ), window_height ),
63
+ n_width. clamp ((int ) Math . fmin (m_width, parent_width ), parent_width ),
64
+ n_height. clamp ((int ) Math . fmin (m_height, parent_height ), parent_height ),
59
65
baseline, null );
60
66
}
61
67
}
0 commit comments