[placeDisplay] Port more to CSS, lower spacing

Newer mockups have smaller spacing here.

https://bugzilla.gnome.org/show_bug.cgi?id=600734
This commit is contained in:
Colin Walters 2009-11-10 14:31:59 -05:00
parent 426d7bc515
commit 06cf6c51f3
2 changed files with 21 additions and 20 deletions

View File

@ -219,6 +219,14 @@ StTooltip {
/* Places */ /* Places */
.places-actions {
spacing: 4px;
}
#placesDevices {
padding-top: 4px;
}
/* LookingGlass */ /* LookingGlass */
#LookingGlassDialog #LookingGlassDialog

View File

@ -20,7 +20,6 @@ const GenericDisplay = imports.ui.genericDisplay;
const NAUTILUS_PREFS_DIR = '/apps/nautilus/preferences'; const NAUTILUS_PREFS_DIR = '/apps/nautilus/preferences';
const DESKTOP_IS_HOME_KEY = NAUTILUS_PREFS_DIR + '/desktop_is_home_dir'; const DESKTOP_IS_HOME_KEY = NAUTILUS_PREFS_DIR + '/desktop_is_home_dir';
const PLACES_VSPACING = 8;
const PLACES_ICON_SIZE = 16; const PLACES_ICON_SIZE = 16;
/** /**
@ -371,15 +370,15 @@ DashPlaceDisplay.prototype = {
this.actor.append(this._rightBox, Big.BoxPackFlags.EXPAND); this.actor.append(this._rightBox, Big.BoxPackFlags.EXPAND);
// Subdivide left into actions and devices // Subdivide left into actions and devices
this._actionsBox = new Big.Box({ orientation: Big.BoxOrientation.VERTICAL, this._actionsBox = new St.BoxLayout({ style_class: 'places-actions',
spacing: PLACES_VSPACING }); vertical: true });
this._devBox = new Big.Box({ orientation: Big.BoxOrientation.VERTICAL, this._devBox = new St.BoxLayout({ style_class: 'places-actions',
spacing: PLACES_VSPACING, name: 'placesDevices',
padding_top: 6 }); vertical: true });
this._dirsBox = new Big.Box({ orientation: Big.BoxOrientation.VERTICAL, this._dirsBox = new St.BoxLayout({ style_class: 'places-actions',
spacing: PLACES_VSPACING }); vertical: true });
this._leftBox.append(this._actionsBox, Big.BoxPackFlags.NONE); this._leftBox.append(this._actionsBox, Big.BoxPackFlags.NONE);
this._leftBox.append(this._devBox, Big.BoxPackFlags.NONE); this._leftBox.append(this._devBox, Big.BoxPackFlags.NONE);
@ -396,33 +395,27 @@ DashPlaceDisplay.prototype = {
}, },
_updateDefaults: function() { _updateDefaults: function() {
this._actionsBox.get_children().forEach(function (child) { this._actionsBox.destroy_children();
child.destroy();
});
let places = Main.placesManager.getDefaultPlaces(); let places = Main.placesManager.getDefaultPlaces();
for (let i = 0; i < places.length; i++) for (let i = 0; i < places.length; i++)
this._actionsBox.append(new DashPlaceDisplayItem(places[i]).actor, Big.BoxPackFlags.NONE); this._actionsBox.add(new DashPlaceDisplayItem(places[i]).actor);
}, },
_updateMounts: function() { _updateMounts: function() {
this._devBox.get_children().forEach(function (child) { this._devBox.destroy_children();
child.destroy();
});
let places = Main.placesManager.getMounts(); let places = Main.placesManager.getMounts();
for (let i = 0; i < places.length; i++) for (let i = 0; i < places.length; i++)
this._devBox.append(new DashPlaceDisplayItem(places[i]).actor, Big.BoxPackFlags.NONE); this._devBox.add(new DashPlaceDisplayItem(places[i]).actor);
}, },
_updateBookmarks: function() { _updateBookmarks: function() {
this._dirsBox.get_children().forEach(function (child) { this._dirsBox.destroy_children();
child.destroy();
});
let places = Main.placesManager.getBookmarks(); let places = Main.placesManager.getBookmarks();
for (let i = 0; i < places.length; i ++) for (let i = 0; i < places.length; i ++)
this._dirsBox.append(new DashPlaceDisplayItem(places[i]).actor, Big.BoxPackFlags.NONE); this._dirsBox.add(new DashPlaceDisplayItem(places[i]).actor);
} }
}; };