Photo

../_images/photo-preview.png

Widget description

An Elementary photo widget is intended for displaying a photo, for ex., a person’s image (contact).

Simple, yet with a very specific purpose. It has a decorative frame around the inner image itself, on the default theme.

This widget relies on an internal Icon, so that the APIs of these two widgets are similar (drag and drop is also possible here, for example).

Emitted signals

  • clicked - This is called when a user has clicked the photo
  • drag,start - One has started dragging the inner image out of the photo’s frame
  • drag,end - One has dropped the dragged image somewhere

Inheritance diagram

Inheritance diagram of Photo

class efl.elementary.Photo(Object parent, *args, **kwargs)

Bases: efl.elementary.__init__.Object

Parameters:
  • parent (efl.evas.Object) – The parent object
  • **kwargs – All the remaining keyword arguments are interpreted as properties of the instance
aspect_fixed

Whether the original aspect ratio of the photo should be kept on resize.

The original aspect ratio (width / height) of the photo is usually distorted to match the object’s size. Enabling this option will fix this original aspect, and the way that the photo is fit into the object’s area

Type:bool
aspect_fixed_get()
aspect_fixed_set(fixed)
callback_clicked_add(func, *args, **kwargs)

This is called when a user has clicked the photo.

callback_clicked_del(func)
callback_drag_end_add(func, *args, **kwargs)

One has dropped the dragged image somewhere.

callback_drag_end_del(func)
callback_drag_start_add(func, *args, **kwargs)

One has started dragging the inner image out of the photo’s frame.

callback_drag_start_del(func)
editable

Set editability of the photo.

An editable photo can be dragged to or from, and can be cut or pasted too. Note that pasting an image or dropping an item on the image will delete the existing content.

Type:bool
editable_set(fill)
file

Set the file that will be used as photo

Type:string
Raises RuntimeError:
 when setting the file fails

Changed in version 1.8: Raises RuntimeError if setting the file fails

file_set(filename)
fill_inside

Set if the photo should be completely visible or not.

Type:bool
fill_inside_set(fill)
size

Set the size that will be used on the photo.

Type:int
size_set(size)
thumb

Set the file that will be used as thumbnail in the photo.

Type:string or tuple of strings
thumb_set(filename, group=None)