Merge master into zeitgeist

This commit is contained in:
Federico Mena Quintero 2011-03-03 21:51:15 -05:00
commit 30eac56691
16 changed files with 240 additions and 207 deletions

View File

@ -469,11 +469,12 @@ StTooltip StLabel {
#searchResults { #searchResults {
padding: 20px 10px 10px 10px; padding: 20px 10px 10px 10px;
spacing: 18px;
} }
#searchResultsContent { #searchResultsContent {
padding: 0 10px; padding: 0 20px 0 0;
spacing: 8px; spacing: 36px;
} }
.search-statustext, .search-statustext,
@ -481,18 +482,11 @@ StTooltip StLabel {
padding: 4px 12px; padding: 4px 12px;
spacing: 4px; spacing: 4px;
color: #6f6f6f; color: #6f6f6f;
} font-size: .8em;
.search-section {
background-color: rgba(128, 128, 128, .1);
border: 1px solid rgba(50, 50, 50, .4);
border-radius: 10px;
} }
.search-section-results { .search-section-results {
color: #ffffff; color: #ffffff;
border-radius: 10px;
border: 1px solid rgba(50, 50, 50, .4);
padding: 6px; padding: 6px;
} }
@ -505,17 +499,18 @@ StTooltip StLabel {
} }
.search-providers-box { .search-providers-box {
spacing: 4px; spacing: 12px;
} }
.dash-search-button { .dash-search-button {
background-gradient-direction: vertical; background-gradient-direction: vertical;
background-gradient-start: rgba(255, 255, 255, 0.2); background-gradient-start: rgba(255, 255, 255, 0.2);
background-gradient-end: rgba(255, 255, 255, 0); background-gradient-end: rgba(255, 255, 255, 0);
/* border: 1px solid #808080;*/ border: 1px solid #808080;
border-radius: 10px; border-radius: 16px;
height: 32px; height: 32px;
width: 300px; width: 300px;
font-weight: bold;
} }
.dash-search-button:selected, .dash-search-button:selected,
@ -534,7 +529,11 @@ StTooltip StLabel {
.icon-grid { .icon-grid {
spacing: 36px; spacing: 36px;
-shell-grid-item-size: 70px; -shell-grid-item-size: 118px;
}
.icon-grid .overview-icon {
icon-size: 96px;
} }
.all-app { .all-app {
@ -542,15 +541,6 @@ StTooltip StLabel {
spacing: 20px; spacing: 20px;
} }
.all-app .icon-grid {
-shell-grid-item-size: 118px;
}
.all-app .overview-icon {
icon-size: 96px;
}
.app-filter { .app-filter {
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;

View File

@ -251,7 +251,10 @@ BaseAppSearchProvider.prototype = {
return null; return null;
return { 'id': resultId, return { 'id': resultId,
'name': app.get_name(), 'name': app.get_name(),
'icon': app.create_icon_texture(Search.RESULT_ICON_SIZE)}; 'createIcon': function(size) {
return app.create_icon_texture(size);
}
};
}, },
activateResult: function(id, params) { activateResult: function(id, params) {
@ -294,10 +297,6 @@ AppSearchProvider.prototype = {
let app = this._appSys.get_app(resultMeta['id']); let app = this._appSys.get_app(resultMeta['id']);
let icon = new AppWellIcon(app); let icon = new AppWellIcon(app);
return icon.actor; return icon.actor;
},
expandSearch: function(terms) {
log('TODO expand search');
} }
}; };
@ -318,12 +317,6 @@ PrefsSearchProvider.prototype = {
getSubsearchResultSet: function(previousResults, terms) { getSubsearchResultSet: function(previousResults, terms) {
return this._appSys.subsearch(true, previousResults, terms); return this._appSys.subsearch(true, previousResults, terms);
},
expandSearch: function(terms) {
let controlCenter = this._appSys.load_from_desktop_file('gnomecc.desktop');
controlCenter.launch();
Main.overview.hide();
} }
}; };

View File

@ -363,41 +363,75 @@ Chrome.prototype = {
if (!actorData.affectsStruts) if (!actorData.affectsStruts)
continue; continue;
// Limit struts to the size of the screen
let x1 = Math.max(x, 0);
let x2 = Math.min(x + w, global.screen_width);
let y1 = Math.max(y, 0);
let y2 = Math.min(y + h, global.screen_height);
// NetWM struts are not really powerful enought to handle
// a multi-monitor scenario, they only describe what happens
// around the outer sides of the full display region. However
// it can describe a partial region along each side, so
// we can support having the struts only affect the
// primary monitor. This should be enough as we only have
// chrome affecting the struts on the primary monitor so
// far.
//
// Metacity wants to know what side of the screen the // Metacity wants to know what side of the screen the
// strut is considered to be attached to. If the actor is // strut is considered to be attached to. If the actor is
// only touching one edge, or is touching the entire // only touching one edge, or is touching the entire
// width/height of one edge, then it's obvious which side // border of the primary monitor, then it's obvious which
// to call it. If it's in a corner, we pick a side // side to call it. If it's in a corner, we pick a side
// arbitrarily. If it doesn't touch any edges, or it spans // arbitrarily. If it doesn't touch any edges, or it spans
// the width/height across the middle of the screen, then // the width/height across the middle of the screen, then
// we don't create a strut for it at all. // we don't create a strut for it at all.
let side; let side;
if (w >= global.screen_width) { let primary = this._primaryMonitor;
if (y <= 0) if (x1 <= primary.x && x2 >= primary.x + primary.width) {
if (y1 <= primary.y)
side = Meta.Side.TOP; side = Meta.Side.TOP;
else if (y + h >= global.screen_height) else if (y2 >= primary.y + primary.height)
side = Meta.Side.BOTTOM; side = Meta.Side.BOTTOM;
else else
continue; continue;
} else if (h >= global.screen_height) { } else if (y1 <= primary.y && y2 >= primary.y + primary.height) {
if (x <= 0) if (x1 <= 0)
side = Meta.Side.LEFT; side = Meta.Side.LEFT;
else if (x + w >= global.screen_width) else if (x2 >= global.screen_width)
side = Meta.Side.RIGHT; side = Meta.Side.RIGHT;
else else
continue; continue;
} else if (x <= 0) } else if (x1 <= 0)
side = Meta.Side.LEFT; side = Meta.Side.LEFT;
else if (y <= 0) else if (y1 <= 0)
side = Meta.Side.TOP; side = Meta.Side.TOP;
else if (x + w >= global.screen_width) else if (x2 >= global.screen_width)
side = Meta.Side.RIGHT; side = Meta.Side.RIGHT;
else if (y + h >= global.screen_height) else if (y2 >= global.screen_height)
side = Meta.Side.BOTTOM; side = Meta.Side.BOTTOM;
else else
continue; continue;
let strut = new Meta.Strut({ rect: rect, side: side }); // Ensure that the strut rects goes all the way to the screen edge,
// as this really what mutter expects.
switch (side) {
case Meta.Side.TOP:
y1 = 0;
break;
case Meta.Side.BOTTOM:
y2 = global.screen_height;
break;
case Meta.Side.LEFT:
x1 = 0;
break;
case Meta.Side.RIGHT:
x2 = global.screen_width;
break;
}
let strutRect = new Meta.Rectangle({ x: x1, y: y1, width: x2 - x1, height: y2 - y1});
let strut = new Meta.Strut({ rect: strutRect, side: side });
struts.push(strut); struts.push(strut);
} }

View File

@ -52,8 +52,7 @@ BaseIcon.prototype = {
this.createIcon = params.createIcon; this.createIcon = params.createIcon;
this._setSizeManually = params.setSizeManually; this._setSizeManually = params.setSizeManually;
this.icon = this.createIcon(this.iconSize); this.icon = null;
this._iconBin.set_child(this.icon);
}, },
_allocate: function(actor, box, flags) { _allocate: function(actor, box, flags) {
@ -116,14 +115,15 @@ BaseIcon.prototype = {
if (!this._setSizeManually) if (!this._setSizeManually)
throw new Error('setSizeManually has to be set to use setIconsize'); throw new Error('setSizeManually has to be set to use setIconsize');
this._setIconSize(size);
},
_setIconSize: function(size) {
if (size == this.iconSize) if (size == this.iconSize)
return; return;
this.icon.destroy(); this._createIconTexture(size);
},
_createIconTexture: function(size) {
if (this.icon)
this.icon.destroy();
this.iconSize = size; this.iconSize = size;
this.icon = this.createIcon(this.iconSize); this.icon = this.createIcon(this.iconSize);
@ -139,12 +139,15 @@ BaseIcon.prototype = {
let node = this.actor.get_theme_node(); let node = this.actor.get_theme_node();
this._spacing = node.get_length('spacing'); this._spacing = node.get_length('spacing');
if (this._setSizeManually) let size;
return; if (this._setSizeManually) {
size = this.iconSize;
} else {
let [found, len] = node.lookup_length('icon-size', false);
size = found ? len : ICON_SIZE;
}
let len = node.get_length('icon-size'); this._createIconTexture(size);
if (len > 0)
this._setIconSize(len);
} }
}; };

View File

