Table Of Contents

Previous topic

panes Module

Next topic

photocam Module

photo Module

../_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).

Signals that you can add callbacks for are:

  • "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

class efl.elementary.photo.Photo

Bases: efl.elementary.object.Object

This is the class that actually implements the widget.

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
callback_clicked_add()

This is called when a user has clicked the photo.

callback_drag_end_add()

One has dropped the dragged image somewhere.

callback_drag_start_add()

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

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
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

fill_inside

Set if the photo should be completely visible or not.

Type :bool
size

Set the size that will be used on the photo.

Type :int
thumb

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

Type :string or tuple of strings