diff options
author | Timothy Pearson <[email protected]> | 2012-10-31 14:53:25 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-10-31 14:53:25 -0500 |
commit | f16f8eb6bf27ae9dcebbcac7db0a5dbe673a27c5 (patch) | |
tree | 33493803b3ee7ed21af80bd3997e49d0beb604f1 /styles/dotnet | |
parent | c8898cf01f664fc323aa0bb46317bfb8b9dd22f5 (diff) | |
download | tdeartwork-f16f8eb6bf27ae9dcebbcac7db0a5dbe673a27c5.tar.gz tdeartwork-f16f8eb6bf27ae9dcebbcac7db0a5dbe673a27c5.zip |
Update styles for new API
Diffstat (limited to 'styles/dotnet')
-rw-r--r-- | styles/dotnet/dotnet.cpp | 31 | ||||
-rw-r--r-- | styles/dotnet/dotnet.h | 49 |
2 files changed, 56 insertions, 24 deletions
diff --git a/styles/dotnet/dotnet.cpp b/styles/dotnet/dotnet.cpp index 9ab1d92d..e73d40d8 100644 --- a/styles/dotnet/dotnet.cpp +++ b/styles/dotnet/dotnet.cpp @@ -711,7 +711,7 @@ void dotNETstyle::drawPrimitive(TQ_PrimitiveElement pe, else cflags |= Style_On; - TQRect rr = TQRect( x + 6, y + 6, 16, h - 6 ); + TQRect rr = TQRect( x + 4, y + 2, 16, h - 2 ); if (TQApplication::reverseLayout()) rr = visualRect( rr, r ); @@ -1390,7 +1390,7 @@ void dotNETstyle::drawControl(TQ_ControlElement element, if (checkable) { if (mi->isChecked()) { - drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, TQRect(x, y, checkcol, h), cg, flags); + drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, r, cg, flags, opt); } } @@ -1906,6 +1906,15 @@ int dotNETstyle::pixelMetric(PixelMetric m, TQStyleControlElementData ceData, Co return 1; } + case PM_MenuIndicatorFrameHBorder: + return 4; + case PM_MenuIndicatorFrameVBorder: + return 2; + case PM_MenuIconIndicatorFrameHBorder: + return 4; + case PM_MenuIconIndicatorFrameVBorder: + return 2; + default: return KStyle::pixelMetric(m, ceData, elementFlags, widget); } @@ -2108,4 +2117,22 @@ bool dotNETstyle::objectEventHandler( TQStyleControlElementData ceData, ControlE return false; } +int dotNETstyle::styleHint(StyleHint sh, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQStyleOption &opt, TQStyleHintReturn *returnData, const TQWidget *w) const +{ + int ret; + + switch (sh) { + case SH_MenuIndicatorColumnWidth: + { + ret = TQMAX(opt.maxIconWidth(), 26); + } + break; + default: + ret = TQCommonStyle::styleHint(sh, ceData, elementFlags, opt, returnData, w); + break; + } + + return ret; +} + // vim: noet ts=4 sw=4 diff --git a/styles/dotnet/dotnet.h b/styles/dotnet/dotnet.h index a0d91479..0236a7c1 100644 --- a/styles/dotnet/dotnet.h +++ b/styles/dotnet/dotnet.h @@ -104,36 +104,41 @@ public: const TQWidget *widget = 0 ) const; void drawComplexControlMask(TQStyle::ComplexControl c, - TQPainter *p, - const TQStyleControlElementData ceData, - const ControlElementFlags elementFlags, - const TQRect &r, - const TQStyleOption &o=TQStyleOption::Default, - const TQWidget *w = 0) const; + TQPainter *p, + const TQStyleControlElementData ceData, + const ControlElementFlags elementFlags, + const TQRect &r, + const TQStyleOption &o=TQStyleOption::Default, + const TQWidget *w = 0) const; TQSize sizeFromContents(TQStyle::ContentsType t, - TQStyleControlElementData ceData, - ControlElementFlags elementFlags, - const TQSize &s, - const TQStyleOption &o, - const TQWidget *w = 0) const; + TQStyleControlElementData ceData, + ControlElementFlags elementFlags, + const TQSize &s, + const TQStyleOption &o, + const TQWidget *w = 0) const; + + int styleHint(TQ_StyleHint, TQStyleControlElementData ceData, ControlElementFlags elementFlags, + const TQStyleOption & = TQStyleOption::Default, + TQStyleHintReturn * = 0, const TQWidget * = 0 ) const; protected: void renderButton(TQPainter *p, - const TQRect &r, - const TQColorGroup &g, - bool sunken = false, - bool corners = false) const; + const TQRect &r, + const TQColorGroup &g, + bool sunken = false, + bool corners = false) const; void renderPanel(TQPainter *p, - const TQRect &r, - const TQColorGroup &g, - bool sunken = true, - bool thick = true) const; + const TQRect &r, + const TQColorGroup &g, + bool sunken = true, + bool thick = true) const; void renderSlider(TQPainter *p, - const TQRect &r, - const TQColorGroup &g) const; + const TQRect &r, + const TQColorGroup &g) const; + bool objectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQEvent *e ); void updatePalette( TQComboBox * ); @@ -145,7 +150,7 @@ protected slots: void paletteChanged(); private: -// Disable copy constructor and = operator + // Disable copy constructor and = operator dotNETstyle( const dotNETstyle & ); dotNETstyle& operator=( const dotNETstyle & ); TQStyle *winstyle; |