@ -196,6 +196,9 @@ function start() {
ExtensionSystem.init(); ExtensionSystem.init();
ExtensionSystem.loadExtensions(); ExtensionSystem.loadExtensions();
// Perform initial relayout here
_relayout();
panel.startStatusArea(); panel.startStatusArea();
panel.startupAnimation(); panel.startupAnimation();
@ -204,9 +207,6 @@ function start() {
global.stage.connect('captured-event', _globalKeyPressHandler); global.stage.connect('captured-event', _globalKeyPressHandler);
// Perform initial relayout here
_relayout();
_log('info', 'loaded at ' + _startDate); _log('info', 'loaded at ' + _startDate);
log('GNOME Shell started at ' + _startDate); log('GNOME Shell started at ' + _startDate);
@ -539,10 +539,8 @@ function _globalKeyPressHandler(actor, event) {
function _findModal(actor) { function _findModal(actor) {
for (let i = 0; i < modalActorFocusStack.length; i++) { for (let i = 0; i < modalActorFocusStack.length; i++) {
let [stackActor, stackFocus] = modalActorFocusStack[i]; if (modalActorFocusStack[i].actor == actor)
if (stackActor == actor) {
return i; return i;
}
} }
return -1; return -1;
} }
@ -568,7 +566,6 @@ function _findModal(actor) {
* Returns: true iff we successfully acquired a grab or already had one * Returns: true iff we successfully acquired a grab or already had one
*/ */
function pushModal(actor, timestamp) { function pushModal(actor, timestamp) {
if (timestamp == undefined) if (timestamp == undefined)
timestamp = global.get_current_time(); timestamp = global.get_current_time();
@ -582,20 +579,24 @@ function pushModal(actor, timestamp) {
global.set_stage_input_mode(Shell.StageInputMode.FULLSCREEN); global.set_stage_input_mode(Shell.StageInputMode.FULLSCREEN);
modalCount += 1; modalCount += 1;
actor.connect('destroy', function() { let actorDestroyId = actor.connect('destroy', function() {
let index = _findModal(actor); let index = _findModal(actor);
if (index >= 0) if (index >= 0)
modalActorFocusStack.splice(index, 1); modalActorFocusStack.splice(index, 1);
}); });
let curFocus = global.stage.get_key_focus(); let curFocus = global.stage.get_key_focus();
let curFocusDestroyId;
if (curFocus != null) { if (curFocus != null) {
curFocus.connect('destroy', function() { curFocusDestroyId = curFocus.connect('destroy', function() {
let index = _findModal(actor); let index = _findModal(actor);
if (index >= 0) if (index >= 0)
modalActorFocusStack[index][1] = null; modalActorFocusStack[index].actor = null;
}); });
} }
modalActorFocusStack.push([actor, curFocus]); modalActorFocusStack.push({ actor: actor,
focus: curFocus,
destroyId: actorDestroyId,
focusDestroyId: curFocusDestroyId });
global.stage.set_key_focus(actor); global.stage.set_key_focus(actor);
return true; return true;
@ -615,28 +616,42 @@ function pushModal(actor, timestamp) {
* global.get_current_time() is assumed. * global.get_current_time() is assumed.
*/ */
function popModal(actor, timestamp) { function popModal(actor, timestamp) {
if (timestamp == undefined) if (timestamp == undefined)
timestamp = global.get_current_time(); timestamp = global.get_current_time();
modalCount -= 1;
let focusIndex = _findModal(actor); let focusIndex = _findModal(actor);
if (focusIndex >= 0) { if (focusIndex < 0) {
if (focusIndex == modalActorFocusStack.length - 1) { global.stage.set_key_focus(null);
let [stackActor, stackFocus] = modalActorFocusStack[focusIndex]; global.end_modal(timestamp);
global.stage.set_key_focus(stackFocus); global.set_stage_input_mode(Shell.StageInputMode.NORMAL);
} else {
// Remove from the middle, shift the focus chain up throw new Error('incorrect pop');
for (let i = focusIndex; i < modalActorFocusStack.length - 1; i++) {
modalActorFocusStack[i + 1][1] = modalActorFocusStack[i][1];
}
}
modalActorFocusStack.splice(focusIndex, 1);
} }
modalCount -= 1;
let record = modalActorFocusStack[focusIndex];
record.actor.disconnect(record.destroyId);
if (focusIndex == modalActorFocusStack.length - 1) {
if (record.focus)
record.focus.disconnect(record.focusDestroyId);
global.stage.set_key_focus(record.focus);
} else {
let t = modalActorFocusStack[modalActorFocusStack.length - 1];
if (t.focus)
t.focus.disconnect(t.focusDestroyId);
// Remove from the middle, shift the focus chain up
for (let i = modalActorFocusStack.length - 1; i > focusIndex; i--) {
modalActorFocusStack[i].focus = modalActorFocusStack[i - 1].focus;
modalActorFocusStack[i].focusDestroyId = modalActorFocusStack[i - 1].focusDestroyId;
}
}
modalActorFocusStack.splice(focusIndex, 1);
if (modalCount > 0) if (modalCount > 0)
return; return;
global.stage.set_key_focus(null);
global.end_modal(timestamp); global.end_modal(timestamp);
global.set_stage_input_mode(Shell.StageInputMode.NORMAL); global.set_stage_input_mode(Shell.StageInputMode.NORMAL);
} }

View File

@ -421,6 +421,7 @@ Notification.prototype = {
!this._actionArea.contains(event.get_source())) !this._actionArea.contains(event.get_source()))
this._onClicked(); this._onClicked();
})); }));
this.actor.connect('destroy', Lang.bind(this, this._onDestroy));
this._buttonFocusManager = St.FocusManager.get_for_stage(global.stage); this._buttonFocusManager = St.FocusManager.get_for_stage(global.stage);
@ -763,6 +764,8 @@ Notification.prototype = {
}, },
collapseCompleted: function() { collapseCompleted: function() {
if (this._destroyed)
return;
this.expanded = false; this.expanded = false;
// Make sure we don't line wrap the title, and ellipsize it instead. // Make sure we don't line wrap the title, and ellipsize it instead.
this._titleLabel.clutter_text.line_wrap = false; this._titleLabel.clutter_text.line_wrap = false;
@ -794,13 +797,18 @@ Notification.prototype = {
this.destroy(); this.destroy();
}, },
destroy: function(reason) { _onDestroy: function() {
if (this._destroyed) if (this._destroyed)
return; return;
this._destroyed = true; this._destroyed = true;
if (!reason) if (!this._destroyedReason)
reason = NotificationDestroyedReason.DISMISSED; this._destroyedReason = NotificationDestroyedReason.DISMISSED;
this.emit('destroy', reason); this.emit('destroy', this._destroyedReason);
},
destroy: function(reason) {
this._destroyedReason = reason;
this.actor.destroy();
} }
}; };
Signals.addSignalMethods(Notification.prototype); Signals.addSignalMethods(Notification.prototype);
@ -1135,10 +1143,7 @@ MessageTray.prototype = {
this._onSummaryItemClicked(summaryItem); this._onSummaryItemClicked(summaryItem);
})); }));
source.connect('destroy', Lang.bind(this, source.connect('destroy', Lang.bind(this, this._onSourceDestroy));
function () {
this.removeSource(source);
}));
// We need to display the newly-added summary item, but if the // We need to display the newly-added summary item, but if the
// caller is about to post a notification, we want to show that // caller is about to post a notification, we want to show that
@ -1147,20 +1152,12 @@ MessageTray.prototype = {
Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() { this._updateState(); return false; })); Meta.later_add(Meta.LaterType.BEFORE_REDRAW, Lang.bind(this, function() { this._updateState(); return false; }));
}, },
removeSource: function(source) { _onSourceDestroy: function(source) {
let index = this._getIndexOfSummaryItemForSource(source); let index = this._getIndexOfSummaryItemForSource(source);
if (index == -1) if (index == -1)
return; return;
// remove all notifications with this source from the queue this._summaryItems[index].actor.destroy();
let newNotificationQueue = [];
for (let i = 0; i < this._notificationQueue.length; i++) {
if (this._notificationQueue[i].source != source)
newNotificationQueue.push(this._notificationQueue[i]);
}
this._notificationQueue = newNotificationQueue;
this._summary.remove_actor(this._summaryItems[index].actor);
let newSummaryItemsIndex = this._newSummaryItems.indexOf(this._summaryItems[index]); let newSummaryItemsIndex = this._newSummaryItems.indexOf(this._summaryItems[index]);
if (newSummaryItemsIndex != -1) if (newSummaryItemsIndex != -1)
@ -1202,9 +1199,16 @@ MessageTray.prototype = {
if (needUpdate); if (needUpdate);
this._updateState(); this._updateState();
// remove all notifications with this source from the queue
let newNotificationQueue = [];
for (let i = this._notificationQueue.length - 1; i >= 0; i--) {
if (this._notificationQueue[i].source == source)
this._notificationQueue[i].destroy();
}
}, },
removeNotification: function(notification) { _onNotificationDestroy: function(notification) {
if (this._notification == notification && (this._notificationState == State.SHOWN || this._notificationState == State.SHOWING)) { if (this._notification == notification && (this._notificationState == State.SHOWN || this._notificationState == State.SHOWING)) {
this._updateNotificationTimeout(0); this._updateNotificationTimeout(0);
this._notificationRemoved = true; this._notificationRemoved = true;
@ -1213,6 +1217,7 @@ MessageTray.prototype = {
} }
let index = this._notificationQueue.indexOf(notification); let index = this._notificationQueue.indexOf(notification);
notification.destroy();
if (index != -1) if (index != -1)
this._notificationQueue.splice(index, 1); this._notificationQueue.splice(index, 1);
}, },
@ -1248,7 +1253,7 @@ MessageTray.prototype = {
this._updateShowingNotification(); this._updateShowingNotification();
} else if (this._notificationQueue.indexOf(notification) < 0) { } else if (this._notificationQueue.indexOf(notification) < 0) {
notification.connect('destroy', notification.connect('destroy',
Lang.bind(this, this.removeNotification)); Lang.bind(this, this._onNotificationDestroy));
this._notificationQueue.push(notification); this._notificationQueue.push(notification);
this._notificationQueue.sort(function(notification1, notification2) { this._notificationQueue.sort(function(notification1, notification2) {
return (notification2.urgency - notification1.urgency); return (notification2.urgency - notification1.urgency);

View File

@ -659,20 +659,20 @@ Overview.prototype = {
if (this._shown) { if (this._shown) {
if (!this._modal) { if (!this._modal) {
if (Main.pushModal(this.dash.actor)) if (Main.pushModal(this._group))
this._modal = true; this._modal = true;
else else
this.hide(); this.hide();
} }
} else if (this._shownTemporarily) { } else if (this._shownTemporarily) {
if (this._modal) { if (this._modal) {
Main.popModal(this.dash.actor); Main.popModal(this._group);
this._modal = false; this._modal = false;
} }
global.stage_input_mode = Shell.StageInputMode.FULLSCREEN; global.stage_input_mode = Shell.StageInputMode.FULLSCREEN;
} else { } else {
if (this._modal) { if (this._modal) {
Main.popModal(this.dash.actor); Main.popModal(this._group);
this._modal = false; this._modal = false;
} }
else if (global.stage_input_mode == Shell.StageInputMode.FULLSCREEN) else if (global.stage_input_mode == Shell.StageInputMode.FULLSCREEN)

View File

@ -25,6 +25,8 @@ const PANEL_HEIGHT = 26;
const PANEL_ICON_SIZE = 24; const PANEL_ICON_SIZE = 24;
const STARTUP_ANIMATION_TIME = 0.2;
const HOT_CORNER_ACTIVATION_TIMEOUT = 0.5; const HOT_CORNER_ACTIVATION_TIMEOUT = 0.5;
const BUTTON_DND_ACTIVATION_TIMEOUT = 250; const BUTTON_DND_ACTIVATION_TIMEOUT = 250;
@ -1042,10 +1044,25 @@ Panel.prototype = {
}, },
startupAnimation: function() { startupAnimation: function() {
this.actor.y = -this.actor.height; let oldY = this.actor.y;
this.actor.y = oldY - this.actor.height;
Tweener.addTween(this.actor, Tweener.addTween(this.actor,
{ y: 0, { y: oldY,
time: 0.2, time: STARTUP_ANIMATION_TIME,
transition: 'easeOutQuad'
});
let oldCornerY = this._leftCorner.actor.y;
this._leftCorner.actor.y = oldCornerY - this.actor.height;
this._rightCorner.actor.y = oldCornerY - this.actor.height;
Tweener.addTween(this._leftCorner.actor,
{ y: oldCornerY,
time: STARTUP_ANIMATION_TIME,
transition: 'easeOutQuad'
});
Tweener.addTween(this._rightCorner.actor,
{ y: oldCornerY,
time: STARTUP_ANIMATION_TIME,
transition: 'easeOutQuad' transition: 'easeOutQuad'
}); });
}, },

View File

@ -415,7 +415,10 @@ PlaceSearchProvider.prototype = {
return null; return null;
return { 'id': resultId, return { 'id': resultId,
'name': placeInfo.name, 'name': placeInfo.name,
'icon': placeInfo.iconFactory(Search.RESULT_ICON_SIZE) }; 'createIcon': function(size) {
return placeInfo.iconFactory(size);
}
};
}, },
activateResult: function(id, params) { activateResult: function(id, params) {

View File

@ -15,8 +15,6 @@ const Main = imports.ui.main;
const DISABLED_OPEN_SEARCH_PROVIDERS_KEY = 'disabled-open-search-providers'; const DISABLED_OPEN_SEARCH_PROVIDERS_KEY = 'disabled-open-search-providers';
const RESULT_ICON_SIZE = 48;
// Not currently referenced by the search API, but // Not currently referenced by the search API, but
// this enumeration can be useful for provider // this enumeration can be useful for provider
// implementations. // implementations.
@ -202,8 +200,9 @@ SearchProvider.prototype = {
* getResultInfo: * getResultInfo:
* @id: Result identifier string * @id: Result identifier string
* *
* Return an object with 'id', 'name', (both strings) and 'icon' (Clutter.Texture) * Return an object with 'id', 'name', (both strings) and 'createIcon'
* properties which describe the given search result. * (function(size) returning a Clutter.Texture) properties which describe
* the given search result.
*/ */
getResultMeta: function(id) { getResultMeta: function(id) {
throw new Error('Not implemented'); throw new Error('Not implemented');
@ -246,17 +245,6 @@ SearchProvider.prototype = {
*/ */
activateResult: function(id) { activateResult: function(id) {
throw new Error('Not implemented'); throw new Error('Not implemented');
},
/**
* expandSearch:
*
* Called when the user clicks on the header for this
* search section. Should typically launch an external program
* displaying search results for that item type.
*/
expandSearch: function(terms) {
throw new Error('Not implemented');
} }
}; };
Signals.addSignalMethods(SearchProvider.prototype); Signals.addSignalMethods(SearchProvider.prototype);

View File

@ -13,7 +13,7 @@ const Main = imports.ui.main;
const Overview = imports.ui.overview; const Overview = imports.ui.overview;
const Search = imports.ui.search; const Search = imports.ui.search;
const MAX_SEARCH_RESULTS_ROWS = 2; const MAX_SEARCH_RESULTS_ROWS = 1;
function SearchResult(provider, metaInfo, terms) { function SearchResult(provider, metaInfo, terms) {
@ -36,9 +36,7 @@ SearchResult.prototype = {
reactive: true, reactive: true,
track_hover: true }); track_hover: true });
let icon = new IconGrid.BaseIcon(this.metaInfo['name'], let icon = new IconGrid.BaseIcon(this.metaInfo['name'],
{ createIcon: Lang.bind(this, function(size) { { createIcon: this.metaInfo['createIcon'] });
return this.metaInfo['icon'];
})});
content.set_child(icon.actor); content.set_child(icon.actor);
} }
this._content = content; this._content = content;
@ -244,18 +242,9 @@ SearchResults.prototype = {
createProviderMeta: function(provider) { createProviderMeta: function(provider) {
let providerBox = new St.BoxLayout({ style_class: 'search-section', let providerBox = new St.BoxLayout({ style_class: 'search-section',
vertical: true }); vertical: true });
let titleButton = new St.Button({ style_class: 'search-section-header', let title = new St.Label({ style_class: 'search-section-header',
reactive: true, text: provider.title });
x_fill: true, providerBox.add(title);
y_fill: true });
titleButton.connect('clicked', Lang.bind(this, function () { this._onHeaderClicked(provider); }));
providerBox.add(titleButton);
let titleBox = new St.BoxLayout();
titleButton.set_child(titleBox);
let title = new St.Label({ text: provider.title });
let count = new St.Label();
titleBox.add(title, { expand: true });
titleBox.add(count);
let resultDisplayBin = new St.Bin({ style_class: 'search-section-results', let resultDisplayBin = new St.Bin({ style_class: 'search-section-results',
x_fill: true, x_fill: true,
@ -268,8 +257,7 @@ SearchResults.prototype = {
resultDisplayBin.set_child(resultDisplay.actor); resultDisplayBin.set_child(resultDisplay.actor);
this._providerMeta.push({ actor: providerBox, this._providerMeta.push({ actor: providerBox,
resultDisplay: resultDisplay, resultDisplay: resultDisplay });
count: count });
this._content.add(providerBox); this._content.add(providerBox);
}, },
@ -326,7 +314,6 @@ SearchResults.prototype = {
let meta = this._metaForProvider(provider); let meta = this._metaForProvider(provider);
meta.actor.show(); meta.actor.show();
meta.resultDisplay.renderResults(providerResults, terms); meta.resultDisplay.renderResults(providerResults, terms);
meta.count.set_text('' + providerResults.length);
} }
if (this._selectedOpenSearchButton == -1) if (this._selectedOpenSearchButton == -1)
@ -335,10 +322,6 @@ SearchResults.prototype = {
return true; return true;
}, },
_onHeaderClicked: function(provider) {
provider.expandSearch(this._searchSystem.getTerms());
},
_modifyActorSelection: function(resultDisplay, up) { _modifyActorSelection: function(resultDisplay, up) {
let success; let success;
let index = resultDisplay.getSelectionIndex(); let index = resultDisplay.getSelectionIndex();

View File

@ -25,16 +25,12 @@ const KEY_MOUSE_KEYS_ENABLED = 'mousekeys-enable';
const APPLICATIONS_SCHEMA = 'org.gnome.desktop.a11y.applications'; const APPLICATIONS_SCHEMA = 'org.gnome.desktop.a11y.applications';
const XSETTINGS_SCHEMA = 'org.gnome.settings-daemon.plugins.xsettings';
const KEY_DPI = 'dpi';
const DPI_LOW_REASONABLE_VALUE = 50; const DPI_LOW_REASONABLE_VALUE = 50;
const DPI_HIGH_REASONABLE_VALUE = 500; const DPI_HIGH_REASONABLE_VALUE = 500;
const DPI_FACTOR_LARGE = 1.25; const DPI_FACTOR_LARGE = 1.25;
const DPI_FACTOR_LARGER = 1.5; const DPI_FACTOR_LARGER = 1.5;
const DPI_FACTOR_LARGEST = 2.0; const DPI_FACTOR_LARGEST = 2.0;
const DPI_DEFAULT = 96;
const KEY_META_DIR = '/apps/metacity/general'; const KEY_META_DIR = '/apps/metacity/general';
const KEY_VISUAL_BELL = KEY_META_DIR + '/visual_bell'; const KEY_VISUAL_BELL = KEY_META_DIR + '/visual_bell';
@ -42,25 +38,10 @@ const KEY_VISUAL_BELL = KEY_META_DIR + '/visual_bell';
const DESKTOP_INTERFACE_SCHEMA = 'org.gnome.desktop.interface'; const DESKTOP_INTERFACE_SCHEMA = 'org.gnome.desktop.interface';
const KEY_GTK_THEME = 'gtk-theme'; const KEY_GTK_THEME = 'gtk-theme';
const KEY_ICON_THEME = 'icon-theme'; const KEY_ICON_THEME = 'icon-theme';
const KEY_TEXT_SCALING_FACTOR = 'text-scaling-factor';
const HIGH_CONTRAST_THEME = 'HighContrast'; const HIGH_CONTRAST_THEME = 'HighContrast';
function getDPIFromX() {
let screen = global.get_gdk_screen();
if (screen) {
let width_dpi = (screen.get_width() / (screen.get_width_mm() / 25.4));
let height_dpi = (screen.get_height() / (screen.get_height_mm() / 25.4));
if (width_dpi < DPI_LOW_REASONABLE_VALUE
|| width_dpi > DPI_HIGH_REASONABLE_VALUE
|| height_dpi < DPI_LOW_REASONABLE_VALUE
|| height_dpi > DPI_HIGH_REASONABLE_VALUE)
return DPI_DEFAULT;
else
return (width_dpi + height_dpi) / 2;
}
return DPI_DEFAULT;
}
function ATIndicator() { function ATIndicator() {
this._init.apply(this, arguments); this._init.apply(this, arguments);
} }
@ -194,30 +175,23 @@ ATIndicator.prototype = {
}, },
_buildFontItem: function() { _buildFontItem: function() {
let settings = new Gio.Settings({ schema: XSETTINGS_SCHEMA }); let settings = new Gio.Settings({ schema: DESKTOP_INTERFACE_SCHEMA });
// we assume this never changes (which is not true if resolution let factor = settings.get_double(KEY_TEXT_SCALING_FACTOR);
// is changed, but we would need XRandR events for that) let initial_setting = (factor > 1.0);
let x_value = getDPIFromX();
let user_value;
function on_get() {
user_value = settings.get_double(KEY_DPI);
return (user_value - (DPI_FACTOR_LARGE * x_value) > -1);
}
let initial_setting = on_get();
let default_value = (initial_setting || user_value == 0) ? x_value : user_value;
let widget = this._buildItemExtended(_("Large Text"), let widget = this._buildItemExtended(_("Large Text"),
initial_setting, initial_setting,
settings.is_writable(KEY_DPI), settings.is_writable(KEY_TEXT_SCALING_FACTOR),
function (enabled) { function (enabled) {
if (enabled) if (enabled)
settings.set_double(KEY_DPI, DPI_FACTOR_LARGE * default_value); settings.set_double(KEY_TEXT_SCALING_FACTOR,
DPI_FACTOR_LARGE);
else else
settings.set_double(KEY_DPI, default_value); settings.reset(KEY_TEXT_SCALING_FACTOR);
}); });
settings.connect('changed::' + KEY_DPI, function() { settings.connect('changed::' + KEY_TEXT_SCALING_FACTOR, function() {
let active = on_get(); let factor = settings.get_double(KEY_TEXT_SCALING_FACTOR);
default_value = (active || user_value == 0) ? x_value : user_value; let active = (factor > 1.0);
widget.setToggleState(active); widget.setToggleState(active);
}); });
return widget; return widget;

View File

@ -72,7 +72,7 @@ Indicator.prototype = {
this._hasPrimary = false; this._hasPrimary = false;
this._primaryDeviceId = null; this._primaryDeviceId = null;
this._batteryItem = new PopupMenu.PopupMenuItem(''); this._batteryItem = new PopupMenu.PopupMenuItem('', { reactive: false });
this._primaryPercentage = new St.Label(); this._primaryPercentage = new St.Label();
this._batteryItem.addActor(this._primaryPercentage, { align: St.Align.END }); this._batteryItem.addActor(this._primaryPercentage, { align: St.Align.END });
this.menu.addMenuItem(this._batteryItem); this.menu.addMenuItem(this._batteryItem);
@ -136,17 +136,6 @@ Indicator.prototype = {
} }
this._primaryDeviceId = device_id; this._primaryDeviceId = device_id;
if (this._primaryDeviceId) {
this._batteryItem.actor.reactive = true;
this._batteryItem.actor.can_focus = true;
this._batteryItem.connect('activate', function(item) {
Util.spawn(['gnome-power-statistics', '--device', device_id]);
});
} else {
// virtual device
this._batteryItem.actor.reactive = false;
this._batteryItem.actor.can_focus = false;
}
})); }));
}, },
@ -168,9 +157,6 @@ Indicator.prototype = {
continue; continue;
let item = new DeviceItem (devices[i]); let item = new DeviceItem (devices[i]);
item.connect('activate', function() {
Util.spawn(['gnome-power-statistics', '--device', device_id]);
});
this._deviceItems.push(item); this._deviceItems.push(item);
this.menu.addMenuItem(item, this._otherDevicePosition + position); this.menu.addMenuItem(item, this._otherDevicePosition + position);
position++; position++;
@ -216,7 +202,7 @@ DeviceItem.prototype = {
__proto__: PopupMenu.PopupBaseMenuItem.prototype, __proto__: PopupMenu.PopupBaseMenuItem.prototype,
_init: function(device) { _init: function(device) {
PopupMenu.PopupBaseMenuItem.prototype._init.call(this); PopupMenu.PopupBaseMenuItem.prototype._init.call(this, { reactive: false });
let [device_id, device_type, icon, percentage, state, time] = device; let [device_id, device_type, icon, percentage, state, time] = device;

View File

@ -84,7 +84,10 @@ ZeitgeistAsyncSearchProvider.prototype = {
getResultMeta: function(resultId) { getResultMeta: function(resultId) {
return { 'id': ZeitgeistSubjectCache[resultId].uri, return { 'id': ZeitgeistSubjectCache[resultId].uri,
'name': ZeitgeistSubjectCache[resultId].name, 'name': ZeitgeistSubjectCache[resultId].name,
'icon': ZeitgeistSubjectCache[resultId].createIcon(48) }; 'createIcon': function (size) {
return ZeitgeistSubjectCache[resultId].createIcon(size);
},
};
}, },
activateResult: function(resultId) { activateResult: function(resultId) {

View File

@ -63,7 +63,7 @@ fi
# spidermonkey ({mozilla,firefox,xulrunner}-js), startup-notification, # spidermonkey ({mozilla,firefox,xulrunner}-js), startup-notification,
# xdamage, icon-naming-utils, upower, libtool-ltdl, libvorbis, # xdamage, icon-naming-utils, upower, libtool-ltdl, libvorbis,
# libgcrypt, libtasn1, libgnome-keyring, libgtop, cups, # libgcrypt, libtasn1, libgnome-keyring, libgtop, cups,
# evolution-data-server libusb # libusb, libproxy, libdb, libproxy, sqlite
# #
# Non-devel packages needed by gnome-shell and its deps: # Non-devel packages needed by gnome-shell and its deps:
# glxinfo, gstreamer-plugins-base, gstreamer-plugins-good, # glxinfo, gstreamer-plugins-base, gstreamer-plugins-good,
@ -82,8 +82,8 @@ if test "x$system" = xUbuntu -o "x$system" = xDebian -o "x$system" = xLinuxMint
xulrunner-dev libcroco3-dev xulrunner-dev libcroco3-dev
libgstreamer0.10-dev gstreamer0.10-plugins-base gstreamer0.10-plugins-good libgstreamer0.10-dev gstreamer0.10-plugins-base gstreamer0.10-plugins-good
libltdl-dev libvorbis-dev iso-codes libgnome-keyring-dev libusb-1.0-0-dev libltdl-dev libvorbis-dev iso-codes libgnome-keyring-dev libusb-1.0-0-dev
libupower-glib-dev libcups2-dev evolution-data-server-dev libupower-glib-dev libcups2-dev libproxy-dev libdb-dev libproxy-dev
libecal1.2-dev libedataserverui1.2-dev libsqlite3-dev
" "
if apt-cache show autopoint > /dev/null 2> /dev/null; then if apt-cache show autopoint > /dev/null 2> /dev/null; then
@ -121,7 +121,8 @@ if test "x$system" = xFedora ; then
startup-notification-devel zenity startup-notification-devel zenity
icon-naming-utils upower-devel libtool-ltdl-devel libvorbis-devel icon-naming-utils upower-devel libtool-ltdl-devel libvorbis-devel
iso-codes-devel libgcrypt-devel libtasn1-devel libtasn1-tools libusb1-devel iso-codes-devel libgcrypt-devel libtasn1-devel libtasn1-tools libusb1-devel
libgnome-keyring-devel libgtop2-devel cups-devel evolution-data-server-devel libgnome-keyring-devel libgtop2-devel cups-devel db4-devel libproxy-devel
sqlite-devel
" "
if expr $version \>= 14 > /dev/null ; then if expr $version \>= 14 > /dev/null ; then

View File

@ -200,6 +200,43 @@
</dependencies> </dependencies>
</autotools> </autotools>
<autotools id="glib-networking">
<branch repo="git.gnome.org" module="glib-networking"/>
<dependencies>
<dep package="glib"/>
</dependencies>
</autotools>
<autotools id="libsoup">
<branch repo="git.gnome.org" module="libsoup"/>
<dependencies>
<dep package="glib-networking"/>
</dependencies>
</autotools>
<autotools id="libgdata">
<branch repo="git.gnome.org" module="libgdata"/>
<dependencies>
<dep package="libsoup"/>
</dependencies>
</autotools>
<autotools id="libgweather">
<branch repo="git.gnome.org" module="libgweather"/>
<dependencies>
<dep package="libsoup"/>
</dependencies>
</autotools>
<autotools id="evolution-data-server">
<branch repo="git.gnome.org" module="evolution-data-server"/>
<dependencies>
<dep package="libgweather"/>
<dep package="libgdata"/>
<dep package="gtk3"/>
</dependencies>
</autotools>
<autotools id="gnome-power-manager"> <autotools id="gnome-power-manager">
<branch repo="git.gnome.org" module="gnome-power-manager" /> <branch repo="git.gnome.org" module="gnome-power-manager" />
<dependencies> <dependencies>
@ -223,6 +260,7 @@
<autotools id="gnome-shell" autogenargs="--enable-jhbuild-wrapper-script"> <autotools id="gnome-shell" autogenargs="--enable-jhbuild-wrapper-script">
<branch repo="git.gnome.org" module="gnome-shell"/> <branch repo="git.gnome.org" module="gnome-shell"/>
<dependencies> <dependencies>
<dep package="evolution-data-server"/>
<dep package="gobject-introspection"/> <dep package="gobject-introspection"/>
<dep package="mutter"/> <dep package="mutter"/>
<dep package="gjs"/> <dep package="gjs"/>