Skip to content

Commit dd089f1

Browse files
committed
Adapt to new alocation API
1 parent 88c740f commit dd089f1

30 files changed

+296
-316
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ debian/files
1212
debian/tmp/
1313
obj-x86_64-linux-gnu
1414
*.pyc
15+
.cache

files/usr/share/cinnamon/applets/calendar@cinnamon.org/calendar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ class Calendar {
526526
}
527527
}
528528

529-
_allocate_dot_box (actor, box, flags) {
529+
_allocate_dot_box (actor, box) {
530530
let children = actor.get_children();
531531

532532
if (children.length == 0) {
@@ -567,7 +567,7 @@ class Calendar {
567567
cbox.y2 = cbox.y1 + nh;
568568

569569
while (i < ((dot_row * max_children_per_row) + dots_this_row)) {
570-
children[i].allocate(cbox, flags);
570+
children[i].allocate(cbox);
571571

572572
cbox.x1 += nw;
573573
cbox.x2 += nw;

files/usr/share/cinnamon/applets/grouped-window-list@cinnamon.org/appGroup.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ class AppGroup {
404404
alloc.natural_size = Math.max(iconNaturalSize, labelNaturalSize);
405405
}
406406

407-
allocate(actor, box, flags) {
407+
allocate(actor, box) {
408408
const allocWidth = box.x2 - box.x1;
409409
const allocHeight = box.y2 - box.y1;
410410
const childBox = new Clutter.ActorBox();
@@ -430,7 +430,7 @@ class AppGroup {
430430
[childBox.x1, childBox.x2] = center(allocWidth + offset, naturalWidth);
431431
}
432432

433-
this.iconBox.allocate(childBox, flags);
433+
this.iconBox.allocate(childBox);
434434

435435
// Set windows badge position
436436
const windowBadgeOffset = 3 * global.ui_scale;
@@ -446,7 +446,7 @@ class AppGroup {
446446
const windowLabelPosY = Math.floor((windowBadgesize - wLabelNaturalHeight) / 2);
447447
this.windowsBadgeLabel.set_anchor_point(-windowLabelPosX, -windowLabelPosY);
448448
this.windowsBadge.set_size(windowBadgesize, windowBadgesize);
449-
this.windowsBadge.allocate(windowBadgeBox, flags);
449+
this.windowsBadge.allocate(windowBadgeBox);
450450

451451
// Set notifications badge position
452452
const notifBadgeOffset = 3 * global.ui_scale;
@@ -462,7 +462,7 @@ class AppGroup {
462462
const notifLabelPosY = Math.floor((notifBadgesize - nLabelNaturalHeight) / 2);
463463
this.notificationsBadgeLabel.set_anchor_point(-notifLabelPosX, -notifLabelPosY);
464464
this.notificationsBadge.set_size(notifBadgesize, notifBadgesize);
465-
this.notificationsBadge.allocate(notifBadgeBox, flags);
465+
this.notificationsBadge.allocate(notifBadgeBox);
466466

467467
// Set label position
468468
if (this.drawLabel) {
@@ -492,7 +492,7 @@ class AppGroup {
492492
else
493493
this.label.set_style('text-align: right;');
494494

495-
this.label.allocate(childBox, flags);
495+
this.label.allocate(childBox);
496496
}
497497

498498
// Call set_icon_geometry for support of Cinnamon's minimize animation
@@ -507,7 +507,7 @@ class AppGroup {
507507
});
508508
}
509509

510-
if (this.progressOverlay.visible) this.allocateProgress(childBox, flags);
510+
if (this.progressOverlay.visible) this.allocateProgress(childBox);
511511
}
512512

513513
showLabel(animate = false) {
@@ -610,7 +610,7 @@ class AppGroup {
610610
return total / count;
611611
}
612612

613-
allocateProgress(childBox = null, flags = 0) {
613+
allocateProgress(childBox = null) {
614614
if (!childBox) childBox = new Clutter.ActorBox();
615615
childBox.y1 = 0;
616616
childBox.y2 = this.actor.height;
@@ -621,7 +621,7 @@ class AppGroup {
621621
childBox.x1 = 0;
622622
childBox.x2 = Math.max(this.actor.width * (this.progress / 100.0), 1.0);
623623
}
624-
this.progressOverlay.allocate(childBox, flags);
624+
this.progressOverlay.allocate(childBox);
625625
}
626626

627627
onProgressChange(metaWindow) {

files/usr/share/cinnamon/applets/window-list@cinnamon.org/applet.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -717,7 +717,7 @@ class AppMenuButton {
717717
}
718718
}
719719

720-
_allocate(actor, box, flags) {
720+
_allocate(actor, box) {
721721
let allocWidth = box.x2 - box.x1;
722722
let allocHeight = box.y2 - box.y1;
723723

@@ -750,7 +750,7 @@ class AppMenuButton {
750750
childBox.x1 = box.x1 + Math.floor(Math.max(0, allocWidth - naturalWidth) / 2);
751751
childBox.x2 = Math.min(childBox.x1 + naturalWidth, box.x2);
752752
}
753-
this._iconBox.allocate(childBox, flags);
753+
this._iconBox.allocate(childBox);
754754

755755
// Set notifications badge position
756756
const notifBadgeOffset = 3 * global.ui_scale;
@@ -766,7 +766,7 @@ class AppMenuButton {
766766
const notifLabelPosY = Math.floor((notifBadgesize - nLabelNaturalHeight) / 2);
767767
this.notificationsBadgeLabel.set_anchor_point(-notifLabelPosX, -notifLabelPosY);
768768
this.notificationsBadge.set_size(notifBadgesize, notifBadgesize);
769-
this.notificationsBadge.allocate(notifBadgeBox, flags);
769+
this.notificationsBadge.allocate(notifBadgeBox);
770770

771771
if (this.drawLabel) {
772772
[minWidth, minHeight, naturalWidth, naturalHeight] = this._label.get_preferred_size();
@@ -783,7 +783,7 @@ class AppMenuButton {
783783
childBox.x1 = box.x1;
784784
}
785785

786-
this._label.allocate(childBox, flags);
786+
this._label.allocate(childBox);
787787
}
788788

789789
if (!this.progressOverlay.visible) {
@@ -795,7 +795,7 @@ class AppMenuButton {
795795
childBox.x2 = this.actor.width;
796796
childBox.y2 = this.actor.height;
797797

798-
this.progressOverlay.allocate(childBox, flags);
798+
this.progressOverlay.allocate(childBox);
799799

800800
let clip_width = Math.max((this.actor.width) * (this._progress / 100.0), 1.0);
801801
this.progressOverlay.set_clip(0, 0, clip_width, this.actor.height);

js/ui/appSwitcher/classicSwitcher.js

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ ClassicSwitcher.prototype = {
9292
alloc.natural_size = global.screen_height;
9393
},
9494

95-
_allocate: function (actor, box, flags) {
95+
_allocate: function (actor, box) {
9696
let childBox = new Clutter.ActorBox();
9797
let monitor = this._activeMonitor;
9898

@@ -110,7 +110,7 @@ ClassicSwitcher.prototype = {
110110
childBox.x2 = Math.min(monitor.x + monitor.width - rightPadding, childBox.x1 + childNaturalWidth);
111111
childBox.y1 = monitor.y + Math.floor((monitor.height - childNaturalHeight) / 2);
112112
childBox.y2 = childBox.y1 + childNaturalHeight;
113-
this._appList.actor.allocate(childBox, flags);
113+
this._appList.actor.allocate(childBox);
114114

115115
// Allocate the thumbnails
116116
// We try to avoid overflowing the screen so we base the resulting size on
@@ -133,7 +133,7 @@ ClassicSwitcher.prototype = {
133133
this._thumbnails.addClones(monitor.y + monitor.height - bottomPadding - childBox.y1);
134134
let [childMinHeight, childNaturalHeight] = this._thumbnails.actor.get_preferred_height(-1);
135135
childBox.y2 = childBox.y1 + childNaturalHeight;
136-
this._thumbnails.actor.allocate(childBox, flags);
136+
this._thumbnails.actor.allocate(childBox);
137137
}
138138
},
139139

@@ -518,7 +518,7 @@ SwitcherList.prototype = {
518518
this._activeMonitor = activeMonitor;
519519
},
520520

521-
_allocateTop: function(actor, box, flags) {
521+
_allocateTop: function(actor, box) {
522522
if (this._list.spacing === -1) {
523523
this._list.spacing = this._list.get_theme_node().get_length('spacing');
524524
}
@@ -529,20 +529,20 @@ SwitcherList.prototype = {
529529
let childBox = new Clutter.ActorBox();
530530
let scrollable = this._minSize > box.x2 - box.x1;
531531

532-
this._clipBin.allocate(box, flags);
532+
this._clipBin.allocate(box);
533533

534534
childBox.x1 = 0;
535535
childBox.y1 = 0;
536536
childBox.x2 = this._leftGradient.width;
537537
childBox.y2 = this.actor.height;
538-
this._leftGradient.allocate(childBox, flags);
538+
this._leftGradient.allocate(childBox);
539539
this._leftGradient.opacity = (this._scrollableLeft && scrollable) ? 255 : 0;
540540

541541
childBox.x1 = (this.actor.allocation.x2 - this.actor.allocation.x1) - this._rightGradient.width;
542542
childBox.y1 = 0;
543543
childBox.x2 = childBox.x1 + this._rightGradient.width;
544544
childBox.y2 = this.actor.height;
545-
this._rightGradient.allocate(childBox, flags);
545+
this._rightGradient.allocate(childBox);
546546
this._rightGradient.opacity = (this._scrollableRight && scrollable) ? 255 : 0;
547547

548548
let arrowWidth = Math.floor(leftPadding / 3);
@@ -551,7 +551,7 @@ SwitcherList.prototype = {
551551
childBox.y1 = this.actor.height / 2 - arrowWidth;
552552
childBox.x2 = childBox.x1 + arrowWidth;
553553
childBox.y2 = childBox.y1 + arrowHeight;
554-
this._leftArrow.allocate(childBox, flags);
554+
this._leftArrow.allocate(childBox);
555555
this._leftArrow.opacity = this._leftGradient.opacity;
556556

557557
arrowWidth = Math.floor(rightPadding / 3);
@@ -560,7 +560,7 @@ SwitcherList.prototype = {
560560
childBox.y1 = this.actor.height / 2 - arrowWidth;
561561
childBox.x2 = childBox.x1 + arrowWidth;
562562
childBox.y2 = childBox.y1 + arrowHeight;
563-
this._rightArrow.allocate(childBox, flags);
563+
this._rightArrow.allocate(childBox);
564564
this._rightArrow.opacity = this._rightGradient.opacity;
565565
},
566566

@@ -699,7 +699,7 @@ SwitcherList.prototype = {
699699
alloc.natural_size = maxChildNat;
700700
},
701701

702-
_allocate: function (actor, box, flags) {
702+
_allocate: function (actor, box) {
703703
let childHeight = box.y2 - box.y1;
704704

705705
let [maxChildMin, maxChildNat] = this._maxChildWidth();
@@ -730,7 +730,7 @@ SwitcherList.prototype = {
730730
childBox.y1 = vSpacing;
731731
childBox.x2 = x + childWidth;
732732
childBox.y2 = childBox.y1 + childNat;
733-
children[i].allocate(childBox, flags);
733+
children[i].allocate(childBox);
734734

735735
x += this._list.spacing + childWidth;
736736
} else {

js/ui/boxpointer.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,13 @@ var BoxPointer = GObject.registerClass({
196196
return themeNode.adjust_preferred_height(...height);
197197
}
198198

199-
vfunc_allocate(box, flags) {
199+
vfunc_allocate(box) {
200200
if (this._sourceActor && this._sourceActor.mapped) {
201201
this._reposition(box);
202202
this._updateFlip(box);
203203
}
204204

205-
this.set_allocation(box, flags);
205+
this.set_allocation(box);
206206

207207
let themeNode = this.get_theme_node();
208208
let borderWidth = themeNode.get_length('-arrow-border-width');
@@ -214,7 +214,7 @@ var BoxPointer = GObject.registerClass({
214214
childBox.y1 = 0;
215215
childBox.x2 = availWidth;
216216
childBox.y2 = availHeight;
217-
this._border.allocate(childBox, flags);
217+
this._border.allocate(childBox);
218218

219219
childBox.x1 = borderWidth;
220220
childBox.y1 = borderWidth;
@@ -234,7 +234,7 @@ var BoxPointer = GObject.registerClass({
234234
childBox.x2 -= rise;
235235
break;
236236
}
237-
this.bin.allocate(childBox, flags);
237+
this.bin.allocate(childBox);
238238
}
239239

240240
_drawBorder(area) {

js/ui/checkBox.js

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,38 @@ const Pango = imports.gi.Pango;
44
const St = imports.gi.St;
55

66
var CheckBox = GObject.registerClass(
7-
class CheckBox extends St.Button {
8-
_init(label) {
9-
let container = new St.BoxLayout();
10-
super._init({
11-
style_class: 'check-box',
12-
important: true,
13-
child: container,
14-
button_mask: St.ButtonMask.ONE,
15-
toggle_mode: true,
16-
can_focus: true,
17-
x_fill: true,
18-
y_fill: true,
19-
});
7+
class CheckBox extends St.Button {
8+
_init(label) {
9+
let container = new St.BoxLayout();
10+
super._init({
11+
style_class: 'check-box',
12+
important: true,
13+
child: container,
14+
button_mask: St.ButtonMask.ONE,
15+
toggle_mode: true,
16+
can_focus: true,
17+
x_fill: true,
18+
y_fill: true,
19+
});
2020

21-
this._box = new St.Bin();
22-
this._box.set_y_align(Clutter.ActorAlign.START);
23-
container.add_actor(this._box);
21+
this._box = new St.Bin();
22+
this._box.set_y_align(Clutter.ActorAlign.START);
23+
container.add_actor(this._box);
2424

25-
this._label = new St.Label({ y_align: Clutter.ActorAlign.CENTER });
26-
this._label.clutter_text.set_line_wrap(true);
27-
this._label.clutter_text.set_ellipsize(Pango.EllipsizeMode.NONE);
28-
container.add_actor(this._label);
25+
this._label = new St.Label({ y_align: Clutter.ActorAlign.CENTER });
26+
this._label.clutter_text.set_line_wrap(true);
27+
this._label.clutter_text.set_ellipsize(Pango.EllipsizeMode.NONE);
28+
container.add_actor(this._label);
2929

30-
if (label)
31-
this.setLabel(label);
32-
}
30+
if (label)
31+
this.setLabel(label);
32+
}
3333

34-
setLabel(label) {
35-
this._label.set_text(label);
36-
}
34+
setLabel(label) {
35+
this._label.set_text(label);
36+
}
3737

38-
getLabelActor() {
39-
return this._label;
40-
}
41-
});
38+
getLabelActor() {
39+
return this._label;
40+
}
41+
});

js/ui/dnd.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ GenericDragItemContainer.prototype = {
721721
this.animatingOut = false;
722722
},
723723

724-
_allocate: function(actor, box, flags) {
724+
_allocate: function(actor, box) {
725725
if (this.child == null)
726726
return;
727727

@@ -740,7 +740,7 @@ GenericDragItemContainer.prototype = {
740740
childBox.x2 = childBox.x1 + childWidth;
741741
childBox.y2 = childBox.y1 + childHeight;
742742

743-
this.child.allocate(childBox, flags);
743+
this.child.allocate(childBox);
744744
},
745745

746746
_getPreferredHeight: function(actor, forWidth, alloc) {

0 commit comments

Comments
 (0)