diff --git a/Settings.ui b/Settings.ui
index 4b8b8cc..b280cbe 100644
--- a/Settings.ui
+++ b/Settings.ui
@@ -617,6 +617,840 @@
+
10
1
@@ -2191,850 +3025,6 @@
1
100
-
- True
- False
- vertical
-
-
- True
- True
- in
- 480
- True
- True
-
-
- True
- False
- natural
- natural
-
-
- True
- False
- none
-
-
- True
- True
-
-
- True
- False
- 12
- 12
- 12
- 12
- 12
- 32
-
-
- True
- True
- 4
- 0
- preview_timeout_adjustment
- True
-
-
- 1
- 0
-
-
-
-
- True
- False
- True
- Time (ms) before showing (100 is default)
- True
- 0
-
-
- 0
- 0
-
-
-
-
- True
- False
- True
- Time (ms) before hiding (100 is default)
- 0
-
-
- 0
- 1
-
-
-
-
- True
- True
- 4
- 25
- leave_timeout_adjustment
- True
- 25
-
-
- 1
- 1
-
-
-
-
- True
- False
- True
- Animation time (ms)
- 0
-
-
- 0
- 2
-
-
-
-
- True
- True
- 4
- 0
- preview_animation_time_adjustment
- True
-
-
- 1
- 2
-
-
-
-
-
-
-
-
- True
- True
-
-
- True
- False
- 12
- 12
- 12
- 12
- 32
-
-
- True
- False
- True
- Middle click on the preview to close the window
- True
- 0
-
-
- 0
- 0
-
-
-
-
- True
- True
- end
- center
-
-
- 1
- 0
-
-
-
-
-
-
-
-
- True
- True
-
-
- True
- False
- 12
- 12
- 12
- 12
- 12
- 32
-
-
- True
- False
- True
- Window previews preferred size (px)
- True
- 0
-
-
- 0
- 0
- 3
-
-
-
-
- True
- True
- end
- 4
- 100
- preview_size_adjustment
- True
- 100
-
-
- 2
- 0
-
-
-
-
- True
- False
- True
- Window previews aspect ratio Y (height)
- True
- 0
-
-
- 0
- 2
- 2
-
-
-
-
- True
- False
- True
- Window previews padding (px)
- True
- 0
-
-
- 0
- 3
- 2
-
-
-
-
- True
- True
- end
- 4
- 50
- preview_padding_adjustment
- True
- 50
-
-
- 2
- 3
-
-
-
-
- True
- False
- end
- 2
- True
-
-
- True
- False
- end
- center
-
- - 1
- - 2
- - 3
- - 4
- - 5
- - 6
- - 7
- - 8
- - 9
- - 10
- - 11
- - 12
- - 13
- - 14
- - 15
- - 16
- - 17
- - 18
- - 19
- - 20
- - 21
-
-
-
- False
- True
- 1
-
-
-
-
- Fixed
- True
- True
- True
- end
-
-
- False
- True
- 2
-
-
-
-
- 2
- 1
-
-
-
-
- True
- False
- True
- Window previews aspect ratio X (width)
- True
- 0
-
-
- 0
- 1
- 2
-
-
-
-
- True
- False
- end
- 2
- True
-
-
- True
- False
- end
- center
-
- - 1
- - 2
- - 3
- - 4
- - 5
- - 6
- - 7
- - 8
- - 9
- - 10
- - 11
- - 12
- - 13
- - 14
- - 15
- - 16
- - 17
- - 18
- - 19
- - 20
- - 21
-
-
-
- False
- True
- 0
-
-
-
-
- Fixed
- True
- True
- True
- end
-
-
- False
- True
- 1
-
-
-
-
- 2
- 2
-
-
-
-
-
-
-
-
- True
- True
-
-
- True
- False
- 12
- 12
- 12
- 12
- 32
-
-
- True
- False
- True
- Close button and header position
- 0
-
-
- False
- True
- 0
-
-
-
-
- True
- False
- 32
-
-
- Bottom
- True
- True
- False
- center
- center
- True
- True
-
-
-
- False
- True
- 1
-
-
-
-
- Top
- True
- True
- False
- center
- center
- bottom
- True
- preview_title_position_bottom_button
-
-
-
- False
- True
- 2
-
-
-
-
- False
- True
- 1
-
-
-
-
-
-
-
-
- True
- True
-
-
- True
- False
- 12
- 12
- 12
- 12
- 32
-
-
- True
- False
- True
- Display window preview headers
- True
- 0
-
-
- 0
- 0
-
-
-
-
- True
- True
- end
- center
-
-
- 1
- 0
-
-
-
-
- True
- False
- 12
- 32
-
-
- True
- True
- 4
- 6
- preview_title_font_size_adjustment
- True
- 6
-
-
- 1
- 0
-
-
-
-
- True
- False
- True
- Font size (px) of the preview titles
- True
- 0
-
-
- 0
- 0
-
-
-
-
- 0
- 1
- 2
-
-
-
-
- True
- False
- 12
- 32
-
-
- True
- False
- True
- Font weight of the preview titles
- 0
-
-
- 0
- 0
-
-
-
-
- True
- False
- center
-
- - inherit from theme
- - normal
- - lighter
- - bold
- - bolder
-
-
-
- 1
- 0
-
-
-
-
- 0
- 2
- 2
-
-
-
-
- True
- False
- 12
- 32
-
-
- True
- False
- True
- Font color of the preview titles
- True
- 0
-
-
- 0
- 0
-
-
-
-
- True
- True
- True
- end
-
-
- 1
- 0
-
-
-
-
- 0
- 3
- 2
-
-
-
-
-
-
-
-
- True
- True
-
-
- True
- False
- 12
- 12
- 12
- 12
- 32
-
-
- True
- False
- True
- Enable window peeking
- True
- 0
-
-
- 0
- 0
-
-
-
-
- True
- True
- end
- center
-
-
- 1
- 0
-
-
-
-
- True
- False
- True
- When hovering over a window preview for some time, the window gets distinguished.
- True
- 40
- 0
-
-
-
- 0
- 1
- 2
-
-
-
-
- True
- False
- 12
- 32
-
-
- True
- False
- True
- Enter window peeking mode timeout (ms)
- 0
-
-
- 0
- 0
-
-
-
-
- True
- True
- 4
- 50
- enter_peek_mode_timeout_adjustment
- True
- 50
-
-
- 1
- 0
-
-
-
-
- True
- False
- True
- Time of inactivity while hovering over a window preview needed to enter the window peeking mode.
- True
- 40
- 0
-
-
-
- 0
- 1
- 2
-
-
-
-
- 0
- 2
- 2
-
-
-
-
- True
- False
- 12
- 32
-
-
- True
- False
- True
- Window peeking mode opacity
- 0
-
-
- 0
- 0
-
-
-
-
- True
- True
- 4
- 0
- peek_mode_opacity_adjustment
- True
-
-
- 1
- 0
-
-
-
-
- True
- False
- True
- All windows except for the peeked one have their opacity set to the same value.
- True
- 40
- 0
-
-
-
- 0
- 1
- 2
-
-
-
-
- 0
- 3
- 2
-
-
-
-
-
-
-
-
-
-
-
-
- False
- False
- 1
-
-
-
10000
250
diff --git a/prefs.js b/prefs.js
index 6d82f4c..7b7aab1 100644
--- a/prefs.js
+++ b/prefs.js
@@ -1017,8 +1017,11 @@ const Settings = new Lang.Class({
// Use +1 for the reset action
dialog.add_button(_('Reset to defaults'), 1);
- let box = this._builder.get_object('box_window_preview_options');
- dialog.get_content_area().add(box);
+ let scrolledWindow = this._builder.get_object('box_window_preview_options');
+
+ adjustScrollableHeight(this._builder.get_object('viewport_window_preview_options'), scrolledWindow);
+
+ dialog.get_content_area().add(scrolledWindow);
this._builder.get_object('preview_timeout_spinbutton').set_value(this._settings.get_int('show-window-previews-timeout'));
this._builder.get_object('preview_timeout_spinbutton').connect('value-changed', Lang.bind (this, function(widget) {
@@ -1175,7 +1178,7 @@ const Settings = new Lang.Class({
} else {
// remove the settings box so it doesn't get destroyed;
- dialog.get_content_area().remove(box);
+ dialog.get_content_area().remove(scrolledWindow);
dialog.destroy();
}
return;
@@ -1821,10 +1824,14 @@ function buildPrefsWidget() {
// I'd like the scrolled window to default to a size large enough to show all without scrolling, if it fits on the screen
// But, it doesn't seem possible, so I'm setting a minimum size if there seems to be enough screen real estate
widget.show_all();
- let viewportSize = settings.viewport.size_request();
- let screenHeight = widget.get_screen().get_height() - 120;
-
- widget.set_size_request(viewportSize.width, viewportSize.height > screenHeight ? screenHeight : viewportSize.height);
+ adjustScrollableHeight(settings.viewport, widget);
return widget;
}
+
+function adjustScrollableHeight(viewport, scrollableWindow) {
+ let viewportSize = viewport.size_request();
+ let screenHeight = scrollableWindow.get_screen().get_height() - 120;
+
+ scrollableWindow.set_size_request(viewportSize.width, viewportSize.height > screenHeight ? screenHeight : viewportSize.height);
+}
\ No newline at end of file