kexi

#include <kexigradientwidget.h>

Public Types

enum  DisplayMode { NoGradient , FadedGradient , SimpleGradient }
enum  GradientType {
  VerticalGradient = KImageEffect::VerticalGradient , HorizontalGradient = KImageEffect::HorizontalGradient , DiagonalGradient = KImageEffect::DiagonalGradient , CrossDiagonalGradient = KImageEffect::CrossDiagonalGradient ,
  PyramidGradient = KImageEffect::PyramidGradient , RectangleGradient = KImageEffect::RectangleGradient , PipeCrossGradient = KImageEffect::PipeCrossGradient , EllipticGradient = KImageEffect::EllipticGradient
}

Public Slots

virtual void setPaletteBackgroundColor (const TQColor &color)
virtual void polish ()

Public Member Functions

 KexiGradientWidget (TQWidget *parent=0, const char *name=0, WFlags f=0)
virtual void setPaletteBackgroundPixmap (const TQPixmap &pixmap)
virtual const TQColor & paletteBackgroundColor () const
void setDisplayMode (DisplayMode mode)
DisplayMode displayMode () const
void setGradientType (GradientType type)
GradientType gradientType () const
void setGradientColor1 (const TQColor &color)
void setGradientColor2 (const TQColor &color)
void setGradientColors (const TQColor &color1, const TQColor &color2)
TQColor gradientColor1 () const
TQColor gradientColor2 () const
void setBlendOpacity (double opacity)
double blendOpacity () const

Protected Member Functions

virtual bool eventFilter (TQObject *object, TQEvent *event)
virtual void enabledChange (bool enabled)
virtual void paletteChange (const TQPalette &pal)
virtual void paintEvent (TQPaintEvent *e)
virtual void resizeEvent (TQResizeEvent *e)
virtual void styleChange (TQStyle &style)

Detailed Description

A simple widget that can use different types of gradients as the background.

Author
Christian Nitschkowski

Definition at line 35 of file kexigradientwidget.h.

Member Enumeration Documentation

◆ DisplayMode

Modes for displaying the gradient.

Enumerator
NoGradient 

No gradient at all. Will behave just like a TQWidget.

FadedGradient 

Gradient will be faded with the widgets background.

SimpleGradient 

Gradient will replace the usual widget background.

Definition at line 51 of file kexigradientwidget.h.

◆ GradientType

Gradient type specification. See GradientType for more details (part of the TDEFX library)

Definition at line 61 of file kexigradientwidget.h.

Constructor & Destructor Documentation

◆ KexiGradientWidget()

KexiGradientWidget::KexiGradientWidget ( TQWidget * parent = 0,
const char * name = 0,
WFlags f = 0 )

Definition at line 32 of file kexigradientwidget.cpp.

◆ ~KexiGradientWidget()

KexiGradientWidget::~KexiGradientWidget ( )
virtual

Definition at line 48 of file kexigradientwidget.cpp.

Member Function Documentation

◆ blendOpacity()

double KexiGradientWidget::blendOpacity ( ) const
inline

Definition at line 156 of file kexigradientwidget.h.

◆ displayMode()

DisplayMode KexiGradientWidget::displayMode ( ) const
inline

Get the current displaymode.

Definition at line 96 of file kexigradientwidget.h.

◆ enabledChange()

virtual void KexiGradientWidget::enabledChange ( bool enabled)
inlineprotectedvirtual

Definition at line 163 of file kexigradientwidget.h.

◆ eventFilter()

bool KexiGradientWidget::eventFilter ( TQObject * object,
TQEvent * event )
protectedvirtual

Manage list of child-widgets.

Add the new child-widget to our list of known widgets.

... and install 'this' as the child's event-filter.

Remove the child-widget from the list of known widgets.

Manage custombackground-list.

p_currentChild will be == 0L, when the user sets it's palette manually. In this case, it has to be added to the customBackground-list.

