Photo¶
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 photodrag,start
- One has started dragging the inner image out of the photo’s framedrag,end
- One has dropped the dragged image somewhere
Inheritance diagram¶
- class efl.elementary.Photo(Object parent, *args, **kwargs)¶
Bases:
efl.elementary.__init__.Object
This is the class that actually implements the widget.
- 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¶
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
Changed in version 1.18: This property is now also readable
- editable_get()¶
- editable_set(editable)¶
- 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¶
If the photo should be completely visible or not.
- Type
bool
Changed in version 1.18: This property is now also readable
- fill_inside_set()¶
- size¶
The size that will be used on the photo.
- Type
int
Changed in version 1.18: This property is now also readable
- size_get()¶
- 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)¶