overview: Center the main overview group accordingly

Using the same logic as the panel which smartly centers everything,
smartly center the overview contents if we have enough space to do so.
This commit is contained in:
Jasper St. Pierre 2012-10-12 14:09:26 -04:00 committed by Cosimo Cecchi
parent c0f9c52ba6
commit f2dd94776c
2 changed files with 8 additions and 12 deletions

View File

@ -754,18 +754,15 @@ StScrollBar StButton#vhandle:active {
/* Search Results */ /* Search Results */
#searchResults { #searchResults {
padding: 20px 10px 10px 10px;
spacing: 18px; spacing: 18px;
} }
#searchResultsContent { #searchResultsContent {
padding-right: 20px;
spacing: 16px; spacing: 16px;
}
#searchResultsContent:rtl { /* for scrollbars */
padding-right: 0px;
padding-left: 20px; padding-left: 20px;
padding-right: 20px;
} }
.search-section { .search-section {
@ -835,15 +832,10 @@ StScrollBar StButton#vhandle:active {
} }
.all-app { .all-app {
padding: 16px 25px 16px 16px; padding: 16px;
spacing: 20px; spacing: 20px;
} }
.all-app:rtl {
padding-right: 16px;
padding-left: 25px;
}
.app-filter { .app-filter {
font-weight: bold; font-weight: bold;
height: 2.85em; height: 2.85em;

View File

@ -10,6 +10,7 @@ const St = imports.gi.St;
const Shell = imports.gi.Shell; const Shell = imports.gi.Shell;
const Gdk = imports.gi.Gdk; const Gdk = imports.gi.Gdk;
const CenterLayout = imports.ui.centerLayout;
const Dash = imports.ui.dash; const Dash = imports.ui.dash;
const DND = imports.ui.dnd; const DND = imports.ui.dnd;
const Main = imports.ui.main; const Main = imports.ui.main;
@ -141,8 +142,11 @@ const Overview = new Lang.Class({
vertical: true }); vertical: true });
this._overview._delegate = this; this._overview._delegate = this;
let layout = new CenterLayout.CenterLayout();
this._group = new St.Widget({ name: 'overview-group',
layout_manager: layout });
this._spacing = 0; this._spacing = 0;
this._group = new St.BoxLayout({ name: 'overview-group' });
this._group.connect('style-changed', this._group.connect('style-changed',
Lang.bind(this, function() { Lang.bind(this, function() {
let node = this._group.get_theme_node(); let node = this._group.get_theme_node();