Check if the widget whose PaletteChange-event we handle isn't the widget we set the background in rebuildCache().

Add the new child to the list of widgets, we don't set the background ourselves if it isn't in the list.

If the palette is now the default-palette again, remove it from the "don't set background in rebuildCache()"-list and rebuild the cache, so it again will get the gradient background.

Definition at line 219 of file kexigradientwidget.cpp.

◆ gradientColor1()

TQColor KexiGradientWidget::gradientColor1 ( ) const
inline
Returns
the color #1 used for the gradient.

Definition at line 142 of file kexigradientwidget.h.

◆ gradientColor2()

TQColor KexiGradientWidget::gradientColor2 ( ) const
inline
Returns
the color #2 used for the gradient.

Definition at line 145 of file kexigradientwidget.h.

◆ gradientType()

GradientType KexiGradientWidget::gradientType ( ) const
inline

Get the current gradient-type.

Definition at line 112 of file kexigradientwidget.h.

◆ paintEvent()

void KexiGradientWidget::paintEvent ( TQPaintEvent * e)
protectedvirtual

Rebuild the background-pixmap if necessary.

Draw the widget as usual

Definition at line 205 of file kexigradientwidget.cpp.

◆ paletteBackgroundColor()

const TQColor & KexiGradientWidget::paletteBackgroundColor ( ) const
virtual

Definition at line 353 of file kexigradientwidget.cpp.

◆ paletteChange()

virtual void KexiGradientWidget::paletteChange ( const TQPalette & pal)
inlineprotectedvirtual

Definition at line 168 of file kexigradientwidget.h.

◆ polish

virtual void KexiGradientWidget::polish ( )
inlinevirtualslot

The cache needs to be rebuild once the widget is set up completely.

Definition at line 236 of file kexigradientwidget.h.

◆ resizeEvent()

virtual void KexiGradientWidget::resizeEvent ( TQResizeEvent * e)
inlineprotectedvirtual

Definition at line 175 of file kexigradientwidget.h.

◆ setBlendOpacity()

void KexiGradientWidget::setBlendOpacity ( double opacity)
inline

Sets the opacity of the gradient when fading with background. opacity has to be between 0.0 and 1.0.

Definition at line 151 of file kexigradientwidget.h.

◆ setDisplayMode()

void KexiGradientWidget::setDisplayMode ( DisplayMode mode)
inline

Set the displaymode mode. The widget will be updated automatically.

Definition at line 87 of file kexigradientwidget.h.

◆ setGradientColor1()

void KexiGradientWidget::setGradientColor1 ( const TQColor & color)
inline

Set color #1 for the gradient-effect. color is the new color.

Definition at line 118 of file kexigradientwidget.h.

◆ setGradientColor2()

void KexiGradientWidget::setGradientColor2 ( const TQColor & color)
inline

Set color #2 for the gradient-effect. color is the new color.

Definition at line 125 of file kexigradientwidget.h.

◆ setGradientColors()

void KexiGradientWidget::setGradientColors ( const TQColor & color1,
const TQColor & color2 )
inline

Set both colors for the gradient. color1 is the first color, color2 the second.

Definition at line 135 of file kexigradientwidget.h.

◆ setGradientType()

void KexiGradientWidget::setGradientType ( GradientType type)
inline

Set the gradient-type.

Definition at line 103 of file kexigradientwidget.h.

◆ setPaletteBackgroundColor

void KexiGradientWidget::setPaletteBackgroundColor ( const TQColor & color)
virtualslot

Definition at line 345 of file kexigradientwidget.cpp.

◆ setPaletteBackgroundPixmap()

virtual void KexiGradientWidget::setPaletteBackgroundPixmap ( const TQPixmap & pixmap)
inlinevirtual

Definition at line 76 of file kexigradientwidget.h.

◆ styleChange()

virtual void KexiGradientWidget::styleChange ( TQStyle & style)
inlineprotectedvirtual

Definition at line 180 of file kexigradientwidget.h.


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