KWin
|
Helper class for displaying text and icons in frames. More...
#include <effectframe.h>
Public Member Functions | |
EffectFrame (EffectFrameStyle style, bool staticSize=true, QPoint position=QPoint(-1, -1), Qt::Alignment alignment=Qt::AlignCenter) | |
~EffectFrame () | |
void | free () |
void | render (const RenderTarget &renderTarget, const RenderViewport &viewport, const QRegion ®ion=infiniteRegion(), double opacity=1.0, double frameOpacity=1.0) |
void | setPosition (const QPoint &point) |
void | setAlignment (Qt::Alignment alignment) |
Qt::Alignment | alignment () const |
void | setGeometry (const QRect &geometry, bool force=false) |
QRect | geometry () const |
void | setText (const QString &text) |
QString | text () const |
void | setFont (const QFont &font) |
QFont | font () const |
void | setIcon (const QIcon &icon) |
QIcon | icon () const |
void | setIconSize (const QSize &size) |
QSize | iconSize () const |
EffectFrameStyle | style () const |
void | enableCrossFade (bool enable) |
bool | isCrossFade () const |
void | setCrossFadeProgress (qreal progress) |
qreal | crossFadeProgress () const |
Helper class for displaying text and icons in frames.
Paints text and/or and icon with an optional frame around them. The available frames includes one that follows the default Plasma theme and another that doesn't. It is recommended to use this class whenever displaying text.
Definition at line 113 of file effectframe.h.
|
explicit |
Definition at line 226 of file effectframe.cpp.
KWin::EffectFrame::~EffectFrame | ( | ) |
Definition at line 238 of file effectframe.cpp.
Qt::Alignment KWin::EffectFrame::alignment | ( | ) | const |
Definition at line 247 of file effectframe.cpp.
qreal KWin::EffectFrame::crossFadeProgress | ( | ) | const |
Definition at line 350 of file effectframe.cpp.
void KWin::EffectFrame::enableCrossFade | ( | bool | enable | ) |
If enable
is true
cross fading between icons and text is enabled By default disabled. Use setCrossFadeProgress to cross fade. Cross Fading is currently only available if OpenGL is used.
enable | true enables cross fading, false disables it again |
Definition at line 345 of file effectframe.cpp.
QFont KWin::EffectFrame::font | ( | ) | const |
Definition at line 257 of file effectframe.cpp.
void KWin::EffectFrame::free | ( | ) |
Delete any existing textures to free up graphics memory. They will be automatically recreated the next time they are required.
Definition at line 267 of file effectframe.cpp.
QRect KWin::EffectFrame::geometry | ( | ) | const |
Definition at line 272 of file effectframe.cpp.
QIcon KWin::EffectFrame::icon | ( | ) | const |
Definition at line 282 of file effectframe.cpp.
QSize KWin::EffectFrame::iconSize | ( | ) | const |
Definition at line 296 of file effectframe.cpp.
bool KWin::EffectFrame::isCrossFade | ( | ) | const |
true
if cross fading is enabled, false
otherwise Definition at line 340 of file effectframe.cpp.
void KWin::EffectFrame::render | ( | const RenderTarget & | renderTarget, |
const RenderViewport & | viewport, | ||
const QRegion & | region = infiniteRegion(), | ||
double | opacity = 1.0, | ||
double | frameOpacity = 1.0 ) |
Render the frame.
Definition at line 311 of file effectframe.cpp.
void KWin::EffectFrame::setAlignment | ( | Qt::Alignment | alignment | ) |
Set the text alignment for static frames and the position alignment for non-static.
Definition at line 252 of file effectframe.cpp.
void KWin::EffectFrame::setCrossFadeProgress | ( | qreal | progress | ) |
Sets the current progress for cross fading the last used icon/text with current icon/text to progress
. A value of 0.0 means completely old icon/text, a value of 1.0 means completely current icon/text. Default value is 1.0. You have to enable cross fade before using it. Cross Fading is currently only available if OpenGL is used.
Definition at line 355 of file effectframe.cpp.
void KWin::EffectFrame::setFont | ( | const QFont & | font | ) |
Definition at line 262 of file effectframe.cpp.
void KWin::EffectFrame::setGeometry | ( | const QRect & | geometry, |
bool | force = false ) |
Definition at line 277 of file effectframe.cpp.
void KWin::EffectFrame::setIcon | ( | const QIcon & | icon | ) |
Set the icon that will appear on the left-hand size of the frame.
Definition at line 287 of file effectframe.cpp.
void KWin::EffectFrame::setIconSize | ( | const QSize & | size | ) |
Definition at line 301 of file effectframe.cpp.
void KWin::EffectFrame::setPosition | ( | const QPoint & | point | ) |
Definition at line 306 of file effectframe.cpp.
void KWin::EffectFrame::setText | ( | const QString & | text | ) |
Definition at line 330 of file effectframe.cpp.
EffectFrameStyle KWin::EffectFrame::style | ( | ) | const |
Definition at line 335 of file effectframe.cpp.
QString KWin::EffectFrame::text | ( | ) | const |
Definition at line 325 of file effectframe.cpp.