search: Remove unnecessary containers
The functionality the searchResultsBin container provides can easily be moved into a subclass of St.BoxLayout, no need for an additional StBin. The "searchResultsBin" css class isn't used in the stylesheets either. Same with the scrollChild container. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/110
This commit is contained in:
parent
a823a213ba
commit
a78527050a
@ -1364,11 +1364,8 @@ StScrollBar {
|
|||||||
|
|
||||||
//search results
|
//search results
|
||||||
|
|
||||||
#searchResultsBin {
|
|
||||||
max-width: 1000px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#searchResultsContent {
|
#searchResultsContent {
|
||||||
|
max-width: 1000px;
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
padding-right: 20px;
|
padding-right: 20px;
|
||||||
spacing: 16px;
|
spacing: 16px;
|
||||||
|
@ -14,8 +14,8 @@ const SEARCH_PROVIDERS_SCHEMA = 'org.gnome.desktop.search-providers';
|
|||||||
var MAX_LIST_SEARCH_RESULTS_ROWS = 5;
|
var MAX_LIST_SEARCH_RESULTS_ROWS = 5;
|
||||||
var MAX_GRID_SEARCH_RESULTS_ROWS = 1;
|
var MAX_GRID_SEARCH_RESULTS_ROWS = 1;
|
||||||
|
|
||||||
var MaxWidthBin = GObject.registerClass(
|
var MaxWidthBox = GObject.registerClass(
|
||||||
class MaxWidthBin extends St.Bin {
|
class MaxWidthBox extends St.BoxLayout {
|
||||||
vfunc_allocate(box, flags) {
|
vfunc_allocate(box, flags) {
|
||||||
let themeNode = this.get_theme_node();
|
let themeNode = this.get_theme_node();
|
||||||
let maxWidth = themeNode.get_max_width();
|
let maxWidth = themeNode.get_max_width();
|
||||||
@ -378,22 +378,16 @@ var SearchResults = class {
|
|||||||
this.actor = new St.BoxLayout({ name: 'searchResults',
|
this.actor = new St.BoxLayout({ name: 'searchResults',
|
||||||
vertical: true });
|
vertical: true });
|
||||||
|
|
||||||
this._content = new St.BoxLayout({ name: 'searchResultsContent',
|
this._content = new MaxWidthBox({ name: 'searchResultsContent',
|
||||||
vertical: true });
|
vertical: true });
|
||||||
this._contentBin = new MaxWidthBin({ name: 'searchResultsBin',
|
|
||||||
x_fill: true,
|
|
||||||
y_fill: true,
|
|
||||||
child: this._content });
|
|
||||||
|
|
||||||
let scrollChild = new St.BoxLayout();
|
|
||||||
scrollChild.add(this._contentBin, { expand: true });
|
|
||||||
|
|
||||||
this._scrollView = new St.ScrollView({ x_fill: true,
|
this._scrollView = new St.ScrollView({ x_fill: true,
|
||||||
y_fill: false,
|
y_fill: false,
|
||||||
overlay_scrollbars: true,
|
overlay_scrollbars: true,
|
||||||
style_class: 'search-display vfade' });
|
style_class: 'search-display vfade' });
|
||||||
this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
|
this._scrollView.set_policy(St.PolicyType.NEVER, St.PolicyType.AUTOMATIC);
|
||||||
this._scrollView.add_actor(scrollChild);
|
this._scrollView.add_actor(this._content);
|
||||||
|
|
||||||
let action = new Clutter.PanAction({ interpolate: true });
|
let action = new Clutter.PanAction({ interpolate: true });
|
||||||
action.connect('pan', this._onPan.bind(this));
|
action.connect('pan', this._onPan.bind(this));
|
||||||
this._scrollView.add_action(action);
|
this._scrollView.add_action(action);
|
||||||
|
Loading…
Reference in New Issue
Block a user