Albert
Loading...
Searching...
No Matches

Description

Utility for icon factories.

Functions

QIcon albert::qIcon (std::unique_ptr< albert::Icon > icon)
 Returns a QIcon using icon as icon engine.
 
std::unique_ptr< Iconalbert::iconFromUrl (const QString &url)
 Returns a built-in icon for the given url.
 
std::unique_ptr< Iconalbert::iconFromUrls (const QStringList &urls)
 Returns a built-in icon for the given urls.
 

Standard icon (QStyle standard pixmap)

enum  albert::StandardIconType
 This enum describes the available standard icons. More...
 
std::unique_ptr< Iconalbert::makeStandardIcon (StandardIconType type)
 Returns a standard icon for the given type.
 

Image icon

std::unique_ptr< Iconalbert::makeImageIcon (const QString &path)
 Returns an icon from an image file at path.
 
std::unique_ptr< Iconalbert::makeImageIcon (const std::filesystem::path &path)
 Returns an icon from an image file at path.
 

File type icon

std::unique_ptr< Iconalbert::makeFileTypeIcon (const QString &path)
 Returns an icon representing the file type of the file at path.
 
std::unique_ptr< Iconalbert::makeFileTypeIcon (const std::filesystem::path &path)
 Returns an icon representing the file type of the file at path.
 

Theme icon (XDG)

std::unique_ptr< Iconalbert::makeThemeIcon (const QString &icon_name)
 Returns an icon from the current icon theme with the given icon_name.
 

Grapheme icon

const QBrush & albert::graphemeIconDefaultColor ()
 Returns the default color (black).
 
double albert::graphemeIconDefaultScalar ()
 Returns the default scaling factor (1.0).
 
std::unique_ptr< Iconalbert::makeGraphemeIcon (const QString &grapheme, double scalar=graphemeIconDefaultScalar(), const QBrush &color=graphemeIconDefaultColor())
 Returns an icon rendering the given grapheme, scaled by scalar and colored with color.
 

Rect icon

const QBrush & albert::rectIconDefaultColor ()
 Returns the default color (black).
 
const QBrush & albert::rectIconDefaultBorderColor ()
 Returns the default border color (black).
 
double albert::rectIconDefaultRadius ()
 Returns the default border radius (1.0).
 
int albert::rectIconDefaultBorderWidth ()
 Returns the default border width (0).
 
std::unique_ptr< Iconalbert::makeRectIcon (const QBrush &color=rectIconDefaultColor(), double radius=rectIconDefaultRadius(), int border_width=rectIconDefaultBorderWidth(), const QBrush &border_color=rectIconDefaultBorderColor())
 Returns a simple rectangular icon with the given color, radius, border_width and border_color.
 

Iconified icon

const QBrush & albert::iconifiedIconDefaultColor ()
 Returns the default background color (a top down gradient from white to some darker white).
 
double albert::iconifiedIconDefaultBorderRadius ()
 Returns the default relative radius 1.0.
 
int albert::iconifiedIconDefaultBorderWidth ()
 Returns the default border width (1).
 
const QBrush & albert::iconifiedIconDefaultBorderColor ()
 Returns the default border color (a gradient slightly darker than the default background).
 
std::unique_ptr< Iconalbert::makeIconifiedIcon (std::unique_ptr< Icon > src, const QBrush &color=iconifiedIconDefaultColor(), double border_radius=iconifiedIconDefaultBorderRadius(), int border_width=iconifiedIconDefaultBorderWidth(), const QBrush &border_color=iconifiedIconDefaultBorderColor())
 Returns an iconified src.
 

Composed icon

double albert::composedIconDefaultSize ()
 Returns the default relative size 0.7.
 
double albert::composedIconDefaultPos1 ()
 Returns the default relative position 0.0 of the first item.
 
double albert::composedIconDefaultPos2 ()
 Returns the default relative position 1.0 of the second item.
 
std::unique_ptr< Iconalbert::makeComposedIcon (std::unique_ptr< Icon > src1, std::unique_ptr< Icon > src2, double size1=composedIconDefaultSize(), double size2=composedIconDefaultSize(), double x1=composedIconDefaultPos1(), double y1=composedIconDefaultPos1(), double x2=composedIconDefaultPos2(), double y2=composedIconDefaultPos2())
 Returns a composed icon of src1 and src2.
 

Enumeration Type Documentation

◆ StandardIconType

This enum describes the available standard icons.

See Qt documentation for more details.

Enumerator
TitleBarMinButton 

Menu button on a title bar.

TitleBarMenuButton 

Minimize button on title bars (e.g., in QMdiSubWindow).

TitleBarMaxButton 

Maximize button on title bars.

TitleBarCloseButton 

Close button on title bars.

TitleBarNormalButton 

Normal (restore) button on title bars.

TitleBarShadeButton 

Shade button on title bars.

TitleBarUnshadeButton 

Unshade button on title bars.

TitleBarContextHelpButton 

The Context help button on title bars.

MessageBoxInformation 

The "information" icon.

MessageBoxWarning 

The "warning" icon.

MessageBoxCritical 

