Commit af23463e authored by Dicson's avatar Dicson
Browse files

SetLocationPlugin. fixed size avatars in marker on map(32 pixels)

parent fc796b97
...@@ -163,9 +163,12 @@ class SetLocationPluginConfigDialog(GajimPluginConfigDialog): ...@@ -163,9 +163,12 @@ class SetLocationPluginConfigDialog(GajimPluginConfigDialog):
vbox.pack_start(label, expand=False, fill=False, padding=6) vbox.pack_start(label, expand=False, fill=False, padding=6)
self.is_active = True self.is_active = True
self.layer = Champlain.MarkerLayer() self.layer = Champlain.MarkerLayer()
self.marker = Champlain.Label.new_from_file(self.path_to_image) texture = Clutter.Texture()
self.marker.set_text("I am") texture.set_from_file(self.path_to_image)
texture.set_size(32,32)
self.marker = Champlain.Label.new_with_image(texture)
self.marker.set_location(self.lat, self.lon) self.marker.set_location(self.lat, self.lon)
self.marker.set_text("I am")
self.view.add_layer(self.layer) self.view.add_layer(self.layer)
self.layer.add_marker(self.marker) self.layer.add_marker(self.marker)
self.markers_is_visible = False self.markers_is_visible = False
...@@ -229,7 +232,7 @@ class SetLocationPluginConfigDialog(GajimPluginConfigDialog): ...@@ -229,7 +232,7 @@ class SetLocationPluginConfigDialog(GajimPluginConfigDialog):
self.marker.set_location(self.lat, self.lon) self.marker.set_location(self.lat, self.lon)
def show_contacts(self): def show_contacts(self):
from gi.repository import Champlain from gi.repository import Champlain, Clutter
data = {} data = {}
accounts = gajim.contacts._accounts accounts = gajim.contacts._accounts
for account in accounts: for account in accounts:
...@@ -251,7 +254,10 @@ class SetLocationPluginConfigDialog(GajimPluginConfigDialog): ...@@ -251,7 +254,10 @@ class SetLocationPluginConfigDialog(GajimPluginConfigDialog):
for jid in data: for jid in data:
path = self.get_path_to_generic_or_avatar(self.path_to_image, path = self.get_path_to_generic_or_avatar(self.path_to_image,
jid=jid, suffix='') jid=jid, suffix='')
marker = Champlain.Label.new_from_file(path) texture = Clutter.Texture()
texture.set_from_file(path)
texture.set_size(32,32)
marker = Champlain.Label.new_with_image(texture)
marker.set_text(data[jid][2]) marker.set_text(data[jid][2])
marker.set_location(float(data[jid][0]), float(data[jid][1])) marker.set_location(float(data[jid][0]), float(data[jid][1]))
self.contacts_layer.add_marker(marker) self.contacts_layer.add_marker(marker)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment