[gnome-maps/wip/mlundblad/remove-contacts: 1/7] placeListRow: Remove handling contacts
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/remove-contacts: 1/7] placeListRow: Remove handling contacts
- Date: Wed, 22 Jun 2022 20:53:44 +0000 (UTC)
commit f562ccad3ddb3edbb0eb8e7da2974982733df2de
Author: Marcus Lundblad <ml dfupdate se>
Date: Wed Jun 22 22:23:13 2022 +0200
placeListRow: Remove handling contacts
data/ui/place-list-row.ui | 20 ++------------------
src/placeListRow.js | 21 +--------------------
2 files changed, 3 insertions(+), 38 deletions(-)
---
diff --git a/data/ui/place-list-row.ui b/data/ui/place-list-row.ui
index 9164f52c..dc476583 100644
--- a/data/ui/place-list-row.ui
+++ b/data/ui/place-list-row.ui
@@ -12,27 +12,11 @@
<property name="row-homogeneous">True</property>
<property name="margin">5</property>
<child>
- <object class="GtkStack" id="iconStack">
+ <object class="GtkImage" id="icon">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="halign">start</property>
- <property name="valign">center</property>
+ <property name="pixel_size">32</property>
<property name="margin_end">12</property>
- <child>
- <object class="GtkImage" id="icon">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="pixel_size">32</property>
- </object>
- </child>
- <child>
- <object class="HdyAvatar" id="contactAvatar">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="show_initials">True</property>
- <property name="size">32</property>
- </object>
- </child>
</object>
<packing>
<property name="left_attach">0</property>
diff --git a/src/placeListRow.js b/src/placeListRow.js
index 2cd42659..8bbcd345 100644
--- a/src/placeListRow.js
+++ b/src/placeListRow.js
@@ -21,7 +21,6 @@ import GLib from 'gi://GLib';
import GObject from 'gi://GObject';
import Gtk from 'gi://Gtk';
-import {ContactPlace} from './contactPlace.js';
import {PlaceFormatter} from './placeFormatter.js';
import {PlaceStore} from './placeStore.js';
import * as Utils from './utils.js';
@@ -54,30 +53,14 @@ export class PlaceListRow extends Gtk.ListBoxRow {
this._name.label = this._boldMatch(markup, searchString);
this._details.label = GLib.markup_escape_text(formatter.getDetailsString(),-1);
- if (place instanceof ContactPlace) {
- this._iconStack.set_visible_child(this._contactAvatar);
-
- this._contactAvatar.text = formatter.title;
-
- if (place.icon) {
- Utils.load_icon(place.icon, 32, (pixbuf) => {
- this._contactAvatar.set_image_load_func((size) => Utils.loadAvatar(pixbuf, size));
- });
- } else {
- this._contactAvatar.set_image_load_func(null);
- }
- } else if (place.icon) {
- this._iconStack.set_visible_child(this._icon);
+ if (place.icon)
this._icon.gicon = place.icon;
- }
if (type === PlaceStore.PlaceType.RECENT ||
type === PlaceStore.PlaceType.RECENT_ROUTE)
this._typeIcon.icon_name = 'document-open-recent-symbolic';
else if (type === PlaceStore.PlaceType.FAVORITE)
this._typeIcon.icon_name = 'starred-symbolic';
- else if (type === PlaceStore.PlaceType.CONTACT)
- this._typeIcon.icon_name = 'avatar-default-symbolic';
else
this._typeIcon.icon_name = null;
}
@@ -99,8 +82,6 @@ export class PlaceListRow extends Gtk.ListBoxRow {
GObject.registerClass({
Template: 'resource:///org/gnome/Maps/ui/place-list-row.ui',
InternalChildren: [ 'icon',
- 'iconStack',
- 'contactAvatar',
'name',
'details',
'typeIcon' ],
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]