Albert
Loading...
Searching...
No Matches
iconutil.h File Reference
#include <albert/export.h>
#include <albert/icon.h>
#include <filesystem>
#include <QString>
Include dependency graph for iconutil.h:

Go to the source code of this file.

Namespaces

namespace  albert
 Albert core interface namespace.
 

Icon utilities

enum  albert::StandardIconType {
  albert::TitleBarMenuButton , albert::TitleBarMinButton , albert::TitleBarMaxButton , albert::TitleBarCloseButton ,
  albert::TitleBarNormalButton , albert::TitleBarShadeButton , albert::TitleBarUnshadeButton , albert::TitleBarContextHelpButton ,
  albert::DockWidgetCloseButton , albert::MessageBoxInformation , albert::MessageBoxWarning , albert::MessageBoxCritical ,
  albert::MessageBoxQuestion , albert::DesktopIcon , albert::TrashIcon , albert::ComputerIcon ,
  albert::DriveFDIcon , albert::DriveHDIcon , albert::DriveCDIcon , albert::DriveDVDIcon ,
  albert::DriveNetIcon , albert::DirOpenIcon , albert::DirClosedIcon , albert::DirLinkIcon ,
  albert::DirLinkOpenIcon , albert::FileIcon , albert::FileLinkIcon , albert::ToolBarHorizontalExtensionButton ,
  albert::ToolBarVerticalExtensionButton , albert::FileDialogStart , albert::FileDialogEnd , albert::FileDialogToParent ,
  albert::FileDialogNewFolder , albert::FileDialogDetailedView , albert::FileDialogInfoView , albert::FileDialogContentsView ,
  albert::FileDialogListView , albert::FileDialogBack , albert::DirIcon , albert::DialogOkButton ,
  albert::DialogCancelButton , albert::DialogHelpButton , albert::DialogOpenButton , albert::DialogSaveButton ,
  albert::DialogCloseButton , albert::DialogApplyButton , albert::DialogResetButton , albert::DialogDiscardButton ,
  albert::DialogYesButton , albert::DialogNoButton , albert::ArrowUp , albert::ArrowDown ,
  albert::ArrowLeft , albert::ArrowRight , albert::ArrowBack , albert::ArrowForward ,
  albert::DirHomeIcon , albert::CommandLink , albert::VistaShield , albert::BrowserReload ,
  albert::BrowserStop , albert::MediaPlay , albert::MediaStop , albert::MediaPause ,
  albert::MediaSkipForward , albert::MediaSkipBackward , albert::MediaSeekForward , albert::MediaSeekBackward ,
  albert::MediaVolume , albert::MediaVolumeMuted , albert::LineEditClearButton , albert::DialogYesToAllButton ,
  albert::DialogNoToAllButton , albert::DialogSaveAllButton , albert::DialogAbortButton , albert::DialogRetryButton ,
  albert::DialogIgnoreButton , albert::RestoreDefaultsButton , albert::TabCloseButton
}
 This enum describes the available standard icons. More...
 
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.
 
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.
 
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.
 
std::unique_ptr< Iconalbert::makeStandardIcon (StandardIconType type)
 Returns a standard icon for the given type.
 
std::unique_ptr< Iconalbert::makeThemeIcon (const QString &icon_name)
 Returns an icon from the current icon theme with the given icon_name.
 
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.
 
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.
 
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.
 
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.