st-box-layout: Remove insert_actor/insert_before

Now that 'insert_child_at_index' and 'insert_child_below' exist
on ClutterActor, these aren't necessary.

https://bugzilla.gnome.org/show_bug.cgi?id=670034
This commit is contained in:
Jasper St. Pierre
2012-02-13 15:27:16 -05:00
parent c892610f27
commit a8b081661c
9 changed files with 14 additions and 85 deletions

View File

@ -677,8 +677,8 @@ const Dash = new Lang.Class({
}
for (let i = 0; i < addedItems.length; i++)
this._box.insert_actor(addedItems[i].item.actor,
addedItems[i].pos);
this._box.insert_child_at_index(addedItems[i].item.actor,
addedItems[i].pos);
for (let i = 0; i < removedActors.length; i++) {
let item = removedActors[i]._delegate;
@ -787,8 +787,8 @@ const Dash = new Lang.Class({
this._dragPlaceholder = new DragPlaceholderItem();
this._dragPlaceholder.child.set_width (this.iconSize);
this._dragPlaceholder.child.set_height (this.iconSize / 2);
this._box.insert_actor(this._dragPlaceholder.actor,
this._dragPlaceholderPos);
this._box.insert_child_at_index(this._dragPlaceholder.actor,
this._dragPlaceholderPos);
if (fadeIn)
this._dragPlaceholder.animateIn();
}

View File

@ -1038,7 +1038,7 @@ const LookingGlass = new Lang.Class({
actor.add(padBin);
this._completionActor = actor;
this._evalBox.insert_before(this._completionActor, this._entryArea);
this._evalBox.insert_child_below(this._completionActor, this._entryArea);
}
this._completionText.set_text(completions.join(', '));

View File

@ -1520,10 +1520,10 @@ const MessageTray = new Lang.Class({
let summaryItem = new SummaryItem(source);
if (source.isChat) {
this._summary.insert_actor(summaryItem.actor, 0);
this._summary.insert_child_at_index(summaryItem.actor, 0);
this._chatSummaryItemsCount++;
} else {
this._summary.insert_actor(summaryItem.actor, this._chatSummaryItemsCount);
this._summary.insert_child_at_index(summaryItem.actor, this._chatSummaryItemsCount);
}
let titleWidth = summaryItem.getTitleNaturalWidth();

View File

@ -1078,13 +1078,13 @@ const Panel = new Lang.Class({
for (i = children.length - 1; i >= 0; i--) {
let rolePosition = children[i]._rolePosition;
if (position > rolePosition) {
this._rightBox.insert_actor(actor, i + 1);
this._rightBox.insert_child_at_index(actor, i + 1);
break;
}
}
if (i == -1) {
// If we didn't find a position, we must be first
this._rightBox.insert_actor(actor, 0);
this._rightBox.insert_child_at_index(actor, 0);
}
actor._rolePosition = position;
},

View File

@ -1010,10 +1010,12 @@ const PopupMenuBase = new Lang.Class({
let items = this._getMenuItems();
if (position < items.length) {
before_item = items[position].actor;
this.box.insert_before(menuItem.actor, before_item);
} else
this.box.insert_child_below(menuItem.actor, before_item);
} else {
this.box.add(menuItem.actor);
}
}
if (menuItem instanceof PopupMenuSection) {
this._connectSubMenuSignals(menuItem, menuItem);
menuItem._closingId = this.connect('open-state-changed',
@ -1031,7 +1033,7 @@ const PopupMenuBase = new Lang.Class({
if (before_item == null)
this.box.add(menuItem.menu.actor);
else
this.box.insert_before(menuItem.menu.actor, before_item);
this.box.insert_child_below(menuItem.menu.actor, before_item);
this._connectSubMenuSignals(menuItem, menuItem.menu);
this._connectItemSignals(menuItem);
menuItem._closingId = this.connect('open-state-changed', function(self, open) {