OverviewControl: simplify code to add bottom padding

All the complexity with a custom actor and a generic container was
just to add some padding below the overview controls. Remove that,
and use CSS instead.

https://bugzilla.gnome.org/show_bug.cgi?id=694100
This commit is contained in:
Giovanni Campagna 2013-02-18 16:25:28 +01:00
parent 3044a6b517
commit a187111a26
3 changed files with 5 additions and 24 deletions

View File

@ -629,6 +629,7 @@ StScrollBar StButton#vhandle:active {
#overview {
spacing: 24px;
padding-bottom: 32px;
}
.window-caption {

View File

@ -231,8 +231,7 @@ const Overview = new Lang.Class({
this._thumbnailsBox = new WorkspaceThumbnail.ThumbnailsBox();
this._controls = new OverviewControls.ControlsManager(this._dash,
this._thumbnailsBox,
this._viewSelector,
this._searchEntryBin);
this._viewSelector);
// Pack all the actors into the group
this._group.add_actor(this._controls.dashActor);

View File

@ -294,34 +294,15 @@ const DashSlider = new Lang.Class({
}
});
const SlidingControlContainer = new Lang.Class({
Name: 'SlidingControlContainer',
Extends: St.Widget,
_init: function(child, entryBin) {
this._layout = new Clutter.BoxLayout({ vertical: true });
this.parent({ layout_manager: this._layout });
child.x_expand = true;
this.add_actor(child);
let entryClone = new Shell.GenericContainer();
entryClone.connect('get-preferred-height', function(actor, forWidth, alloc) {
[alloc.min_size, alloc.natural_size] = [entryBin.height, entryBin.height];
});
this.add_actor(entryClone);
}
});
const ControlsManager = new Lang.Class({
Name: 'ControlsManager',
_init: function(dash, thumbnails, viewSelector, entryBin) {
_init: function(dash, thumbnails, viewSelector) {
this._dashSlider = new DashSlider(dash);
this.dashActor = new SlidingControlContainer(this._dashSlider.actor, entryBin);
this.dashActor = this._dashSlider.actor;
this._thumbnailsSlider = new ThumbnailsSlider(thumbnails);
this.thumbnailsActor = new SlidingControlContainer(this._thumbnailsSlider.actor, entryBin);
this.thumbnailsActor = this._thumbnailsSlider.actor;
this._viewSelector = viewSelector;
this._viewSelector.connect('page-changed', Lang.bind(this, this._setVisibility));