![]() |
LeechCraft
0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
|
General GUI widgets and classes. More...
Classes | |
class | LC::Util::AutoResizeMixin |
Automatically moves a widget to fit a rectangle on resize. More... | |
class | LC::Util::ClearLineEditAddon |
Provides a "clear text" action for line edits. More... | |
class | LC::Util::ColorButton |
A button for choosing a color. More... | |
class | LC::Util::FindNotification |
A horizontal bar with typical widgets for text search. More... | |
class | LC::Util::FindNotificationWE |
A helper class to aid connecting FindNotification with QtWebEngine. More... | |
class | LC::Util::FindNotificationWk |
A helper class to aid connecting FindNotification with Qt WebKit. More... | |
class | LC::Util::FlowLayout |
A simple flow layout implementation. More... | |
class | LC::Util::LineEditButtonManager |
Manages additional overlay buttons in a QLineEdit. More... | |
class | LC::Util::PageNotification |
A horizontal widget embedding into the parent layout of the passed parent widget. More... | |
class | LC::Util::SelectableBrowser |
A "browser" that shows HTML either via QTextBrowser or a browser plugin. More... | |
class | LC::Util::UnhoverDeleteMixin |
Allows to hide a widget or popup after mouse leave. More... | |
Enumerations | |
enum | LC::Util::FitFlag { LC::Util::NoFlags, LC::Util::NoOverlap = 0x01 } |
Functions | |
QPoint | LC::Util::FitRectScreen (QPoint pos, const QSize &size, FitFlags flags=NoFlags, const QPoint &shiftAdd=QPoint(0, 0)) |
Tries to fit a rectangle (like a dialog or popup) into screen. More... | |
QPoint | LC::Util::FitRect (QPoint pos, const QSize &size, const QRect &geometry, FitFlags flags=NoFlags, const QPoint &shiftAdd=QPoint(0, 0)) |
Tries to fit a rectangle (like a dialog or popup) into geometry. More... | |
QLabel * | LC::Util::ShowPixmapLabel (const QPixmap &pixmap, const QPoint &pos=QPoint()) |
Shows a pixmap at the given pos. More... | |
QColor | LC::Util::TintColors (const QColor &c1, const QColor &c2, double alpha=0.5) |
Mixes two colors with the given weights. More... | |
void | LC::Util::TintPalette (QWidget *widget, const QColor &color, double alpha=0.5, const QList< QPalette::ColorRole > &roles={ QPalette::ColorRole::Text, QPalette::ColorRole::WindowText }) |
Mixes some of the widget's palette roles with the given color. More... | |
General GUI widgets and classes.
enum LC::Util::FitFlag |
Additional fitting options used by FitRect() and FitRectScreen().
Definition at line 24 of file geometry.h.
UTIL_GUI_API QPoint LC::Util::FitRect | ( | QPoint | pos, |
const QSize & | size, | ||
const QRect & | geometry, | ||
FitFlags | flags = NoFlags , |
||
const QPoint & | shiftAdd = QPoint(0, 0) |
||
) |
Tries to fit a rectangle (like a dialog or popup) into geometry.
This function tries to move the rectangle with top left point at pos and with given size so that it fits completely into the rectangle given by the geometry parameter. It leaves the size intact, instead returning the new top left position.
If the rectangle is actually moved by this function, the shiftAdd parameter is used to customize how it is moved: the shiftAdd.x()
component is added to the result iff pos.x()
is changed, and shiftAdd.y()
is added to the result iff pos.y()
is changed.
[in] | pos | The original top left position of the rect to fit. |
[in] | size | The size of the rectangle to fit. |
[in] | geometry | The rectangle into which the source rectangle should be fitted. |
[in] | flags | Additional fitting parameters. |
[in] | shiftAdd | Additional components to be added if the rectangle is actually moved in the corresponding directions. |
Definition at line 29 of file geometry.cpp.
UTIL_GUI_API QPoint LC::Util::FitRectScreen | ( | QPoint | pos, |
const QSize & | size, | ||
FitFlags | flags = NoFlags , |
||
const QPoint & | shiftAdd = QPoint(0, 0) |
||
) |
Tries to fit a rectangle (like a dialog or popup) into screen.
This function tries to move the rectangle with top left point at pos and with given size so that it fits completely into the available geometry of the screen that contains the point pos. It leaves the rectangle size intact, instead returning the new top left position.
Calling this function is equivalent to calling FitRect() with the geometry parameter set to QDesktopWidget::availableGeometry(pos)
. See the documentation for FitRect() for more details.
[in] | pos | The original top left position of the rect to fit. |
[in] | size | The size of the rectangle to fit. |
[in] | flags | Additional fitting parameters. |
[in] | shiftAdd | Additional components to be added if the rectangle is actually moved in the corresponding directions. |
Definition at line 24 of file geometry.cpp.
References LC::Util::oral::sph::max, and LC::Util::oral::sph::min.
UTIL_GUI_API QLabel * LC::Util::ShowPixmapLabel | ( | const QPixmap & | pixmap, |
const QPoint & | pos = QPoint() |
||
) |
Shows a pixmap at the given pos.
This function shows a dialog with the given pixmap at the given position. If the pixmap is too big, it is scaled down. A QLabel created with window decorations is used as the dialog. The created label is returned from the function, so one could also set the window title and further customize the label.
This function is useful to display full version of album art in a media player or a user avatar in an IM application.
[in] | pixmap | The pixmap to show. |
[in] | pos | The position where the dialog should be shown. |
UTIL_GUI_API QColor LC::Util::TintColors | ( | const QColor & | c1, |
const QColor & | c2, | ||
double | alpha = 0.5 |
||
) |
Mixes two colors with the given weights.
Mixes two colors c1 and c2 with weights alpha and (1 - alpha) respectively.
[in] | c1 | The first color to mix. |
[in] | c2 | The second color to mix. |
[in] | alpha | The weight of the first color (and 1 - weight for the second color). |
Definition at line 89 of file util.cpp.
Referenced by LC::Util::ElideProgressBarText().
UTIL_GUI_API void LC::Util::TintPalette | ( | QWidget * | widget, |
const QColor & | color, | ||
double | alpha = 0.5 , |
||
const QList< QPalette::ColorRole > & | roles = { QPalette::ColorRole::Text, QPalette::ColorRole::WindowText } |
||
) |
Mixes some of the widget's palette roles with the given color.
This function queries the palette of the widget and mixes the colors for the given roles in it with the given color and the given alpha weight. After that it sets the resulting palette back for the widget.
[in] | widget | The widget whose palette should be changed. |
[in] | color | The color to tint the palette's colors with. |
[in] | alpha | The weight of the palette's colors in the resulting mix. |
[in] | roles | The roles of the palette that should be mixed with the given color. |