The "critical" icon.

MessageBoxQuestion 

The "question" icon.

DesktopIcon 

The "desktop" icon.

TrashIcon 

The "trash" icon.

ComputerIcon 

The "My computer" icon.

DriveFDIcon 

The floppy icon.

DriveHDIcon 

The harddrive icon.

DriveCDIcon 

The CD icon.

DriveDVDIcon 

The DVD icon.

DriveNetIcon 

The network icon.

DirHomeIcon 

The home directory icon.

DirOpenIcon 

The open directory icon.

DirClosedIcon 

The closed directory icon.

DirIcon 

The directory icon.

DirLinkIcon 

The link to directory icon.

DirLinkOpenIcon 

The link to open directory icon.

FileIcon 

The file icon.

FileLinkIcon 

The link to file icon.

FileDialogStart 

The "start" icon in a file dialog.

FileDialogEnd 

The "end" icon in a file dialog.

FileDialogToParent 

The "parent directory" icon in a file dialog.

FileDialogNewFolder 

The "create new folder" icon in a file dialog.

FileDialogDetailedView 

The detailed view icon in a file dialog.

FileDialogInfoView 

The file info icon in a file dialog.

FileDialogContentsView 

The contents view icon in a file dialog.

FileDialogListView 

The list view icon in a file dialog.

FileDialogBack 

The back arrow in a file dialog.

DockWidgetCloseButton 

Close button on dock windows (see also QDockWidget).

ToolBarHorizontalExtensionButton 

Extension button for horizontal toolbars.

ToolBarVerticalExtensionButton 

Extension button for vertical toolbars.

DialogOkButton 

Icon for a standard OK button in a QDialogButtonBox.

DialogCancelButton 

Icon for a standard Cancel button in a QDialogButtonBox.

DialogHelpButton 

Icon for a standard Help button in a QDialogButtonBox.

DialogOpenButton 

Icon for a standard Open button in a QDialogButtonBox.

DialogSaveButton 

Icon for a standard Save button in a QDialogButtonBox.

DialogCloseButton 

Icon for a standard Close button in a QDialogButtonBox.

DialogApplyButton 

Icon for a standard Apply button in a QDialogButtonBox.

DialogResetButton 

Icon for a standard Reset button in a QDialogButtonBox.

DialogDiscardButton 

Icon for a standard Discard button in a QDialogButtonBox.

DialogYesButton 

Icon for a standard Yes button in a QDialogButtonBox.

DialogNoButton 

Icon for a standard No button in a QDialogButtonBox.

ArrowUp 

Icon arrow pointing up.

ArrowDown 

Icon arrow pointing down.

ArrowLeft 

Icon arrow pointing left.

ArrowRight 

Icon arrow pointing right.

ArrowBack 

Equivalent to SP_ArrowLeft when the current layout direction is Qt::LeftToRight, otherwise SP_ArrowRight.

ArrowForward 

Equivalent to SP_ArrowRight when the current layout direction is Qt::LeftToRight, otherwise SP_ArrowLeft.

CommandLink 

Icon used to indicate a Vista style command link glyph.

VistaShield 

Icon used to indicate UAC prompts on Windows Vista. This will return a null pixmap or icon on all other platforms.

BrowserReload 

Icon indicating that the current page should be reloaded.

BrowserStop 

Icon indicating that the page loading should stop.

MediaPlay 

Icon indicating that media should begin playback.

MediaStop 

Icon indicating that media should stop playback.

MediaPause 

Icon indicating that media should pause playback.

MediaSkipForward 

Icon indicating that media should skip forward.

MediaSkipBackward 

Icon indicating that media should skip backward.

MediaSeekForward 

Icon indicating that media should seek forward.

MediaSeekBackward 

Icon indicating that media should seek backward.

MediaVolume 

Icon indicating a volume control.

MediaVolumeMuted 

Icon indicating a muted volume control.

LineEditClearButton 

Icon for a standard clear button in a QLineEdit.

DialogYesToAllButton 

Icon for a standard YesToAll button in a QDialogButtonBox.

DialogNoToAllButton 

Icon for a standard NoToAll button in a QDialogButtonBox.

DialogSaveAllButton 

Icon for a standard SaveAll button in a QDialogButtonBox.

DialogAbortButton 

Icon for a standard Abort button in a QDialogButtonBox.

DialogRetryButton 

Icon for a standard Retry button in a QDialogButtonBox.

DialogIgnoreButton 

Icon for a standard Ignore button in a QDialogButtonBox.

RestoreDefaultsButton 

Icon for a standard RestoreDefaults button in a QDialogButtonBox.

TabCloseButton 

Icon for the close button in the tab of a QTabBar.

Function Documentation

◆ composedIconDefaultPos1()

double albert::composedIconDefaultPos1 ( )

Returns the default relative position 0.0 of the first item.

◆ composedIconDefaultPos2()

double albert::composedIconDefaultPos2 ( )

Returns the default relative position 1.0 of the second item.

◆ composedIconDefaultSize()

double albert::composedIconDefaultSize ( )

Returns the default relative size 0.7.

