KWindowEffects

KWindowEffects Namespace Reference

Enumerations

enum  Effect { Slide = 1 , BlurBehind = 7 , BackgroundContrast = 9 }
 
enum  SlideFromLocation {
  NoEdge = 0 , TopEdge , RightEdge , BottomEdge ,
  LeftEdge
}
 

Functions

void enableBackgroundContrast (QWindow *window, bool enable=true, qreal contrast=1, qreal intensity=1, qreal saturation=1, const QRegion &region=QRegion())
 
void enableBlurBehind (QWindow *window, bool enable=true, const QRegion &region=QRegion())
 
bool isEffectAvailable (Effect effect)
 
void slideWindow (QWindow *window, SlideFromLocation location, int offset=-1)
 

Detailed Description

Namespace for common standardized window effects.

Enumeration Type Documentation

◆ Effect

enum KWindowEffects::Effect

Definition at line 23 of file kwindoweffects.h.

◆ SlideFromLocation

enum KWindowEffects::SlideFromLocation

Definition at line 29 of file kwindoweffects.h.

Function Documentation

◆ enableBackgroundContrast()

KWINDOWSYSTEM_EXPORT void KWindowEffects::enableBackgroundContrast ( QWindow * window,
bool enable = true,
qreal contrast = 1,
qreal intensity = 1,
qreal saturation = 1,
const QRegion & region = QRegion() )

Instructs the window manager to modify the color of the background in the specified region behind the given window, in order to improve the contrast and readability of any text in the translucent window.

The given region will overwrite any previous backgroundcontrast region. Passing a null region will enable the blur effect for the whole window. The region is relative to the top-left corner of the client area.

If enable is false, blur will be disabled for the whole window (region is ignored).

Note that you will usually want to set the region to the shape of the window, excluding any shadow or halo.

Parameters
windowThe window for which to enable the background contrast effect
enableEnable the effect if true, disable it if false
brightnessHow to modify the area brightness: from 0 (make it black) to 2 (make it white), 1 leaves it unchanged
regionThe region within the window where the background will be modified, specified in logical pixels
Since
5.82

Definition at line 31 of file kwindoweffects.cpp.

◆ enableBlurBehind()

KWINDOWSYSTEM_EXPORT void KWindowEffects::enableBlurBehind ( QWindow * window,
bool enable = true,
const QRegion & region = QRegion() )

Instructs the window manager to blur the background in the specified region behind the given window.

The given region will overwrite any previous blur-behind region. Passing a null region will enable the blur effect for the whole window. The region is relative to the top-left corner of the client area.

If enable is false, blur will be disabled for the whole window (region is ignored).

Note that you will usually want to set the region to the shape of the window, excluding any shadow or halo.

Parameters
windowThe window for which to enable the blur effect
enableEnable the effect if true, disable it if false
regionThe region within the window where the background will be blurred, specified in logical pixels
Since
5.82

Definition at line 26 of file kwindoweffects.cpp.

◆ isEffectAvailable()

KWINDOWSYSTEM_EXPORT bool KWindowEffects::isEffectAvailable ( Effect effect)
Returns
if an atom property is available
Parameters
effectthe effect we want to check

Definition at line 21 of file kwindoweffects.cpp.

◆ slideWindow()

KWINDOWSYSTEM_EXPORT void KWindowEffects::slideWindow ( QWindow * window,
SlideFromLocation location,
int offset = -1 )

Mark a window as sliding from screen edge.

Parameters
idof the window on which we want to apply the effect
locationedge of the screen from which we want the sliding effect. Desktop and Floating won't have effect.
offsetdistance in pixels from the screen edge defined by location
Since
5.82

Definition at line 36 of file kwindoweffects.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:06:21 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.