KWin
Loading...
Searching...
No Matches
Public Member Functions | List of all members
KWin::EffectFrame Class Reference

Helper class for displaying text and icons in frames. More...

#include <effectframe.h>

Inheritance diagram for KWin::EffectFrame:

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 &region=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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ EffectFrame()

KWin::EffectFrame::EffectFrame ( EffectFrameStyle style,
bool staticSize = true,
QPoint position = QPoint(-1, -1),
Qt::Alignment alignment = Qt::AlignCenter )
explicit

Definition at line 226 of file effectframe.cpp.

◆ ~EffectFrame()

KWin::EffectFrame::~EffectFrame ( )

Definition at line 238 of file effectframe.cpp.

Member Function Documentation

◆ alignment()

Qt::Alignment KWin::EffectFrame::alignment ( ) const

Definition at line 247 of file effectframe.cpp.

◆ crossFadeProgress()

qreal KWin::EffectFrame::crossFadeProgress ( ) const
Returns
The current progress for cross fading
See also
setCrossFadeProgress
enableCrossFade
isCrossFade
Since
4.6

Definition at line 350 of file effectframe.cpp.

◆ enableCrossFade()

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.

Parameters
enabletrue enables cross fading, false disables it again
See also
isCrossFade
setCrossFadeProgress
Since
4.6

Definition at line 345 of file effectframe.cpp.

◆ font()

QFont KWin::EffectFrame::font ( ) const

Definition at line 257 of file effectframe.cpp.

◆ free()

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.

◆ geometry()

QRect KWin::EffectFrame::geometry ( ) const

Definition at line 272 of file effectframe.cpp.

◆ icon()

QIcon KWin::EffectFrame::icon ( ) const

Definition at line 282 of file effectframe.cpp.

◆ iconSize()

QSize KWin::EffectFrame::iconSize ( ) const

Definition at line 296 of file effectframe.cpp.

◆ isCrossFade()

bool KWin::EffectFrame::isCrossFade ( ) const
Returns
true if cross fading is enabled, false otherwise
See also
enableCrossFade
Since
4.6

Definition at line 340 of file effectframe.cpp.

◆ render()

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.

◆ setAlignment()

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.

◆ setCrossFadeProgress()

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.

See also
enableCrossFade
isCrossFade
crossFadeProgress
Since
4.6

Definition at line 355 of file effectframe.cpp.

◆ setFont()

void KWin::EffectFrame::setFont ( const QFont & font)

Definition at line 262 of file effectframe.cpp.

◆ setGeometry()

void KWin::EffectFrame::setGeometry ( const QRect & geometry,
bool force = false )

Definition at line 277 of file effectframe.cpp.

◆ setIcon()

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.

◆ setIconSize()

void KWin::EffectFrame::setIconSize ( const QSize & size)

Definition at line 301 of file effectframe.cpp.

◆ setPosition()

void KWin::EffectFrame::setPosition ( const QPoint & point)

Definition at line 306 of file effectframe.cpp.

◆ setText()

void KWin::EffectFrame::setText ( const QString & text)

Definition at line 330 of file effectframe.cpp.

◆ style()

EffectFrameStyle KWin::EffectFrame::style ( ) const
Returns
The style of this EffectFrame.

Definition at line 335 of file effectframe.cpp.

◆ text()

QString KWin::EffectFrame::text ( ) const

Definition at line 325 of file effectframe.cpp.


The documentation for this class was generated from the following files: