JBrowser Source Docs
You are reading the documentation for JBrowser 1.5.3. The newest release is 1.5.4. Go to the latest documentation

jbrowser.ui.gallery

Generated from the source code of JBrowser 1.5.3.

jbrowser/ui/gallery.py · 1,170 lines

The Gallery (Ctrl+Shift+G, or the Gallery button on the ribbon): every card of a space, or of all spaces, as a grid of live thumbnails.

  • Cards pop in one after another; hovering lifts a card; opening one zooms into it as the Gallery fades away and the canvas behind scrolls to that card.
  • "This space / All spaces" switches the scope (remembered in gallery.all_spaces); with all spaces, every space gets its own colour-coded section.
  • Type to filter by title or address. Drag a card to reorder it, or onto another space to move it.
  • Keyboard: arrow keys move between cards, Enter opens, Delete closes the card, the Menu key opens the card menu, Esc (or the Gallery button) goes back. Everything respects "Fluid animations".

Thumbnails come from the card itself when it is on screen, otherwise from the snapshot JBrowser keeps of cards that went out of sight or to sleep, otherwise a coloured placeholder with the site's icon.

Constants#

Name Value
MARGIN 28
GAP 18
MIN_TILE_W 210
MAX_TILE_W 330
THUMB_RATIO 0.62
FOOTER_H 48
SECTION_H 46
RADIUS 12
STAGGER_MS 26
POP_MS 420
DRAG_START 8

Item#

class Itemsource

Attributes

Name Value
tab Tab | None
space Space
rect QRectF = field(default_factory=QRectF)
order int = 0

Item.key#

property keysource

Section#

class Sectionsource

Attributes

Name Value
space Space
header QRectF = field(default_factory=QRectF)
area QRectF = field(default_factory=QRectF)
items list[Item] = field(default_factory=list)

ScopeToggle#

class ScopeToggle(QAbstractButton)source
ScopeToggle(parent: QWidget)

Two-segment switch: "This space" | "All spaces", with a sliding highlight.

ScopeToggle.set_checked_quiet#

set_checked_quiet(on: bool) -> Nonesource

Qt overrides: mousePressEvent, mouseReleaseEvent, keyPressEvent, paintEvent

GalleryGrid#

class GalleryGrid(QWidget)source
GalleryGrid(gallery: 'Gallery')

Custom-painted grid of card tiles (inside the Gallery's scroll area).

Signals

Signal Arguments
opened (str)
newCard (str)
spaceChosen (str)

GalleryGrid.set_content#

set_content(sections: list[Section], show_headers: bool, empty_text: str) -> Nonesource

GalleryGrid.relayout#

relayout() -> Nonesource

GalleryGrid.pop_in_duration#

pop_in_duration() -> intsource

Qt overrides: mouseMoveEvent, leaveEvent, mousePressEvent, mouseReleaseEvent, keyPressEvent, focusInEvent, focusOutEvent, paintEvent

class Gallery(QWidget)source
Gallery(ctx: 'AppContext', ui: 'BrowserController', host: QWidget)

The overlay that holds the header and the scrolling grid (child of the SpaceStack).

Signals

Signal Arguments
visibilityChanged (bool)

Gallery.toggle#

toggle(all_spaces: bool | None=None) -> Nonesource
open_gallery(all_spaces: bool | None=None) -> Nonesource
close_gallery(chosen: str | None=None) -> Nonesource

Gallery.rebuild#

rebuild() -> Nonesource

Gallery.thumbnail#

thumbnail(tab: Tab) -> QPixmap | Nonesource

Gallery.capture_visible#

capture_visible() -> Nonesource

Fresh pictures of the cards that are on screen right now (others use their snapshots).

Gallery.ensure_visible#

ensure_visible(rect: QRectF) -> Nonesource

Gallery.autoscroll#

autoscroll(grid_pos: QPoint) -> Nonesource

Gallery.start_typing#

start_typing(text: str) -> Nonesource

Qt overrides: eventFilter, resizeEvent, keyPressEvent, mousePressEvent, paintEvent