naturtag.widgets.images module#

Generic image widgets and base classes for other page-specific widgets. Includes plain images, cards, scrollable lists, and fullscreen image views.

class naturtag.widgets.images.FAIcon(icon_str, parent=None, secondary=False, size=32)#

Bases: QLabel

set_enabled(enabled=True)#
staticMetaObject = PySide6.QtCore.QMetaObject("FAIcon" inherits "QLabel": )#
class naturtag.widgets.images.FullscreenPhoto(*args, **kwargs)#

Bases: NavButtonsMixin, PixmapLabel

staticMetaObject = PySide6.QtCore.QMetaObject("FullscreenPhoto" inherits "PixmapLabel": )#
class naturtag.widgets.images.HoverIcon(*args, **kwargs)#

Bases: FAIcon

mousePressEvent(_)#

Placeholder to accept mouse press events

mouseReleaseEvent(self, ev: PySide6.QtGui.QMouseEvent) None#
on_click#
staticMetaObject = PySide6.QtCore.QMetaObject("HoverIcon" inherits "FAIcon": Methods:   #47 type=Signal, signature=on_click(PyObject), parameters=PyObject )#
class naturtag.widgets.images.HoverMixin(*args, hover_icon=False, hover_event=True, **kwargs)#

Bases: object

Mixin that adds a transparent overlay to darken the image on hover (handled in QSS)

Parameters:
  • hover_icon (bool) – Add an ‘open’ icon on hover

  • hover_event (bool) – Set to False to disable overlay on hover (e.g., to use parent widget hover event instead)

enterEvent(event)#
leaveEvent(event)#
resizeEvent(event)#
class naturtag.widgets.images.HoverPhoto(*args, hover_icon=False, hover_event=True, **kwargs)#

Bases: HoverMixin, PixmapLabel

staticMetaObject = PySide6.QtCore.QMetaObject("HoverPhoto" inherits "PixmapLabel": )#
class naturtag.widgets.images.IconLabel(icon_str, text, size=32, parent=None, **kwargs)#

Bases: QWidget

staticMetaObject = PySide6.QtCore.QMetaObject("IconLabel" inherits "QWidget": )#
class naturtag.widgets.images.IconLabelList(parent=None)#

Bases: QWidget

add_line(icon_str, text, size=22, **kwargs)#
clear()#
staticMetaObject = PySide6.QtCore.QMetaObject("IconLabelList" inherits "QWidget": )#
class naturtag.widgets.images.ImageWindow#

Bases: StylableWidget

display_image_fullscreen(selected_path, image_paths)#

Open window to a selected image, and save other available image paths for navigation

property idx: int#

The index of the currently selected image

on_remove#

Request for image to be removed from list

remove_image()#

Remove the current image from the list

select_image_idx(idx)#

Select an image by index

select_next_image()#
select_prev_image()#
set_pixmap_path(path)#
staticMetaObject = PySide6.QtCore.QMetaObject("ImageWindow" inherits "StylableWidget": Methods:   #34 type=Signal, signature=on_remove(PyObject), parameters=PyObject )#
wrap_idx(increment)#

Increment and wrap the index around to the other side of the list

class naturtag.widgets.images.InfoCard(card_id=None)#

Bases: StylableWidget

add_row(item)#

Add a layout or widget as a row of info to the card

enterEvent(event)#

Note on hover effect: * Thumbnail: this method triggers overlay * Card background: Handled in QSS

leaveEvent(self, event: PySide6.QtCore.QEvent) None#
mousePressEvent(_)#

Placeholder to accept mouse press events

mouseReleaseEvent(self, event: PySide6.QtGui.QMouseEvent) None#
on_click#
staticMetaObject = PySide6.QtCore.QMetaObject("InfoCard" inherits "StylableWidget": Methods:   #34 type=Signal, signature=on_click(int), parameters=int )#
class naturtag.widgets.images.InfoCardList(threadpool, parent=None)#

Bases: StylableWidget

add_card(card, thumbnail_url, idx=None)#

Add a card immediately, and load its thumbnail from a separate thread

property cards: Iterator[InfoCard]#
clear()#
contains(card_id)#
Return type:

bool

get_card_by_id(card_id)#
Return type:

Optional[InfoCard]

move_card(card_id, idx=0)#

Move a card to the specified position, if found; return False otherwise

Return type:

bool

staticMetaObject = PySide6.QtCore.QMetaObject("InfoCardList" inherits "StylableWidget": )#
class naturtag.widgets.images.NavButtonsMixin(*args, **kwargs)#

Bases: object

Mixin for fullscreen images that adds left and right navigation buttons

resizeEvent(event)#

Position nav buttons on left/right center

class naturtag.widgets.images.PixmapLabel(parent=None, pixmap=None, path=None, url=None, description=None, resample=True, rounded=False, scale=True, idx=0)#

Bases: QLabel

clear(self) None#
get_pixmap(*args, **kwargs)#

Fetch a pixmap from either a local path or remote URL. This does not render the image, so it is safe to run from any thread.

Return type:

QPixmap

heightForWidth(width)#
Return type:

int

mousePressEvent(_)#

Placeholder to accept mouse press events

mouseReleaseEvent(self, ev: PySide6.QtGui.QMouseEvent) None#
on_click#
paintEvent(event)#

Optionally draw rounded corners and/or image description text

resizeEvent(self, event: PySide6.QtGui.QResizeEvent) None#
scaledPixmap()#
Return type:

QPixmap

setPixmap(pixmap)#
set_pixmap_async(threadpool, priority=Priority.NormalPriority, path=None, photo=None, size='medium', url=None)#

Fetch a photo from a separate thread, and render it in the main thread when complete

sizeHint()#
Return type:

QSize

staticMetaObject = PySide6.QtCore.QMetaObject("PixmapLabel" inherits "QLabel": Methods:   #47 type=Signal, signature=on_click(QLabel*), parameters=QLabel* )#
naturtag.widgets.images.format_int(value)#
Return type:

str