#include <tdestyle.h>
Inherits TQCommonStyle.
Public Types | |
enum | TDEStyleOption { Default = 0x00000000 , AllowMenuTransparency = 0x00000001 , FilledFrameWorkaround = 0x00000002 } |
enum | TDEStyleScrollBarType { WindowsStyleScrollBar = 0x00000000 , PlatinumStyleScrollBar = 0x00000001 , ThreeButtonScrollBar = 0x00000002 , NextStyleScrollBar = 0x00000004 } |
enum | TDEStylePrimitive { KPE_DockWindowHandle , KPE_ToolBarHandle , KPE_GeneralHandle , KPE_SliderGroove , KPE_SliderHandle , KPE_ListViewExpander , KPE_ListViewBranch } |
enum | TDEStylePixelMetric { KPM_MenuItemSeparatorHeight = 0x00000001 , KPM_MenuItemHMargin = 0x00000002 , KPM_MenuItemVMargin = 0x00000004 , KPM_MenuItemHFrame = 0x00000008 , KPM_MenuItemVFrame = 0x00000010 , KPM_MenuItemCheckMarkHMargin = 0x00000020 , KPM_MenuItemArrowHMargin = 0x00000040 , KPM_MenuItemTabSpacing = 0x00000080 , KPM_ListViewBranchThickness = 0x00000100 } |
typedef uint | TDEStyleFlags |
Public Member Functions | |
TDEStyle (TDEStyleFlags flags=TDEStyle::Default, TDEStyleScrollBarType sbtype=TDEStyle::WindowsStyleScrollBar) | |
~TDEStyle () | |
void | setScrollBarType (TDEStyleScrollBarType sbtype) |
TDEStyleFlags | styleFlags () const |
virtual void | renderMenuBlendPixmap (KPixmap &pix, const TQColorGroup &cg, const TQPopupMenu *popup) const |
virtual void | drawTDEStylePrimitive (TDEStylePrimitive kpe, TQPainter *p, const TQWidget *widget, const TQRect &r, const TQColorGroup &cg, SFlags flags=Style_Default, const TQStyleOption &=TQStyleOption::Default) const |
virtual void | drawTDEStylePrimitive (TDEStylePrimitive kpe, TQPainter *p, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQRect &r, const TQColorGroup &cg, SFlags flags=Style_Default, const TQStyleOption &=TQStyleOption::Default, const TQWidget *widget=0) const |
int | kPixelMetric (TDEStylePixelMetric kpm, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQWidget *widget=0) const |
void | polish (const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *) |
void | unPolish (const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *) |
void | polishPopupMenu (const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, void *ptr) |
void | drawPrimitive (PrimitiveElement pe, TQPainter *p, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQRect &r, const TQColorGroup &cg, SFlags flags=Style_Default, const TQStyleOption &=TQStyleOption::Default) const |
void | drawControl (ControlElement element, TQPainter *p, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQRect &r, const TQColorGroup &cg, SFlags flags=Style_Default, const TQStyleOption &=TQStyleOption::Default, const TQWidget *widget=0) const |
void | drawComplexControl (ComplexControl control, TQPainter *p, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQRect &r, const TQColorGroup &cg, SFlags flags=Style_Default, SCFlags controls=SC_All, SCFlags active=SC_None, const TQStyleOption &=TQStyleOption::Default, const TQWidget *widget=0) const |
SubControl | querySubControl (ComplexControl control, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQPoint &pos, const TQStyleOption &=TQStyleOption::Default, const TQWidget *widget=0) const |
TQRect | querySubControlMetrics (ComplexControl control, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, SubControl sc, const TQStyleOption &=TQStyleOption::Default, const TQWidget *widget=0) const |
int | pixelMetric (PixelMetric m, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQWidget *widget=0) const |
TQRect | subRect (SubRect r, const TQStyleControlElementData &ceData, const ControlElementFlags elementFlags, const TQWidget *widget=0) const |
TQPixmap | stylePixmap (StylePixmap stylepixmap, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQStyleOption &=TQStyleOption::Default, const TQWidget *widget=0) const |
int | styleHint (StyleHint sh, const TQStyleControlElementData &ceData, ControlElementFlags elementFlags, const TQStyleOption &opt=TQStyleOption::Default, TQStyleHintReturn *shr=0, const TQWidget *w=0) const |
Static Public Member Functions | |
static TQString | defaultStyle () |
Related Functions | |
(Note that these are not member functions.) | |
TDEFX_EXPORT void | kDrawNextButton (TQPainter *p, const TQRect &r, const TQColorGroup &g, bool sunken=false, const TQBrush *fill=0) |
TDEFX_EXPORT void | kDrawNextButton (TQPainter *p, int x, int y, int w, int h, const TQColorGroup &g, bool sunken=false, const TQBrush *fill=0) |
TDEFX_EXPORT void | kDrawBeButton (TQPainter *p, TQRect &r, const TQColorGroup &g, bool sunken=false, const TQBrush *fill=0) |
TDEFX_EXPORT void | kDrawBeButton (TQPainter *p, int x, int y, int w, int h, const TQColorGroup &g, bool sunken=false, const TQBrush *fill=0) |
TDEFX_EXPORT void | kDrawRoundButton (TQPainter *p, const TQRect &r, const TQColorGroup &g, bool sunken=false) |
TDEFX_EXPORT void | kDrawRoundButton (TQPainter *p, int x, int y, int w, int h, const TQColorGroup &g, bool sunken=false) |
TDEFX_EXPORT void | kRoundMaskRegion (TQRegion &r, int x, int y, int w, int h) |
TDEFX_EXPORT void | kDrawRoundMask (TQPainter *p, int x, int y, int w, int h, bool clear=false) |
TDEFX_EXPORT void | kColorBitmaps (TQPainter *p, const TQColorGroup &g, int x, int y, TQBitmap *lightColor=0, TQBitmap *midColor=0, TQBitmap *midlightColor=0, TQBitmap *darkColor=0, TQBitmap *blackColor=0, TQBitmap *whiteColor=0) |
TDEFX_EXPORT void | kColorBitmaps (TQPainter *p, const TQColorGroup &g, int x, int y, int w, int h, bool isXBitmaps=true, const uchar *lightColor=0, const uchar *midColor=0, const uchar *midlightColor=0, const uchar *darkColor=0, const uchar *blackColor=0, const uchar *whiteColor=0) |
Detailed Description
Simplifies and extends the TQStyle API to make style coding easier.
The TDEStyle class provides a simple internal menu transparency engine which attempts to use XRender for accelerated blending where requested, or falls back to fast internal software tinting/blending routines. It also simplifies more complex portions of the TQStyle API, such as the PopupMenuItems, ScrollBars and Sliders by providing extra "primitive elements" which are simple to implement by the style writer.
- See also
- TQStyle::QStyle
- TQCommonStyle::QCommonStyle
- Version
- $Id$
Definition at line 57 of file tdestyle.h.
Member Typedef Documentation
◆ TDEStyleFlags
typedef uint TDEStyle::TDEStyleFlags |
TDEStyle Flags:
- Default - Default style setting, where menu transparency and the FilledFrameWorkaround are disabled.
- AllowMenuTransparency - Enable this flag to use TDEStyle's internal menu transparency engine.
- FilledFrameWorkaround - Enable this flag to facilitate proper repaints of QMenuBars and QToolBars when the style chooses to paint the interior of a TQFrame. The style primitives in question are PE_PanelMenuBar and PE_PanelDockWindow. The HighColor style uses this workaround to enable painting of gradients in menubars and toolbars.
Definition at line 80 of file tdestyle.h.
Member Enumeration Documentation
◆ TDEStyleOption
Enumerator | |
---|---|
Default | All options disabled. |
AllowMenuTransparency | Internal transparency enabled. |
FilledFrameWorkaround | Filled frames enabled. |
Definition at line 81 of file tdestyle.h.
◆ TDEStylePrimitive
TDEStyle Primitive Elements:
The TDEStyle class extends the Qt's Style API by providing certain simplifications for parts of TQStyle. To do this, the TDEStylePrimitive elements were defined, which are very similar to Qt's PrimitiveElement.
The first three Handle primitives simplify and extend PE_DockWindowHandle, so do not reimplement PE_DockWindowHandle if you want the TDEStyle handle simplifications to be operable. Similarly do not reimplement CC_Slider, SC_SliderGroove and SC_SliderHandle when using the TDEStyle slider primitives. TDEStyle automatically double-buffers slider painting when they are drawn via these TDEStyle primitives to avoid flicker.
- KPE_DockWindowHandle - This primitive is already implemented in TDEStyle, and paints a bevelled rect with the DockWindow caption text. Re-implement this primitive to perform other more fancy effects when drawing the dock window handle.
- KPE_ToolBarHandle - This primitive must be reimplemented. It currently only paints a filled rectangle as default behavior. This primitive is used to render TQToolBar handles.
- KPE_GeneralHandle - This primitive must be reimplemented. It is used to render general handles that are not part of a TQToolBar or TQDockWindow, such as the applet handles used in Kicker. The default implementation paints a filled rect of arbitrary color.
- KPE_SliderGroove - This primitive must be reimplemented. It is used to paint the slider groove. The default implementation paints a filled rect of arbitrary color.
- KPE_SliderHandle - This primitive must be reimplemented. It is used to paint the slider handle. The default implementation paints a filled rect of arbitrary color.
- KPE_ListViewExpander - This primitive is already implemented in TDEStyle. It is used to draw the Expand/Collapse element in QListViews. To indicate the expanded state, the style flags are set to Style_Off, while Style_On implies collapsed.
- KPE_ListViewBranch - This primitive is already implemented in TDEStyle. It is used to draw the ListView branches where necessary.
Definition at line 228 of file tdestyle.h.
◆ TDEStyleScrollBarType
TDEStyle ScrollBarType:
Allows the style writer to easily select what type of scrollbar should be used without having to duplicate large amounts of source code by implementing the complex control CC_ScrollBar.
- WindowsStyleScrollBar - Two button scrollbar with the previous button at the top/left, and the next button at the bottom/right.
- PlatinumStyleScrollBar - Two button scrollbar with both the previous and next buttons at the bottom/right.
- ThreeButtonScrollBar - KDE style three button scrollbar with two previous buttons, and one next button. The next button is always at the bottom/right, whilst the two previous buttons are on either end of the scrollbar.
- NextStyleScrollBar - Similar to the PlatinumStyle scroll bar, but with the buttons grouped on the opposite end of the scrollbar.
- See also
- TDEStyle::TDEStyle()
Enumerator | |
---|---|
WindowsStyleScrollBar | two button, windows style |
PlatinumStyleScrollBar | two button, platinum style |
ThreeButtonScrollBar | three buttons, KDE style |
NextStyleScrollBar | two button, NeXT style |
Definition at line 110 of file tdestyle.h.
Constructor & Destructor Documentation
◆ TDEStyle()
TDEStyle::TDEStyle | ( | TDEStyleFlags | flags = TDEStyle::Default , |
TDEStyleScrollBarType | sbtype = TDEStyle::WindowsStyleScrollBar |
||
) |
Constructs a TDEStyle object.
Select the appropriate TDEStyle flags and scrollbar type for your style. The user's style preferences selected in KControl are read by using TQSettings and are automatically applied to the style. As a fallback, TDEStyle paints progressbars and tabbars. It inherits from TQCommonStyle for speed, so don't expect much to be implemented.
It is advisable to use a currently implemented style such as the HighColor style as a foundation for any new TDEStyle, so the limited number of drawing fallbacks should not prove problematic.
- Parameters
-
flags the style to be applied sbtype the scroll bar type
Definition at line 189 of file tdestyle.cpp.
◆ ~TDEStyle()
TDEStyle::~TDEStyle | ( | ) |
Destructs the TDEStyle object.
Definition at line 244 of file tdestyle.cpp.
Member Function Documentation
◆ defaultStyle()
|
static |
Returns the default widget style depending on color depth.
Definition at line 256 of file tdestyle.cpp.
◆ drawTDEStylePrimitive()
|
virtual |
This function is identical to Qt's TQStyle::drawPrimitive(), except that it adds one further parameter, 'widget', that can be used to determine the widget state of the TDEStylePrimitive in question.
- See also
- TDEStyle::TDEStylePrimitive
- TQStyle::drawPrimitive
- TQStyle::drawComplexControl
Definition at line 358 of file tdestyle.cpp.
◆ renderMenuBlendPixmap()
|
virtual |
This virtual function defines the pixmap used to blend between the popup menu and the background to create different menu transparency effects.
For example, you can fill the pixmap "pix" with a gradient based on the popup's colorGroup, a texture, or some other fancy painting routine. TDEStyle will then internally blend this pixmap with a snapshot of the background behind the popupMenu to create the illusion of transparency.
This virtual is never called if XRender/Software blending is disabled by the user in KDE's style control module.
Definition at line 340 of file tdestyle.cpp.
◆ setScrollBarType()
void TDEStyle::setScrollBarType | ( | TDEStyleScrollBarType | sbtype | ) |
Modifies the scrollbar type used by the style.
This function is only provided for convenience. It allows you to make a late decision about what scrollbar type to use for the style after performing some processing in your style's constructor. In most situations however, setting the scrollbar type via the TDEStyle constructor should suffice.
- Parameters
-
sbtype the scroll bar type
- See also
- TDEStyle::TDEStyleScrollBarType
Definition at line 330 of file tdestyle.cpp.
◆ styleFlags()
TDEStyle::TDEStyleFlags TDEStyle::styleFlags | ( | ) | const |
Returns the TDEStyle flags used to initialize the style.
This is used solely for the kcmstyle module, and hence is internal.
Definition at line 335 of file tdestyle.cpp.
Friends And Related Function Documentation
◆ kColorBitmaps() [1/2]
|
related |
#include
<kdrawutil.h>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 239 of file kdrawutil.cpp.
◆ kColorBitmaps() [2/2]
|
related |
#include
<kdrawutil.h>
Paints the provided bitmaps in the painter, using the supplied colorgroup for the foreground colors. There's one bitmap for each color. If you want to skip a color, pass null for the corresponding bitmap.
- Note
- The bitmaps will be self-masked automatically if not masked prior to calling this routine.
- Parameters
-
p The painter to use for drawing the bitmaps. g Specifies the shading colors. x The X coordinate at which to draw the bitmaps. y The Y coordinate at which to draw the bitmaps. lightColor The bitmap to use for the light part. midColor The bitmap to use for the mid part. midlightColor The bitmap to use for the midlight part. darkColor The bitmap to use for the dark part. blackColor The bitmap to use for the black part. whiteColor The bitmap to use for the white part.
- See also
- QColorGroup
Definition at line 217 of file kdrawutil.cpp.
◆ kDrawBeButton() [1/2]
|
related |
#include
<kdrawutil.h>
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 49 of file kdrawutil.cpp.
◆ kDrawBeButton() [2/2]
|
related |
#include
<kdrawutil.h>
Draws a Be-style button.
- Parameters
-
p The painter to use for drawing the button. r Specifies the rect in which to draw the button. g Specifies the shading colors. sunken Whether to draw the button as sunken (pressed) or not. fill The brush to use for filling the interior of the button. Pass null to prevent the button from being filled.
Definition at line 93 of file kdrawutil.cpp.
◆ kDrawNextButton() [1/2]
|
related |
#include
<kdrawutil.h>
Draws a Next-style button (solid black shadow with light and midlight highlight).
- Parameters
-
p The painter to use for drawing the button. r Specifies the rect in which to draw the button. g Specifies the shading colors. sunken Whether to draw the button as sunken (pressed) or not. fill The brush to use for filling the interior of the button. Pass null to prevent the button from being filled.
Definition at line 43 of file kdrawutil.cpp.
◆ kDrawNextButton() [2/2]
|
related |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 21 of file kdrawutil.cpp.
◆ kDrawRoundButton() [1/2]
|
related |
#include
<kdrawutil.h>
Draws a rounded oval button. This function doesn't fill the button. See kRoundMaskRegion() for setting masks for fills.
- Parameters
-
p The painter to use for drawing the button. r Specifies the rect in which to draw the button. g Specifies the shading colors. sunken Whether to draw the button as sunken (pressed) or not.
Definition at line 99 of file kdrawutil.cpp.
◆ kDrawRoundButton() [2/2]
|
related |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 139 of file kdrawutil.cpp.
◆ kDrawRoundMask()
|
related |
#include
<kdrawutil.h>
Paints the pixels covered by a round button of the given size with TQt::color1. This function is useful in TQStyle::drawControlMask().
- Parameters
-
p The painter to use for drawing the button. x The X coordinate of the button. y The Y coordinate of the button. w The width of the button. h The height of the button. clear Whether to clear the rectangle specified by (x, y, w, h) to TQt::color0 before drawing the mask.
Definition at line 148 of file kdrawutil.cpp.
◆ kRoundMaskRegion()
|
related |
#include
<kdrawutil.h>
Sets a region to the pixels covered by a round button of the given size. You can use this to set clipping regions.
- Parameters
-
r Reference to the region to set. x The X coordinate of the button. y The Y coordinate of the button. w The width of the button. h The height of the button.
- See also
- kDrawRoundButton() and kDrawRoundMask()
Definition at line 197 of file kdrawutil.cpp.
The documentation for this class was generated from the following files: