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

jbrowser.ui.sidebar

Generated from the source code of JBrowser 1.5.1.

jbrowser/ui/sidebar.py · 1,042 lines

Vertical sidebar: favourites, spaces, the active space's cards and tools.

The sidebar can be hidden completely (Ctrl+B, its hide button, or right-click → Hide sidebar). While hidden, pointing at the left edge of the window slides it in over the canvas (a "peek"); it tucks itself away again when the pointer leaves.

Constants#

Name Value
EXPANDED_W 256
PEEK_EDGE 10

SpaceRow#

class SpaceRow(QWidget)source
SpaceRow(space: Space, sidebar: 'Sidebar')

Signals

Signal Arguments
clicked (str)
menuRequested (str, QPoint)

Qt overrides: enterEvent, leaveEvent, mousePressEvent, mouseDoubleClickEvent, paintEvent

FavouriteTile#

class FavouriteTile(QAbstractButton)source
FavouriteTile(fav: 'Favourite', grid: 'FavouritesGrid')

Attributes

Name Value
TILE_H 42

Qt overrides: enterEvent, leaveEvent, mousePressEvent, mouseMoveEvent, mouseReleaseEvent, contextMenuEvent, paintEvent

FavouritesGrid#

class FavouritesGrid(QWidget)source
FavouritesGrid(sidebar: 'Sidebar')

Attributes

Name Value
COLS 4
GAP 6

FavouritesGrid.rebuild#

rebuild() -> Nonesource

FavouritesGrid.refresh#

refresh() -> Nonesource

FavouritesGrid.drag_to#

drag_to(tile: FavouriteTile, pos: QPoint) -> Nonesource

FavouritesGrid.end_drag#

end_drag() -> Nonesource

Qt overrides: resizeEvent

TabListModel#

class TabListModel(QAbstractListModel)source
TabListModel(ctx: 'AppContext', parent=None)

The active space's cards, pinned first, followed by a "New card" row.

TabListModel.set_space#

set_space(space: Space | None) -> Nonesource

TabListModel.rowCount#

rowCount(parent=QModelIndex()) -> intsource
is_footer(row: int) -> boolsource

TabListModel.data#

data(index: QModelIndex, role: int=Qt.ItemDataRole.DisplayRole)source

TabListModel.refresh_tab#

refresh_tab(tab_id: str) -> Nonesource

TabDelegate#

class TabDelegate(QStyledItemDelegate)source
TabDelegate(view: 'TabListView')

Attributes

Name Value
ROW_H 34
DIVIDER 9

TabDelegate.close_rect#

close_rect(row_rect: QRect) -> QRectsource

Qt overrides: sizeHint, paint

TabListView#

class TabListView(QListView)source
TabListView(sidebar: 'Sidebar')

The current space's cards. Drag a card to reorder it, or onto a space above to move it there.

Attributes

Name Value
DRAG_START 6

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

SpaceSection#

class SpaceSection(QWidget)source
SpaceSection(sidebar: 'Sidebar')

Focusable container for the space rows: Up / Down switches spaces.

Qt overrides: keyPressEvent, paintEvent, focusInEvent, focusOutEvent

LogoButton#

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

The JBrowser mark doubles as the Settings button.

Qt overrides: enterEvent, leaveEvent, paintEvent

ClockLabel#

class ClockLabel(QLabel)source
ClockLabel(parent: QWidget)

12-hour clock in the middle of the sidebar header; re-aligns itself to every minute boundary.

SidebarHeader#

class SidebarHeader(QWidget)source
SidebarHeader(sidebar: 'Sidebar')

Logo (Settings) on the left, hide button on the right, and the clock centred between them.

Qt overrides: resizeEvent

class Sidebar(QWidget)source
Sidebar(ctx: 'AppContext', ui: 'BrowserController', parent: QWidget)

Sidebar.rebuild#

rebuild() -> Nonesource

Sidebar.drop_target_at#

drop_target_at(global_pos: QPoint, exclude: str='') -> str | Nonesource

The space whose row is under global_pos (a card being dragged there would move to it), highlighting that row. None, and no highlight, anywhere else.

Sidebar.clear_drop_target#

clear_drop_target() -> Nonesource

Sidebar.focus_spaces#

focus_spaces() -> Nonesource

Sidebar.set_collapsed#

set_collapsed(hidden: bool) -> Nonesource

Hide the sidebar completely (True) or bring it back (False).

Sidebar.peek#

peek() -> Nonesource

Sidebar.host_resized#

host_resized(height: int) -> Nonesource

Qt overrides: contextMenuEvent, enterEvent, leaveEvent, paintEvent