◆ graphemeIconDefaultColor()

const QBrush & albert::graphemeIconDefaultColor ( )

Returns the default color (black).

◆ graphemeIconDefaultScalar()

double albert::graphemeIconDefaultScalar ( )

Returns the default scaling factor (1.0).

◆ iconFromUrl()

std::unique_ptr< Icon > albert::iconFromUrl ( const QString &  url)

Returns a built-in icon for the given url.

See also Icon::toUrl.

◆ iconFromUrls()

std::unique_ptr< Icon > albert::iconFromUrls ( const QStringList urls)

Returns a built-in icon for the given urls.

See also Icon::toUrl.

◆ iconifiedIconDefaultBorderColor()

const QBrush & albert::iconifiedIconDefaultBorderColor ( )

Returns the default border color (a gradient slightly darker than the default background).

◆ iconifiedIconDefaultBorderRadius()

double albert::iconifiedIconDefaultBorderRadius ( )

Returns the default relative radius 1.0.

◆ iconifiedIconDefaultBorderWidth()

int albert::iconifiedIconDefaultBorderWidth ( )

Returns the default border width (1).

◆ iconifiedIconDefaultColor()

const QBrush & albert::iconifiedIconDefaultColor ( )

Returns the default background color (a top down gradient from white to some darker white).

◆ makeComposedIcon()

std::unique_ptr< Icon > albert::makeComposedIcon ( std::unique_ptr< Icon src1,
std::unique_ptr< Icon src2,
double  size1 = composedIconDefaultSize(),
double  size2 = composedIconDefaultSize(),
double  x1 = composedIconDefaultPos1(),
double  y1 = composedIconDefaultPos1(),
double  x2 = composedIconDefaultPos2(),
double  y2 = composedIconDefaultPos2() 
)

Returns a composed icon of src1 and src2.

size1 and size2 specify the relative sizes (0.0 - 1.0) of the icons. x1, y1, x2, and y2 specify the relative positions (0.0 - 1.0, 0.5 is centered) of the icons.

◆ makeFileTypeIcon() [1/2]

std::unique_ptr< Icon > albert::makeFileTypeIcon ( const QString &  path)

Returns an icon representing the file type of the file at path.

◆ makeFileTypeIcon() [2/2]

std::unique_ptr< Icon > albert::makeFileTypeIcon ( const std::filesystem::path &  path)

Returns an icon representing the file type of the file at path.

◆ makeGraphemeIcon()

std::unique_ptr< Icon > albert::makeGraphemeIcon ( const QString &  grapheme,
double  scalar = graphemeIconDefaultScalar(),
const QBrush &  color = graphemeIconDefaultColor() 
)

Returns an icon rendering the given grapheme, scaled by scalar and colored with color.

◆ makeIconifiedIcon()

std::unique_ptr< Icon > albert::makeIconifiedIcon ( std::unique_ptr< Icon src,
const QBrush &  color = iconifiedIconDefaultColor(),
double  border_radius = iconifiedIconDefaultBorderRadius(),
int  border_width = iconifiedIconDefaultBorderWidth(),
const QBrush &  border_color = iconifiedIconDefaultBorderColor() 
)

Returns an iconified src.

i.e. drawn in a colored rounded rectangle with a border.

color specifies the background color, border_width the border width in device independent pixels, border_radius the relative border radius (0.0 - 1.0), and border_color the border color.

◆ makeImageIcon() [1/2]

std::unique_ptr< Icon > albert::makeImageIcon ( const QString &  path)

Returns an icon from an image file at path.

◆ makeImageIcon() [2/2]

std::unique_ptr< Icon > albert::makeImageIcon ( const std::filesystem::path &  path)

Returns an icon from an image file at path.

◆ makeRectIcon()

std::unique_ptr< Icon > albert::makeRectIcon ( const QBrush &  color = rectIconDefaultColor(),
double  radius = rectIconDefaultRadius(),
int  border_width = rectIconDefaultBorderWidth(),
const QBrush &  border_color = rectIconDefaultBorderColor() 
)

Returns a simple rectangular icon with the given color, radius, border_width and border_color.

◆ makeStandardIcon()

std::unique_ptr< Icon > albert::makeStandardIcon ( StandardIconType  type)

Returns a standard icon for the given type.

◆ makeThemeIcon()

std::unique_ptr< Icon > albert::makeThemeIcon ( const QString &  icon_name)

Returns an icon from the current icon theme with the given icon_name.

◆ qIcon()

QIcon albert::qIcon ( std::unique_ptr< albert::Icon icon)

Returns a QIcon using icon as icon engine.

◆ rectIconDefaultBorderColor()

const QBrush & albert::rectIconDefaultBorderColor ( )

Returns the default border color (black).

◆ rectIconDefaultBorderWidth()

int albert::rectIconDefaultBorderWidth ( )

Returns the default border width (0).

◆ rectIconDefaultColor()

const QBrush & albert::rectIconDefaultColor ( )

Returns the default color (black).

◆ rectIconDefaultRadius()

double albert::rectIconDefaultRadius ( )

Returns the default border radius (1.0).