diff --git a/data/glade/profile_window.glade b/data/glade/profile_window.glade
index 0afea9527..b9c4394ab 100644
--- a/data/glade/profile_window.glade
+++ b/data/glade/profile_window.glade
@@ -16,6 +16,7 @@
GDK_WINDOW_TYPE_HINT_NORMAL
GDK_GRAVITY_NORTH_WEST
True
+ False
@@ -989,41 +990,6 @@
-
-
- True
- GTK_RELIEF_NORMAL
- True
-
-
-
-
- True
- False
- False
-
-
-
- True
- 0.5
- 0
- 0
- 0
-
-
-
-
-
-
- 1
- 4
- 6
- 7
-
- expand
-
-
-
True
@@ -1051,6 +1017,71 @@
+
+
+
+ True
+ False
+ 0
+
+
+
+ True
+ GTK_RELIEF_NORMAL
+ True
+
+
+
+
+ True
+ False
+ False
+
+
+
+ True
+ 0.5
+ 0
+ 0
+ 0
+
+
+
+
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ True
+ True
+ Click to set your avatar
+ True
+ GTK_RELIEF_NORMAL
+ True
+
+
+
+ 0
+ False
+ False
+
+
+
+
+ 1
+ 4
+ 6
+ 7
+
+ expand
+
+
False
diff --git a/src/profile_window.py b/src/profile_window.py
index 91f22afc4..3b9ff5e80 100644
--- a/src/profile_window.py
+++ b/src/profile_window.py
@@ -77,6 +77,10 @@ class ProfileWindow:
# Create Image for avatar button
image = gtk.Image()
self.xml.get_widget('PHOTO_button').set_image(image)
+ text_button = self.xml.get_widget('NOPHOTO_button')
+ # We use 2 buttons because some GTK theme don't show images in buttons
+ text_button.set_no_show_all(True)
+ text_button.hide()
self.xml.signal_autoconnect(self)
self.window.show_all()
@@ -104,7 +108,9 @@ class ProfileWindow:
button = self.xml.get_widget('PHOTO_button')
image = button.get_image()
image.set_from_pixbuf(None)
- button.set_label(_('Click to set your avatar'))
+ button.hide()
+ text_button = self.xml.get_widget('NOPHOTO_button')
+ text_button.show()
self.avatar_encoded = None
self.avatar_mime_type = None
@@ -152,7 +158,9 @@ class ProfileWindow:
button = self.xml.get_widget('PHOTO_button')
image = button.get_image()
image.set_from_pixbuf(pixbuf)
- button.set_label('')
+ button.show()
+ text_button = self.xml.get_widget('NOPHOTO_button')
+ text_button.hide()
self.avatar_encoded = base64.encodestring(data)
# returns None if unknown type
self.avatar_mime_type = mimetypes.guess_type(path_to_file)[0]
@@ -202,25 +210,27 @@ class ProfileWindow:
pass
def set_values(self, vcard):
+ button = self.xml.get_widget('PHOTO_button')
+ image = button.get_image()
+ text_button = self.xml.get_widget('NOPHOTO_button')
if not 'PHOTO' in vcard:
# set default image
- button = self.xml.get_widget('PHOTO_button')
- image = button.get_image()
image.set_from_pixbuf(None)
- button.set_label(_('Click to set your avatar'))
+ button.hide()
+ text_button.show()
for i in vcard.keys():
if i == 'PHOTO':
pixbuf, self.avatar_encoded, self.avatar_mime_type = \
get_avatar_pixbuf_encoded_mime(vcard[i])
- button = self.xml.get_widget('PHOTO_button')
- image = button.get_image()
if not pixbuf:
image.set_from_pixbuf(None)
- button.set_label(_('Click to set your avatar'))
+ button.hide()
+ text_button.show()
continue
pixbuf = gtkgui_helpers.get_scaled_pixbuf(pixbuf, 'vcard')
image.set_from_pixbuf(pixbuf)
- button.set_label('')
+ button.show()
+ text_button.hide()
continue
if i == 'ADR' or i == 'TEL' or i == 'EMAIL':
for entry in vcard[i]: