[gnome-maps/wip/osm-edit: 9/10] osmEdit: Move edit button to PlaceBubble and adjust more to the mockup
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/osm-edit: 9/10] osmEdit: Move edit button to PlaceBubble and adjust more to the mockup
- Date: Sat, 5 Dec 2015 12:08:14 +0000 (UTC)
commit 2410f502cde45e8d8aca5d38ca075431de252000
Author: Marcus Lundblad <ml update uu se>
Date: Wed Dec 2 21:53:06 2015 +0100
osmEdit: Move edit button to PlaceBubble and adjust more to the mockup
data/ui/map-bubble.ui | 11 ---------
data/ui/place-bubble.ui | 56 ++++++++++++++++++++++++++++++++++++----------
src/mapBubble.js | 7 +----
src/placeBubble.js | 11 ++++++---
4 files changed, 53 insertions(+), 32 deletions(-)
---
diff --git a/data/ui/map-bubble.ui b/data/ui/map-bubble.ui
index 1a79b9c..18a0c66 100644
--- a/data/ui/map-bubble.ui
+++ b/data/ui/map-bubble.ui
@@ -108,17 +108,6 @@
<property name="tooltip-text" translatable="yes">Check in here</property>
</object>
</child>
- <child>
- <object class="GtkButton" id="bubble-edit-button">
- <property name="name">bubble-edit-button"</property>
- <property name="label" translatable="yes">Edit</property>
- <!-- TODO: this button should be invisible by default
- when we handle OSM accounts -->
- <property name="visible">False</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- </object>
- </child>
</object>
<packing>
<property name="left_attach">0</property>
diff --git a/data/ui/place-bubble.ui b/data/ui/place-bubble.ui
index c6f2b6a..5c2f97d 100644
--- a/data/ui/place-bubble.ui
+++ b/data/ui/place-bubble.ui
@@ -11,29 +11,61 @@
</object>
</child>
<child>
- <object class="GtkBox" id="box-content">
+ <object class="GtkGrid" id="grid-content">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <style>
- <class name="bubble-content"/>
- </style>
+ <property name="column-spacing">5</property>
<child>
- <object class="GtkLabel" id="label-title">
+ <object class="GtkBox" id="box-content">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="vexpand">True</property>
+ <property name="orientation">vertical</property>
<style>
- <class name="bubble-title"/>
+ <class name="bubble-content"/>
</style>
+ <child>
+ <object class="GtkLabel" id="label-title">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">start</property>
+ <property name="vexpand">True</property>
+ <style>
+ <class name="bubble-title"/>
+ </style>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
</object>
<packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">0</property>
+ <property name="left_attach">0</property>
+ <property name="top_attach">0</property>
</packing>
</child>
+ <child>
+ <object class="GtkButton" id="edit-button">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="valign">GTK_ALIGN_START</property>
+ <property name="halign">GTK_ALIGN_CENTER</property>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="icon-name">edit-symbolic</property>
+ <property name="pixel_size">16</property>
+ </object>
+ </child>
+ <style>
+ <class name="image-button"/>
+ <class name="circular"/>
+ <class name="flat"/>
+ </style>
+ </object>
+ </child>
</object>
</child>
</object>
diff --git a/src/mapBubble.js b/src/mapBubble.js
index 2803eb6..3a8ebb7 100644
--- a/src/mapBubble.js
+++ b/src/mapBubble.js
@@ -37,8 +37,7 @@ const Button = {
ROUTE: 2,
SEND_TO: 4,
FAVORITE: 8,
- CHECK_IN: 16,
- EDIT: 32
+ CHECK_IN: 16
};
const MapBubble = new Lang.Class({
@@ -77,11 +76,9 @@ const MapBubble = new Lang.Class({
'bubble-send-to-button',
'bubble-favorite-button',
'bubble-check-in-button',
- 'bubble-favorite-button-image',
- 'bubble-edit-button']);
+ 'bubble-favorite-button-image']);
this._image = ui.bubbleImage;
this._content = ui.bubbleContentArea;
- this._editButton = ui.bubbleEditButton;
if (!buttonFlags)
ui.bubbleButtonArea.visible = false;
diff --git a/src/placeBubble.js b/src/placeBubble.js
index ab4d4df..eb53bb9 100644
--- a/src/placeBubble.js
+++ b/src/placeBubble.js
@@ -41,10 +41,11 @@ const PlaceBubble = new Lang.Class({
_init: function(params) {
let ui = Utils.getUIObject('place-bubble', [ 'stack',
'box-content',
- 'label-title']);
+ 'grid-content',
+ 'label-title',
+ 'edit-button']);
params.buttons = (MapBubble.Button.ROUTE |
- MapBubble.Button.SEND_TO |
- MapBubble.Button.EDIT);
+ MapBubble.Button.SEND_TO);
if (params.place.store)
params.buttons |= MapBubble.Button.FAVORITE;
@@ -58,6 +59,8 @@ const PlaceBubble = new Lang.Class({
this._stack = ui.stack;
this._title = ui.labelTitle;
this._boxContent = ui.boxContent;
+ this._gridContent = ui.gridContent;
+ this._editButton = ui.editButton;
let overpass = new Overpass.Overpass();
if (Application.placeStore.exists(this.place, null)) {
@@ -138,7 +141,7 @@ const PlaceBubble = new Lang.Class({
this._boxContent.pack_start(label, false, true, 0);
}).bind(this));
- this._stack.visible_child = this._boxContent;
+ this._stack.visible_child = this._gridContent;
},
// clear the view widgets to be able to re-populate an updated place
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]