[gnome-maps/wip/mattiasb/dont_forin_traverse_arrays] fixup! PlaceBubble: Refactor content population
- From: Mattias Bengtsson <mattiasb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mattiasb/dont_forin_traverse_arrays] fixup! PlaceBubble: Refactor content population
- Date: Fri, 17 Feb 2017 22:55:14 +0000 (UTC)
commit 2c83b3d27d2999881c705bfee5379ea929f1ca4e
Author: Mattias Bengtsson <mattias jc bengtsson gmail com>
Date: Fri Feb 17 23:07:58 2017 +0100
fixup! PlaceBubble: Refactor content population
Make the attach-code easier to read.
Run `git rebase -i --autosquash HEAD~3` before pushing.
https://bugzilla.gnome.org/show_bug.cgi?id=778800
src/placeBubble.js | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/placeBubble.js b/src/placeBubble.js
index 6ff9a9a..5a1449b 100644
--- a/src/placeBubble.js
+++ b/src/placeBubble.js
@@ -179,7 +179,6 @@ const PlaceBubble = new Lang.Class({
expandedContent.forEach((function({ label, linkUrl, linkText, info },
row) {
- let col = 0;
let widget;
if (label) {
@@ -188,7 +187,7 @@ const PlaceBubble = new Lang.Class({
use_markup: true,
yalign: 0,
halign: Gtk.Align.START });
- this._expandedContent.attach(widget, col++, row, 1, 1);
+ this._expandedContent.attach(widget, 0, row, 1, 1);
}
if (linkUrl) {
@@ -207,7 +206,11 @@ const PlaceBubble = new Lang.Class({
wrap: true,
halign: Gtk.Align.START });
- this._expandedContent.attach(widget, col, row, col == 0 ? 2 : 1, 1);
+ if(label)
+ this._expandedContent.attach(widget, 1, row, 1, 1);
+ else
+ // Expand over both columns if this row has no label
+ this._expandedContent.attach(widget, 0, row, 2, 1);
}).bind(this));
},
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]