Updated to QtCurve version 1.7.1.

Based on the original GPL2 QtCurve code from Craig Drummond <craig.p.drummond@gmail.com> available at https://github.com/KDE/qtcurve

Signed-off-by: TCH <tch@protonmail.com>
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/4/head
TCH 5 years ago committed by Michele Calgaro
parent eaa7b67111
commit 82fe64d550
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -19,8 +19,8 @@ set(DEBIAN_PACKAGE_DESCRIPTION "QtCurve for TQt/TDE")
set(DEBIAN_PACKAGE_SECTION "tde") set(DEBIAN_PACKAGE_SECTION "tde")
set(CPACK_SOURCE_GENERATOR "TBZ2") set(CPACK_SOURCE_GENERATOR "TBZ2")
set(CPACK_PACKAGE_VERSION_MAJOR "1") set(CPACK_PACKAGE_VERSION_MAJOR "1")
set(CPACK_PACKAGE_VERSION_MINOR "6") set(CPACK_PACKAGE_VERSION_MINOR "7")
set(CPACK_PACKAGE_VERSION_PATCH "2") set(CPACK_PACKAGE_VERSION_PATCH "1")
set(CPACK_PACKAGE_CONTACT "Craig Drummond <craig.p.drummond@gmail.com>") set(CPACK_PACKAGE_CONTACT "Craig Drummond <craig.p.drummond@gmail.com>")
set(QTCURVE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}") set(QTCURVE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}")
set(QTCURVE_VERSION_FULL "${QTCURVE_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}") set(QTCURVE_VERSION_FULL "${QTCURVE_VERSION}.${CPACK_PACKAGE_VERSION_PATCH}")

@ -1,3 +1,21 @@
1.7.1
-----
1. Remove box around arrow in listview lines - to match Gtk better.
1.7.0
-----
1. Add option to use tiled pixmap as background for windows and menus.
2. Draw line focus for items that cannot use glow focus.
3. Use popup menu gradient's border setting to determine border type of menus.
4. Add option to draw standard, raised, or joined toolbar buttons.
5. Add option to use thinner frames, focus, etc.
6. If not rounding, enable all 'square' options.
7. Store background colour setting in XProperty - so that this can be used by
QtCurve twin decoration.
8. Implement shading popup menus as per memubar settings.
9. Fix segfault when obtaining MDI colours.
10. Dont overwrite user supplied CMAKE_INSTALL_PREFIX
1.6.2 1.6.2
----- -----
1. Disable the support for 'fix parent-less dialog' option - this causes too many 1. Disable the support for 'fix parent-less dialog' option - this causes too many

@ -296,6 +296,10 @@ enum
#define SIZE_GRIP_SIZE 12 #define SIZE_GRIP_SIZE 12
#define USE_LIGHTER_POPUP_MENU (opts.lighterPopupMenuBgnd) #define USE_LIGHTER_POPUP_MENU (opts.lighterPopupMenuBgnd)
#define USE_BORDER(B) (GB_SHINE!=(B) && GB_NONE!=(B))
#define DRAW_MENU_BORDER (APPEARANCE_FLAT!=opts.menuBgndAppearance && opts.version>=MAKE_VERSION(1,7) && \
USE_BORDER(getGradient(opts.menuBgndAppearance, &opts)->border))
#define USE_GLOW_FOCUS(mouseOver) (FOCUS_GLOW==opts.focus && (MO_GLOW!=opts.coloredMouseOver || !(mouseOver))) #define USE_GLOW_FOCUS(mouseOver) (FOCUS_GLOW==opts.focus && (MO_GLOW!=opts.coloredMouseOver || !(mouseOver)))
#define USE_SHADED_MENU_BAR_COLORS (SHADE_CUSTOM==opts.shadeMenubars || SHADE_BLEND_SELECTED==opts.shadeMenubars) #define USE_SHADED_MENU_BAR_COLORS (SHADE_CUSTOM==opts.shadeMenubars || SHADE_BLEND_SELECTED==opts.shadeMenubars)
@ -550,6 +554,32 @@ typedef enum
IMG_FILE IMG_FILE
} EImageType; } EImageType;
typedef struct
{
#if defined __cplusplus
TQString file;
TQPixmap img;
#else // __cplusplus
const char *file;
GdkPixbuf *img;
#endif // __cplusplus
} TQtCPixmap;
#define BGND_IMG_ON_BORDER (IMG_FILE==opts.bgndImage.type && opts.bgndImage.onBorder)
typedef enum
{
PP_TL,
PP_TM,
PP_TR,
PP_BL,
PP_BM,
PP_BR,
PP_LM,
PP_RM,
PP_CENTRED,
} EPixPos;
typedef struct typedef struct
{ {
EImageType type; EImageType type;
@ -564,6 +594,13 @@ typedef struct
int width, height; int width, height;
} TQtCImage; } TQtCImage;
typedef enum
{
THIN_BUTTONS = 0x0001,
THIN_MENU_ITEMS = 0x0002,
THIN_FRAMES = 0x0004
} EThinFlags;
typedef enum typedef enum
{ {
SQUARE_NONE = 0x0000, SQUARE_NONE = 0x0000,
@ -713,6 +750,7 @@ typedef enum
APPEARANCE_FADE, /* Only for poupmenu items! */ APPEARANCE_FADE, /* Only for poupmenu items! */
APPEARANCE_STRIPED = APPEARANCE_FADE, /* Only for windows and menus */ APPEARANCE_STRIPED = APPEARANCE_FADE, /* Only for windows and menus */
APPEARANCE_NONE = APPEARANCE_FADE, /* Only for titlebars */ APPEARANCE_NONE = APPEARANCE_FADE, /* Only for titlebars */
APPEARANCE_FILE, /* Only for windows and menus */
APPEARANCE_LV_BEVELLED, /* To be used only with getGradient */ APPEARANCE_LV_BEVELLED, /* To be used only with getGradient */
APPEARANCE_AGUA_MOD, APPEARANCE_AGUA_MOD,
APPEARANCE_LV_AGUA, APPEARANCE_LV_AGUA,
@ -775,6 +813,13 @@ typedef enum
TB_DARK_ALL TB_DARK_ALL
} ETBarBorder; } ETBarBorder;
typedef enum
{
TBTN_STANDARD,
TBTN_RAISED,
TBTN_JOINED
} ETBarBtn;
typedef enum typedef enum
{ {
BORDER_FLAT, BORDER_FLAT,
@ -1056,7 +1101,8 @@ typedef struct
splitterHighlight, splitterHighlight,
crSize, crSize,
gbFactor, gbFactor,
gbLabel; gbLabel,
thin;
ERound round; ERound round;
bool embolden, bool embolden,
highlightTab, highlightTab,
@ -1088,8 +1134,8 @@ typedef struct
mapKdeIcons, mapKdeIcons,
#if defined CONFIG_DIALOG || ( defined QT4_OR_ABOVE) || !defined __cplusplus #if defined CONFIG_DIALOG || ( defined QT4_OR_ABOVE) || !defined __cplusplus
gtkButtonOrder, gtkButtonOrder,
fadeLines,
#endif #endif
fadeLines,
reorderGtkButtons, reorderGtkButtons,
borderMenuitems, borderMenuitems,
colorMenubarMouseOver, colorMenubarMouseOver,
@ -1154,6 +1200,7 @@ typedef struct
ESliderStyle sliderStyle; ESliderStyle sliderStyle;
EMouseOver coloredMouseOver; EMouseOver coloredMouseOver;
ETBarBorder toolbarBorders; ETBarBorder toolbarBorders;
ETBarBtn tbarBtns;
EDefBtnIndicator defBtnIndicator; EDefBtnIndicator defBtnIndicator;
ELine sliderThumbs, ELine sliderThumbs,
handles, handles,
@ -1221,6 +1268,8 @@ typedef struct
#else #else
Gradient *customGradient[NUM_CUSTOM_GRAD]; Gradient *customGradient[NUM_CUSTOM_GRAD];
#endif #endif
TQtCPixmap bgndPixmap;
TQtCPixmap menuBgndPixmap;
TQtCImage bgndImage, TQtCImage bgndImage,
menuBgndImage; menuBgndImage;
#if !defined __cplusplus || ( defined QT4_OR_ABOVE) #if !defined __cplusplus || ( defined QT4_OR_ABOVE)

File diff suppressed because it is too large Load Diff

@ -154,8 +154,11 @@ void setBgndProp(TQWidget *widget, unsigned short app)
if(w) if(w)
{ {
static const Atom constAtom = XInternAtom(tqt_xdisplay(), BGND_ATOM, False); static const Atom constAtom = XInternAtom(tqt_xdisplay(), BGND_ATOM, False);
unsigned long prop=((APPEARANCE_STRIPED==app || APPEARANCE_FILE==app ? app : APPEARANCE_FLAT)&0xFF) |
(widget->palette().active().background().rgb()&0x00FFFFFF)<<8;
XChangeProperty(tqt_xdisplay(), w->parentWidget() ? w->parentWidget()->winId() : w->winId(), XChangeProperty(tqt_xdisplay(), w->parentWidget() ? w->parentWidget()->winId() : w->winId(),
constAtom, XA_CARDINAL, 16, PropModeReplace, (unsigned char *)&app, 1); constAtom, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&prop, 1);
} }
} }
@ -182,6 +185,39 @@ static void triggerWMMove(const TQWidget *w, const TQPoint &p)
#define MO_ARROW_X(FLAGS, COL) (MO_NONE!=opts.coloredMouseOver && FLAGS&Style_MouseOver && FLAGS&Style_Enabled ? itsMouseOverCols[ARROW_MO_SHADE] : COL) #define MO_ARROW_X(FLAGS, COL) (MO_NONE!=opts.coloredMouseOver && FLAGS&Style_MouseOver && FLAGS&Style_Enabled ? itsMouseOverCols[ARROW_MO_SHADE] : COL)
#define MO_ARROW(COL) MO_ARROW_X(flags, COL) #define MO_ARROW(COL) MO_ARROW_X(flags, COL)
static void adjustToolbarButtons(const TQWidget *widget, const TQToolBar *toolbar, int &leftAdjust, int &topAdjust,
int &rightAdjust, int &bottomAdjust, int &round)
{
const int constAdjust=4;
const int d = 1;
TQRect geo(widget->geometry());
if (TQt::Horizontal==toolbar->orientation())
{
bool haveLeft=::tqqt_cast<TQToolButton*>(toolbar->childAt(geo.x()-d, geo.y())),
haveRight=::tqqt_cast<TQToolButton*>(toolbar->childAt(geo.right()+d, geo.y()));
if(haveLeft && haveRight)
leftAdjust=-constAdjust, rightAdjust=constAdjust, round=ROUNDED_NONE;
else if(haveLeft)
leftAdjust=-constAdjust, round=ROUNDED_RIGHT;
else if(haveRight)
rightAdjust=constAdjust, round=ROUNDED_LEFT;
}
else
{
bool haveTop=::tqqt_cast<TQToolButton*>(toolbar->childAt(geo.x(), geo.y()-d)),
haveBot=::tqqt_cast<TQToolButton*>(toolbar->childAt(geo.x(), geo.bottom()+d));
if(haveTop && haveBot)
topAdjust=-constAdjust, bottomAdjust=constAdjust, round=ROUNDED_NONE;
else if(haveTop)
topAdjust=-constAdjust, round=ROUNDED_BOTTOM;
else if(haveBot)
bottomAdjust=constAdjust, round=ROUNDED_TOP;
}
}
static const int constMenuPixmapWidth=22; static const int constMenuPixmapWidth=22;
static bool useTQt3Settings() static bool useTQt3Settings()
@ -1415,6 +1451,35 @@ void QtCurveStyle::polish(TQPalette &pal)
if(APPEARANCE_STRIPED==opts.bgndAppearance) if(APPEARANCE_STRIPED==opts.bgndAppearance)
pal.setBrush(TQColorGroup::Background, TQBrush(pal.active().background(), *createStripePixmap(pal.active().background(), true))); pal.setBrush(TQColorGroup::Background, TQBrush(pal.active().background(), *createStripePixmap(pal.active().background(), true)));
else if(APPEARANCE_FILE==opts.bgndAppearance)
{
TQPixmap pix(opts.bgndPixmap.img.width(), opts.bgndPixmap.img.height());
TQPainter p(&pix);
WindowBorders borders=qtcGetWindowBorderSize();
int xadjust=borders.sides>0 && borders.sides!=opts.bgndPixmap.img.width()
? borders.sides>opts.bgndPixmap.img.width()
? borders.sides%opts.bgndPixmap.img.width()
: borders.sides
:0,
yadjust=borders.titleHeight>0 && borders.titleHeight!=opts.bgndPixmap.img.height()
? borders.titleHeight>opts.bgndPixmap.img.height()
? borders.titleHeight%opts.bgndPixmap.img.height()
: borders.titleHeight
:0;
p.fillRect(0, 0, opts.bgndPixmap.img.width(), opts.bgndPixmap.img.height(), pal.active().background());
p.drawPixmap(-xadjust, -yadjust, opts.bgndPixmap.img);
if(xadjust>0)
p.drawPixmap(opts.bgndPixmap.img.width()-xadjust, -yadjust, opts.bgndPixmap.img);
if(yadjust>0)
p.drawPixmap(-xadjust, opts.bgndPixmap.img.height()-yadjust, opts.bgndPixmap.img);
if(xadjust>0 && yadjust>0)
p.drawPixmap(opts.bgndPixmap.img.width()-xadjust, opts.bgndPixmap.img.height()-yadjust, opts.bgndPixmap.img);
p.end();
pal.setBrush(TQColorGroup::Background, TQBrush(pal.active().background(), pix));
}
} }
static TQColor disable(const TQColor &col, const TQColor &bgnd) static TQColor disable(const TQColor &col, const TQColor &bgnd)
@ -1475,8 +1540,11 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
if(isWindowDragWidget(TQT_TQOBJECT(widget))) if(isWindowDragWidget(TQT_TQOBJECT(widget)))
installObjectEventHandler(ceData, elementFlags, ptr, this); installObjectEventHandler(ceData, elementFlags, ptr, this);
if(APPEARANCE_STRIPED==opts.bgndAppearance && (::tqqt_cast<TQDialog *>(widget) || ::tqqt_cast<TQMainWindow *>(widget))) if(::tqqt_cast<TQDialog *>(widget) || ::tqqt_cast<TQMainWindow *>(widget))
setBgndProp(widget, APPEARANCE_STRIPED); {
setBgndProp(widget, opts.bgndAppearance);
installObjectEventHandler(ceData, elementFlags, ptr, this); // To trap palette change
}
if(widget->parentWidget() && ::tqqt_cast<TQScrollView *>(widget) && ::tqqt_cast<TQComboBox *>(widget->parentWidget())) if(widget->parentWidget() && ::tqqt_cast<TQScrollView *>(widget) && ::tqqt_cast<TQComboBox *>(widget->parentWidget()))
{ {
@ -1543,8 +1611,7 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
(widget->parentWidget() && ::tqqt_cast<const TQListBox *>(widget) && (widget->parentWidget() && ::tqqt_cast<const TQListBox *>(widget) &&
::tqqt_cast<const TQComboBox *>(widget->parentWidget())))) ::tqqt_cast<const TQComboBox *>(widget->parentWidget()))))
((TQFrame *)widget)->setLineWidth(0); ((TQFrame *)widget)->setLineWidth(0);
else if ((USE_LIGHTER_POPUP_MENU || !IS_FLAT_BGND(opts.menuBgndAppearance)) && !opts.borderMenuitems && else if (!DRAW_MENU_BORDER && !opts.borderMenuitems && widget && ::tqqt_cast<const TQPopupMenu *>(widget))
widget && ::tqqt_cast<const TQPopupMenu *>(widget))
((TQFrame *)widget)->setLineWidth(1); ((TQFrame *)widget)->setLineWidth(1);
if (::tqqt_cast<TQRadioButton *>(widget) || ::tqqt_cast<TQCheckBox *>(widget)) if (::tqqt_cast<TQRadioButton *>(widget) || ::tqqt_cast<TQCheckBox *>(widget))
@ -1619,39 +1686,7 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
installObjectEventHandler(ceData, elementFlags, ptr, this); installObjectEventHandler(ceData, elementFlags, ptr, this);
if(BLEND_TITLEBAR || opts.windowBorder&WINDOW_BORDER_USE_MENUBAR_COLOR_FOR_TITLEBAR) if(BLEND_TITLEBAR || opts.windowBorder&WINDOW_BORDER_USE_MENUBAR_COLOR_FOR_TITLEBAR)
emitMenuSize(widget, ceData.rect.height()); emitMenuSize(widget, ceData.rect.height());
if(SHADE_WINDOW_BORDER==opts.shadeMenubars) setMenuTextColors(widget, true);
{
TQPalette pal(ceData.palette);
TQColorGroup act(pal.active());
TQColorGroup inact(pal.inactive());
getMdiColors(act, true);
act.setColor(TQColorGroup::Foreground, itsActiveMdiTextColor);
inact.setColor(TQColorGroup::Foreground, opts.shadeMenubarOnlyWhenActive ? itsMdiTextColor : itsActiveMdiTextColor);
pal.setInactive(inact);
pal.setActive(act);
widget->setPalette(pal);
}
else if(opts.customMenuTextColor || SHADE_BLEND_SELECTED==opts.shadeMenubars || SHADE_SELECTED==opts.shadeMenubars ||
(SHADE_CUSTOM==opts.shadeMenubars && TOO_DARK(itsMenubarCols[ORIGINAL_SHADE])))
{
TQPalette pal(ceData.palette);
TQColorGroup act(pal.active());
act.setColor(TQColorGroup::Foreground, opts.customMenuTextColor
? opts.customMenuNormTextColor
: TQApplication::palette().active().highlightedText());
if(!opts.shadeMenubarOnlyWhenActive)
{
TQColorGroup inact(pal.inactive());
inact.setColor(TQColorGroup::Foreground, act.color(TQColorGroup::Foreground));
pal.setInactive(inact);
}
pal.setActive(act);
widget->setPalette(pal);
}
} }
else if(::tqqt_cast<TQToolBar *>(widget)) else if(::tqqt_cast<TQToolBar *>(widget))
{ {
@ -1659,7 +1694,10 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
widget->setBackgroundMode(PaletteBackground); widget->setBackgroundMode(PaletteBackground);
} }
else if(::tqqt_cast<TQPopupMenu *>(widget)) else if(::tqqt_cast<TQPopupMenu *>(widget))
{
widget->setBackgroundMode(NoBackground); // PaletteBackground); widget->setBackgroundMode(NoBackground); // PaletteBackground);
setMenuTextColors(widget, true);
}
else if (ceData.widgetObjectTypes.contains("TDEToolBarSeparator") || else if (ceData.widgetObjectTypes.contains("TDEToolBarSeparator") ||
(ceData.widgetObjectTypes.contains("TDEListViewSearchLineWidget") && (ceData.widgetObjectTypes.contains("TDEListViewSearchLineWidget") &&
widget->parent() && ::tqqt_cast<TQToolBar *>(widget->parent()))) widget->parent() && ::tqqt_cast<TQToolBar *>(widget->parent())))
@ -1833,7 +1871,7 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
widget->setPalette(pal); widget->setPalette(pal);
} }
if(APPEARANCE_STRIPED==opts.bgndAppearance) if(APPEARANCE_STRIPED==opts.bgndAppearance || APPEARANCE_FILE==opts.bgndAppearance)
widget->setBackgroundOrigin(TQWidget::WindowOrigin); widget->setBackgroundOrigin(TQWidget::WindowOrigin);
} }
@ -2092,12 +2130,17 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
{ {
TQWidget *widget=(TQWidget*)object; TQWidget *widget=(TQWidget*)object;
TQPainter painter(widget); TQPainter painter(widget);
TQColor col(USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol : ceData.palette.active().background()); TQColor col(popupMenuCol(widget->palette().active()));
if(APPEARANCE_STRIPED==opts.menuBgndAppearance) if(APPEARANCE_STRIPED==opts.menuBgndAppearance)
{ {
painter.drawTiledPixmap(ceData.rect, *createStripePixmap(col, false)); painter.drawTiledPixmap(ceData.rect, *createStripePixmap(col, false));
} }
else if(APPEARANCE_FILE==opts.menuBgndAppearance)
{
painter.fillRect(widget->rect(), col);
painter.drawTiledPixmap(widget->rect(), opts.menuBgndPixmap.img);
}
else else
{ {
drawBevelGradientReal(col, &painter, ceData.rect, GT_HORIZ==opts.menuBgndGrad, false, drawBevelGradientReal(col, &painter, ceData.rect, GT_HORIZ==opts.menuBgndGrad, false,
@ -2320,7 +2363,8 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
default: default:
break; break;
} }
if(TQEvent::PaletteChange==event->type() && (::tqqt_cast<TQDialog *>(object) || ::tqqt_cast<TQMainWindow *>(object)))
setBgndProp(static_cast<TQWidget *>(object), opts.bgndAppearance);
#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT #ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
if(opts.fixParentlessDialogs && ::tqqt_cast<TQDialog *>(object)) if(opts.fixParentlessDialogs && ::tqqt_cast<TQDialog *>(object))
{ {
@ -2684,7 +2728,7 @@ void QtCurveStyle::drawLightBevel(const TQColor &bgnd, TQPainter *p, const TQRec
} }
if(doEtch || glowFocus) { if(doEtch || glowFocus) {
if( (!sunken || sunkenToggleMo) && if( (!sunken || sunkenToggleMo) && !(opts.thin&THIN_FRAMES) &&
((WIDGET_OTHER!=w && WIDGET_SLIDER_TROUGH!=w && MO_GLOW==opts.coloredMouseOver && flags&Style_MouseOver) || ((WIDGET_OTHER!=w && WIDGET_SLIDER_TROUGH!=w && MO_GLOW==opts.coloredMouseOver && flags&Style_MouseOver) ||
glowFocus || glowFocus ||
(WIDGET_DEF_BUTTON==w && IND_GLOW==opts.defBtnIndicator)/* || (WIDGET_DEF_BUTTON==w && IND_GLOW==opts.defBtnIndicator)/* ||
@ -2793,6 +2837,7 @@ void QtCurveStyle::drawBorder(const TQColor &bgnd, TQPainter *p, const TQRect &r
if(WIDGET_TAB_BOT==w || WIDGET_TAB_TOP==w) if(WIDGET_TAB_BOT==w || WIDGET_TAB_TOP==w)
cols=itsBackgroundCols; cols=itsBackgroundCols;
if(!(opts.thin&THIN_FRAMES))
switch(borderProfile) switch(borderProfile)
{ {
case BORDER_FLAT: case BORDER_FLAT:
@ -3936,27 +3981,34 @@ void QtCurveStyle::drawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const TQS
} }
case PE_PanelPopup: case PE_PanelPopup:
{ {
const TQColor *use(backgroundColors(cg)); const TQColor *use(popupMenuCols(cg));
EGradientBorder border=getGradient(opts.menuBgndAppearance, &opts)->border;
p->setPen(use[STD_BORDER]); p->setPen(use[STD_BORDER]);
p->setBrush(NoBrush); p->setBrush(NoBrush);
p->drawRect(r); p->drawRect(r);
if(!IS_FLAT_BGND(opts.menuBgndAppearance))
; if(USE_BORDER(border) && APPEARANCE_FLAT!=opts.menuBgndAppearance)
else if(USE_LIGHTER_POPUP_MENU)
{ {
p->setPen(/*USE_LIGHTER_POPUP_MENU ? */itsLighterPopupMenuBgndCol/* : cg.background()*/); p->setPen(use[0]);
if(GB_LIGHT==border)
p->drawRect(TQRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2)); p->drawRect(TQRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2));
}
else else
{ {
p->setPen(use[0]); if(GB_3D==border)
p->setPen(popupMenuCol(cg));
p->drawLine(r.x()+1, r.y()+1, r.x()+r.width()-2, r.y()+1); p->drawLine(r.x()+1, r.y()+1, r.x()+r.width()-2, r.y()+1);
p->drawLine(r.x()+1, r.y()+1, r.x()+1, r.y()+r.height()-2); p->drawLine(r.x()+1, r.y()+1, r.x()+1, r.y()+r.height()-2);
p->setPen(use[FRAME_DARK_SHADOW]); p->setPen(use[FRAME_DARK_SHADOW]);
p->drawLine(r.x()+1, r.y()+r.height()-2, r.x()+r.width()-2, r.y()+r.height()-2); p->drawLine(r.x()+1, r.y()+r.height()-2, r.x()+r.width()-2, r.y()+r.height()-2);
p->drawLine(r.x()+r.width()-2, r.y()+1, r.x()+r.width()-2, r.y()+r.height()-2); p->drawLine(r.x()+r.width()-2, r.y()+1, r.x()+r.width()-2, r.y()+r.height()-2);
} }
}
else if(IS_FLAT_BGND(opts.menuBgndAppearance))
{
p->setPen(/*USE_LIGHTER_POPUP_MENU ? */popupMenuCol(cg)/* : cg.background()*/);
p->drawRect(TQRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2));
}
break; break;
} }
case PE_TabBarBase: case PE_TabBarBase:
@ -4249,7 +4301,7 @@ void QtCurveStyle::drawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const TQS
(dynamic_cast<const TQButton *>(widget) || dynamic_cast<const TQComboBox *>(widget))) (dynamic_cast<const TQButton *>(widget) || dynamic_cast<const TQComboBox *>(widget)))
return; return;
if(FOCUS_LINE==opts.focus) if(FOCUS_LINE==opts.focus || FOCUS_GLOW==opts.focus)
{ {
p->setPen(view && flags&Style_Selected p->setPen(view && flags&Style_Selected
? cg.highlightedText() ? cg.highlightedText()
@ -4488,7 +4540,7 @@ void QtCurveStyle::drawTDEStylePrimitive(TDEStylePrimitive kpe, TQPainter *p, co
{ {
case KPE_ToolBarHandle: case KPE_ToolBarHandle:
{ {
if(APPEARANCE_STRIPED!=opts.bgndAppearance) if(APPEARANCE_STRIPED!=opts.bgndAppearance && APPEARANCE_FILE!=opts.bgndAppearance)
{ {
TQRect r2(r); TQRect r2(r);
r2.addCoords(-1, -1, 2, 2); r2.addCoords(-1, -1, 2, 2);
@ -4580,7 +4632,7 @@ void QtCurveStyle::drawTDEStylePrimitive(TDEStylePrimitive kpe, TQPainter *p, co
{ {
TQRect ar(r.x()+((r.width()-(LV_SIZE+4))>>1), r.y()+((r.height()-(LV_SIZE+4))>>1), LV_SIZE+4, TQRect ar(r.x()+((r.width()-(LV_SIZE+4))>>1), r.y()+((r.height()-(LV_SIZE+4))>>1), LV_SIZE+4,
LV_SIZE+4); LV_SIZE+4);
#if 0
if(LV_OLD==opts.lvLines) if(LV_OLD==opts.lvLines)
{ {
int lo(ROUNDED ? 2 : 0); int lo(ROUNDED ? 2 : 0);
@ -4607,7 +4659,7 @@ void QtCurveStyle::drawTDEStylePrimitive(TDEStylePrimitive kpe, TQPainter *p, co
ar.y()+ar.height()-2); ar.y()+ar.height()-2);
} }
} }
#endif
::drawArrow(p, ar, flags&Style_Enabled ? cg.mid() : cg.text(), flags&Style_On // Collapsed = On ::drawArrow(p, ar, flags&Style_Enabled ? cg.mid() : cg.text(), flags&Style_On // Collapsed = On
? TQApplication::reverseLayout() ? TQApplication::reverseLayout()
? PE_ArrowLeft ? PE_ArrowLeft
@ -4660,7 +4712,9 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
itsHover(itsHoverTab && itsHoverTab->isEnabled() && data.tab()==itsHoverTab && itsHover(itsHoverTab && itsHoverTab->isEnabled() && data.tab()==itsHoverTab &&
!(flags&Style_Selected) && !(flags&Style_Selected) &&
ceData.tabBarData.currentTabIndex!=tabIndex), ceData.tabBarData.currentTabIndex!=tabIndex),
glowMo(!active && itsHover && opts.coloredMouseOver && TAB_MO_GLOW==opts.tabMouseOver); glowMo(!active && itsHover && opts.coloredMouseOver && TAB_MO_GLOW==opts.tabMouseOver),
thin(opts.thin&THIN_FRAMES),
drawOuterGlow(glowMo && !thin);
int sizeAdjust(!active && TAB_MO_GLOW==opts.tabMouseOver ? 1 : 0); int sizeAdjust(!active && TAB_MO_GLOW==opts.tabMouseOver ? 1 : 0);
const TQColor &fill(getTabFill(flags&Style_Selected, itsHover, itsBackgroundCols)); const TQColor &fill(getTabFill(flags&Style_Selected, itsHover, itsBackgroundCols));
EBorder borderProfile(active || opts.borderInactiveTab EBorder borderProfile(active || opts.borderInactiveTab
@ -4742,7 +4796,7 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
? (top ? ROUNDED_TOPRIGHT : ROUNDED_BOTTOMRIGHT) ? (top ? ROUNDED_TOPRIGHT : ROUNDED_BOTTOMRIGHT)
: ROUNDED_NONE, glowMo ? itsMouseOverCols : 0L, top ? WIDGET_TAB_TOP : WIDGET_TAB_BOT, true, : ROUNDED_NONE, glowMo ? itsMouseOverCols : 0L, top ? WIDGET_TAB_TOP : WIDGET_TAB_BOT, true,
borderProfile, false); borderProfile, false);
if(glowMo) if(drawOuterGlow)
{ {
glowTr.addCoords(-1, -1, 1, 1); glowTr.addCoords(-1, -1, 1, 1);
drawGlow(p, glowTr, cg, top ? WIDGET_TAB_TOP : WIDGET_TAB_BOT); drawGlow(p, glowTr, cg, top ? WIDGET_TAB_TOP : WIDGET_TAB_BOT);
@ -4756,16 +4810,22 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
p->setPen(itsBackgroundCols[STD_BORDER]); p->setPen(itsBackgroundCols[STD_BORDER]);
p->drawPoint(r.x(), r.y()+r.height()-2); p->drawPoint(r.x(), r.y()+r.height()-2);
p->drawPoint(r.x()+r.width()-1, r.y()+r.height()-2); p->drawPoint(r.x()+r.width()-1, r.y()+r.height()-2);
if(!thin)
{
p->setPen(itsBackgroundCols[0]); p->setPen(itsBackgroundCols[0]);
p->drawLine(r.x()+1, r.y()+r.height()-3, r.x()+1, r.y()+r.height()-1); p->drawLine(r.x()+1, r.y()+r.height()-3, r.x()+1, r.y()+r.height()-1);
//p->drawPoint(r.x()+r.width()-2, r.y()+r.height()-1); //p->drawPoint(r.x()+r.width()-2, r.y()+r.height()-1);
p->setPen(itsBackgroundCols[opts.borderTab ? 0 : FRAME_DARK_SHADOW]); p->setPen(itsBackgroundCols[opts.borderTab ? 0 : FRAME_DARK_SHADOW]);
p->drawPoint(r.x()+r.width()-2, r.y()+r.height()-2); p->drawPoint(r.x()+r.width()-2, r.y()+r.height()-2);
} }
}
else else
{
if(!thin)
{ {
p->setPen(itsBackgroundCols[0]); p->setPen(itsBackgroundCols[0]);
p->drawLine(r.x(), r.y()+r.height()-1, r.x()+r.width()-1, r.y()+r.height()-1); p->drawLine(r.x(), r.y()+r.height()-1, r.x()+r.width()-1, r.y()+r.height()-1);
}
p->setPen(itsBackgroundCols[STD_BORDER]); p->setPen(itsBackgroundCols[STD_BORDER]);
p->drawLine(r.x(), r.y()+r.height()-2, r.x()+r.width()-1, r.y()+r.height()-2); p->drawLine(r.x(), r.y()+r.height()-2, r.x()+r.width()-1, r.y()+r.height()-2);
@ -4784,7 +4844,7 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
p->setPen(itsBackgroundCols[!active && TAB_MO_GLOW==opts.tabMouseOver && opts.round>ROUND_SLIGHT && !(opts.square&SQUARE_TAB_FRAME) p->setPen(itsBackgroundCols[!active && TAB_MO_GLOW==opts.tabMouseOver && opts.round>ROUND_SLIGHT && !(opts.square&SQUARE_TAB_FRAME)
? ORIGINAL_SHADE : STD_BORDER]); ? ORIGINAL_SHADE : STD_BORDER]);
p->drawLine(x, r.y()+r.height()-1, x, r.height()-2); p->drawLine(x, r.y()+r.height()-1, x, r.height()-2);
if(active) if(active && !thin)
{ {
p->setPen(itsBackgroundCols[reverse ? dark : 0]); p->setPen(itsBackgroundCols[reverse ? dark : 0]);
p->drawLine(x2, r.y()+r.height()-1, x2, r.y()+r.height()-2); p->drawLine(x2, r.y()+r.height()-1, x2, r.y()+r.height()-2);
@ -4823,16 +4883,22 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
p->setPen(itsBackgroundCols[STD_BORDER]); p->setPen(itsBackgroundCols[STD_BORDER]);
p->drawPoint(r.x(), r.y()+1); p->drawPoint(r.x(), r.y()+1);
p->drawPoint(r.x()+r.width()-1, r.y()+1); p->drawPoint(r.x()+r.width()-1, r.y()+1);
if(!thin)
{
p->setPen(itsBackgroundCols[0]); p->setPen(itsBackgroundCols[0]);
p->drawLine(r.x()+1, r.y()+2, r.x()+1, r.y()); p->drawLine(r.x()+1, r.y()+2, r.x()+1, r.y());
p->setPen(itsBackgroundCols[opts.borderTab ? 0 : FRAME_DARK_SHADOW]); p->setPen(itsBackgroundCols[opts.borderTab ? 0 : FRAME_DARK_SHADOW]);
p->drawLine(r.x()+r.width()-2, r.y()+1, r.x()+r.width()-2, r.y()); p->drawLine(r.x()+r.width()-2, r.y()+1, r.x()+r.width()-2, r.y());
p->drawPoint(r.x()+r.width()-1, r.y()); p->drawPoint(r.x()+r.width()-1, r.y());
} }
}
else else
{
if(!thin)
{ {
p->setPen(itsBackgroundCols[opts.borderTab ? 0 : dark]); p->setPen(itsBackgroundCols[opts.borderTab ? 0 : dark]);
p->drawLine(r.x(), r.y(), r.x()+r.width()-1, r.y()); p->drawLine(r.x(), r.y(), r.x()+r.width()-1, r.y());
}
p->setPen(itsBackgroundCols[STD_BORDER]); p->setPen(itsBackgroundCols[STD_BORDER]);
p->drawLine(r.x(), r.y()+1, r.x()+r.width()-1, r.y()+1); p->drawLine(r.x(), r.y()+1, r.x()+r.width()-1, r.y()+1);
@ -5055,6 +5121,7 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
if(data.isDefault()) if(data.isDefault())
break; break;
//const TQPopupMenu *popupmenu((const QPopupMenu *)widget);
TQMenuItem *mi(data.menuItem()); TQMenuItem *mi(data.menuItem());
int tab(data.tabWidth()), int tab(data.tabWidth()),
maxpmw(data.maxIconWidth()), maxpmw(data.maxIconWidth()),
@ -5069,20 +5136,17 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
else else
{ {
if(IS_FLAT_BGND(opts.menuBgndAppearance)) if(IS_FLAT_BGND(opts.menuBgndAppearance))
p->fillRect(r, USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol p->fillRect(r, popupMenuCol(cg));
: itsBackgroundCols[ORIGINAL_SHADE]);
if(opts.menuStripe) if(opts.menuStripe)
drawBevelGradient(menuStripeCol(), p, drawBevelGradient(menuStripeCol(cg), p,
TQRect(reverse ? r.right()-maxpmw : r.x(), TQRect(reverse ? r.right()-maxpmw : r.x(),
r.y(), maxpmw, r.height()), false, r.y(), maxpmw, r.height()), false,
false, opts.menuStripeAppearance, WIDGET_OTHER); false, opts.menuStripeAppearance, WIDGET_OTHER);
} }
if((flags&Style_Active) && (flags&Style_Enabled)) if((flags&Style_Active) && (flags&Style_Enabled))
drawMenuItem(p, r, flags, cg, false, ROUNDED_ALL, drawMenuItem(p, r, flags, cg, false, ROUNDED_ALL, popupMenuCol(cg),
USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol
: itsBackgroundCols[ORIGINAL_SHADE],
opts.useHighlightForMenu ? itsHighlightCols : itsBackgroundCols); opts.useHighlightForMenu ? itsHighlightCols : itsBackgroundCols);
if(!mi) if(!mi)
@ -5091,7 +5155,7 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
if(mi->isSeparator()) if(mi->isSeparator())
{ {
y=r.y()+(r.height()>>1); y=r.y()+(r.height()>>1);
p->setPen(itsBackgroundCols[MENU_SEP_SHADE]); p->setPen(popupMenuCols(cg)[MENU_SEP_SHADE]);
p->drawLine(r.x()+3+(!reverse && opts.menuStripe ? maxpmw : 0), y, p->drawLine(r.x()+3+(!reverse && opts.menuStripe ? maxpmw : 0), y,
r.x()+r.width()-4-(reverse && opts.menuStripe ? maxpmw : 0), y); r.x()+r.width()-4-(reverse && opts.menuStripe ? maxpmw : 0), y);
// p->setPen(itsBackgroundCols[0]); // p->setPen(itsBackgroundCols[0]);
@ -5672,6 +5736,24 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, cons
!qstrcmp(ceData.parentWidgetData.name.ascii(), "qt_maxcontrols")) !qstrcmp(ceData.parentWidgetData.name.ascii(), "qt_maxcontrols"))
onControlButtons = true; onControlButtons = true;
int round(ROUNDED_ALL), leftAdjust(0), topAdjust(0), rightAdjust(0), bottomAdjust(0);
bool horizTBar(true),
raised(!onControlButtons && (TBTN_RAISED==opts.tbarBtns || TBTN_JOINED==opts.tbarBtns));
if(raised)
{
if(tb)
{
if(TBTN_JOINED==opts.tbarBtns)
{
horizTBar=Qt::Horizontal==tb->orientation();
adjustToolbarButtons(widget, tb, leftAdjust, topAdjust, rightAdjust, bottomAdjust, round);
}
}
else
raised=false;
}
if(active & SC_ToolButton) if(active & SC_ToolButton)
bflags |=Style_Down; bflags |=Style_Down;
if(active & SC_ToolButtonMenu) if(active & SC_ToolButtonMenu)
@ -5688,10 +5770,9 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, cons
// If we're pressed, on, or raised... // If we're pressed, on, or raised...
#if defined TQTC_TQT_ONLY || !defined TDE_VERSION #if defined TQTC_TQT_ONLY || !defined TDE_VERSION
if(bflags &(Style_Down | Style_On | Style_Raised) || onControlButtons) if(bflags &(Style_Down | Style_On | Style_Raised) || onControlButtons || raised)
#else #else
if(bflags &(Style_Down | Style_On | Style_Raised | Style_MouseOver) || if(bflags &(Style_Down | Style_On | Style_Raised | Style_MouseOver) || onControlButtons || raised)
onControlButtons)
#endif #endif
{ {
//Make sure the standalone toolbuttons have a gradient in the right direction //Make sure the standalone toolbuttons have a gradient in the right direction
@ -5707,10 +5788,35 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, cons
} }
} }
if(raised && TBTN_JOINED==opts.tbarBtns && !horizTBar)
bflags &= ~Style_Horizontal;
if(elementFlags & CEF_BiState) if(elementFlags & CEF_BiState)
bflags|=TOGGLE_BUTTON; bflags|=TOGGLE_BUTTON;
drawPrimitive(PE_ButtonTool, p, ceData, elementFlags, button, cg, bflags, data); const TQColor *use(buttonColors(cg));
TQRect btnRect(r);
btnRect.addCoords(leftAdjust, topAdjust, rightAdjust, bottomAdjust);
drawLightBevel(cg.background(), p, btnRect, cg, bflags, round, getFill(bflags, use), use, true, true, WIDGET_STD_BUTTON);
if(raised && TBTN_JOINED==opts.tbarBtns)
{
const int constSpace=opts.fadeLines ? 7 : 4;
p->setPen(use[0]);
if(leftAdjust)
p->drawLine(r.x(), r.y()+constSpace, r.x(), r.height()-(constSpace+1));
if(topAdjust)
p->drawLine(r.x()+constSpace, r.y(), r.width()-(constSpace+1), r.y());
p->setPen(use[STD_BORDER]);
if(rightAdjust)
p->drawLine(r.x()+r.width()-1, r.y()+constSpace, r.x()+r.width()-1, r.height()-(constSpace+1));
if(bottomAdjust)
p->drawLine(r.x()+constSpace, r.y()+r.height()-1, r.width()-(constSpace+1), r.y()+r.height()-1);
}
//drawPrimitive(PE_ButtonTool, p, button, cg, bflags, data);
} }
// Check whether to draw a background pixmap // Check whether to draw a background pixmap
@ -5956,7 +6062,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, cons
{ {
bool glowFocus(USE_GLOW_FOCUS(flags&Style_MouseOver) && flags&Style_HasFocus && flags&Style_Enabled); bool glowFocus(USE_GLOW_FOCUS(flags&Style_MouseOver) && flags&Style_HasFocus && flags&Style_Enabled);
if(!sunken && !editable && if(!sunken && !editable && !(opts.thin&THIN_FRAMES) &&
((MO_GLOW==opts.coloredMouseOver && flags&Style_MouseOver)/* || ((MO_GLOW==opts.coloredMouseOver && flags&Style_MouseOver)/* ||
(FOCUS_FULL==opts.focus && flags&Style_HasFocus)*/ || glowFocus)) (FOCUS_FULL==opts.focus && flags&Style_HasFocus)*/ || glowFocus))
drawGlow(p, widget ? TQT_TQRECT_OBJECT(ceData.rect) : r, cg, WIDGET_COMBO, glowFocus ? itsFocusCols : NULL); drawGlow(p, widget ? TQT_TQRECT_OBJECT(ceData.rect) : r, cg, WIDGET_COMBO, glowFocus ? itsFocusCols : NULL);
@ -5973,6 +6079,7 @@ void QtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, cons
{ {
itsFormMode = isFormWidget(widget); itsFormMode = isFormWidget(widget);
//const TQSpinWidget *spinwidget((const QSpinWidget *)widget);
TQRect frame(querySubControlMetrics(CC_SpinWidget, ceData, elementFlags, SC_SpinWidgetFrame, TQRect frame(querySubControlMetrics(CC_SpinWidget, ceData, elementFlags, SC_SpinWidgetFrame,
data, widget)), data, widget)),
up(ceData.spinWidgetData.upRect), up(ceData.spinWidgetData.upRect),
@ -6909,22 +7016,21 @@ TQSize QtCurveStyle::sizeFromContents(ContentsType contents, const TQStyleContro
w=constMinW; w=constMinW;
} }
return TQSize(w, contentsSize.height() + margin+(DO_EFFECT && !isFormWidget(widget) && !opts.thinnerBtns return TQSize(w, contentsSize.height() + margin+(DO_EFFECT && !isFormWidget(widget) && !(opts.thin&THIN_BUTTONS) ? 6 : 4));
? 6 : 4));
} }
break; break;
} }
case CT_ComboBox: case CT_ComboBox:
{ {
TQSize sz(BASE_STYLE::sizeFromContents(contents, ceData, elementFlags, contentsSize, data, widget)); TQSize sz(BASE_STYLE::sizeFromContents(contents, ceData, elementFlags, contentsSize, data, widget));
return TQSize(sz.width(), sz.height()+(DO_EFFECT && !isFormWidget(widget) && !opts.thinnerBtns ? 4 : 2)); return TQSize(sz.width(), sz.height()+(DO_EFFECT && !isFormWidget(widget) && !(opts.thin&THIN_BUTTONS) ? 4 : 2));
} }
case CT_PopupMenuItem: case CT_PopupMenuItem:
{ {
if (!widget || data.isDefault()) if (!widget || data.isDefault())
break; break;
const int constMinH(opts.thinnerMenuItems ? 25 : 27); const int constMinH((opts.thin&THIN_MENU_ITEMS) ? 25 : 27);
TQMenuItem *mi(data.menuItem()); TQMenuItem *mi(data.menuItem());
int maxpmw(data.maxIconWidth()), int maxpmw(data.maxIconWidth()),
@ -6956,7 +7062,7 @@ TQSize QtCurveStyle::sizeFromContents(ContentsType contents, const TQStyleContro
h = TQMAX(h, TQFontMetrics(ceData.font).height() + 2); h = TQMAX(h, TQFontMetrics(ceData.font).height() + 2);
if (mi->iconSet()!= 0) if (mi->iconSet()!= 0)
h = TQMAX(h, mi->iconSet()->pixmap(TQIconSet::Small, TQIconSet::Normal).height()); h = TQMAX(h, mi->iconSet()->pixmap(TQIconSet::Small, TQIconSet::Normal).height());
h+=(opts.thinnerMenuItems ? 2 : 4); h+=((opts.thin&THIN_MENU_ITEMS) ? 2 : 4);
} }
// check | 4 pixels | item | 8 pixels | accel | 4 pixels | check // check | 4 pixels | item | 8 pixels | accel | 4 pixels | check
@ -7181,12 +7287,11 @@ void QtCurveStyle::drawMenuItem(TQPainter *p, const TQRect &r, int flags, const
if(ROUNDED) if(ROUNDED)
{ {
main.addCoords(-1, -1, 1, 1); main.addCoords(-1, -1, 1, 1);
drawBorder(USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol : itsBackgroundCols[ORIGINAL_SHADE], p, main, drawBorder(popupMenuCol(cg), p, main, cg, Style_Horizontal|Style_Raised, reverse ? ROUNDED_RIGHT : ROUNDED_LEFT,
cg, Style_Horizontal|Style_Raised, reverse ? ROUNDED_RIGHT : ROUNDED_LEFT,
cols, WIDGET_MENU_ITEM, false, BORDER_FLAT, false, fill); cols, WIDGET_MENU_ITEM, false, BORDER_FLAT, false, fill);
} }
TQColor bgnd(USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol : itsBackgroundCols[ORIGINAL_SHADE]); TQColor bgnd(popupMenuCol(cg));
drawGradient(reverse ? bgnd : cols[fill], reverse ? cols[fill] : bgnd, p, fade, false); drawGradient(reverse ? bgnd : cols[fill], reverse ? cols[fill] : bgnd, p, fade, false);
} }
else if(mbi || opts.borderMenuitems) else if(mbi || opts.borderMenuitems)
@ -7785,7 +7890,8 @@ void QtCurveStyle::drawSliderGroove(TQPainter *p, const TQRect &r, const TQColor
void QtCurveStyle::drawMenuOrToolBarBackground(TQPainter *p, const TQRect &r, const TQColorGroup &cg, void QtCurveStyle::drawMenuOrToolBarBackground(TQPainter *p, const TQRect &r, const TQColorGroup &cg,
bool menu, bool horiz) const bool menu, bool horiz) const
{ {
if(menu && APPEARANCE_STRIPED==opts.bgndAppearance && IS_FLAT(opts.menubarAppearance) && SHADE_NONE==opts.shadeMenubars) if(menu && (APPEARANCE_STRIPED==opts.bgndAppearance || APPEARANCE_FILE==opts.bgndAppearance) &&
IS_FLAT(opts.menubarAppearance) && SHADE_NONE==opts.shadeMenubars)
return; return;
TQRect rx(r); TQRect rx(r);
@ -7889,6 +7995,20 @@ const TQColor * QtCurveStyle::buttonColors(const TQColorGroup &cg) const
return itsButtonCols; return itsButtonCols;
} }
const TQColor * QtCurveStyle::popupMenuCols(const TQColorGroup &cg) const
{
return opts.shadePopupMenu ? menuColors(cg, true) : backgroundColors(cg);
}
const TQColor & QtCurveStyle::popupMenuCol(const TQColorGroup &cg, int shade) const
{
return opts.shadePopupMenu
? menuColors(cg, true)[ORIGINAL_SHADE]
: USE_LIGHTER_POPUP_MENU
? itsLighterPopupMenuBgndCol
: itsBackgroundCols[shade];
}
const TQColor * QtCurveStyle::checkRadioColors(const TQColorGroup &cg, SFlags flags) const const TQColor * QtCurveStyle::checkRadioColors(const TQColorGroup &cg, SFlags flags) const
{ {
return opts.crColor && flags&Style_Enabled && (flags&Style_On || !(flags&Style_Off)) return opts.crColor && flags&Style_Enabled && (flags&Style_On || !(flags&Style_Off))
@ -7968,6 +8088,58 @@ void QtCurveStyle::setMenuColors(const TQColorGroup &cg)
} }
} }
void QtCurveStyle::setMenuTextColors(TQWidget *widget, bool isMenuBar) const
{
if(SHADE_WINDOW_BORDER==opts.shadeMenubars)
{
TQPalette pal(widget->palette());
getMdiColors(pal.active(), false);
pal.setBrush(TQPalette::Active, TQColorGroup::Foreground, itsActiveMdiTextColor);
pal.setBrush(TQPalette::Active, TQColorGroup::Text, pal.brush(TQPalette::Active, TQColorGroup::Foreground));
if(isMenuBar)
{
pal.setBrush(TQPalette::Inactive, TQColorGroup::Foreground,
opts.shadeMenubarOnlyWhenActive ? itsMdiTextColor : itsActiveMdiTextColor);
pal.setBrush(TQPalette::Inactive, TQColorGroup::Text, pal.brush(TQPalette::Inactive, TQColorGroup::Foreground));
}
else if(opts.shadePopupMenu)
{
pal.setBrush(TQPalette::Disabled, TQColorGroup::Foreground, midColor(itsActiveMdiTextColor, popupMenuCol(pal.active())));
pal.setBrush(TQPalette::Disabled, TQColorGroup::Text, pal.brush(TQPalette::Disabled, TQColorGroup::Foreground));
}
widget->setPalette(pal);
}
else if(opts.customMenuTextColor || SHADE_BLEND_SELECTED==opts.shadeMenubars ||
SHADE_SELECTED==opts.shadeMenubars ||
(SHADE_CUSTOM==opts.shadeMenubars && TOO_DARK(itsMenubarCols[ORIGINAL_SHADE])))
{
TQPalette pal(widget->palette());
pal.setBrush(TQPalette::Active, TQColorGroup::Foreground, opts.customMenuTextColor
? opts.customMenuNormTextColor
: pal.active().highlightedText());
pal.setBrush(TQPalette::Active, TQColorGroup::Text, pal.brush(TQPalette::Active, TQColorGroup::Foreground));
if(isMenuBar && !opts.shadeMenubarOnlyWhenActive)
{
pal.setBrush(TQPalette::Inactive, TQColorGroup::Foreground, opts.customMenuTextColor
? opts.customMenuNormTextColor
: pal.active().highlightedText());
pal.setBrush(TQPalette::Inactive, TQColorGroup::Text, pal.brush(TQPalette::Inactive, TQColorGroup::Foreground));
}
else if(!isMenuBar && opts.shadePopupMenu)
{
pal.setBrush(TQPalette::Disabled, TQColorGroup::Foreground,
midColor(pal.brush(TQPalette::Active, TQColorGroup::Foreground).color(), popupMenuCol(pal.active())));
pal.setBrush(TQPalette::Disabled, TQColorGroup::Text, pal.brush(TQPalette::Disabled, TQColorGroup::Foreground));
}
widget->setPalette(pal);
}
}
const TQColor * QtCurveStyle::menuColors(const TQColorGroup &cg, bool active) const const TQColor * QtCurveStyle::menuColors(const TQColorGroup &cg, bool active) const
{ {
return SHADE_WINDOW_BORDER==opts.shadeMenubars return SHADE_WINDOW_BORDER==opts.shadeMenubars
@ -8102,8 +8274,8 @@ const TQColor * QtCurveStyle::getMdiColors(const TQColorGroup &cg, bool active)
} }
} }
if(itsMdiColors && opts.shadeMenubarOnlyWhenActive && SHADE_WINDOW_BORDER==opts.shadeMenubars && if(opts.shadeMenubarOnlyWhenActive && SHADE_WINDOW_BORDER==opts.shadeMenubars &&
itsActiveMdiColors[ORIGINAL_SHADE]==itsMdiColors[ORIGINAL_SHADE]) itsActiveMdiColors && itsMdiColors && itsActiveMdiColors[ORIGINAL_SHADE]==itsMdiColors[ORIGINAL_SHADE])
opts.shadeMenubarOnlyWhenActive=false; opts.shadeMenubarOnlyWhenActive=false;
if(!itsActiveMdiColors) { if(!itsActiveMdiColors) {
@ -8427,7 +8599,7 @@ const TQColor & QtCurveStyle::getTabFill(bool current, bool highlight, const TQC
: use[2]; : use[2];
} }
const TQColor & QtCurveStyle::menuStripeCol() const const TQColor & QtCurveStyle::menuStripeCol(const TQColorGroup &cg) const
{ {
switch(opts.menuStripe) switch(opts.menuStripe)
{ {
@ -8439,17 +8611,12 @@ const TQColor & QtCurveStyle::menuStripeCol() const
case SHADE_BLEND_SELECTED: case SHADE_BLEND_SELECTED:
// Hack! Use opts.customMenuStripeColor to store this setting! // Hack! Use opts.customMenuStripeColor to store this setting!
if(IS_BLACK(opts.customMenuStripeColor)) if(IS_BLACK(opts.customMenuStripeColor))
opts.customMenuStripeColor=midColor(itsHighlightCols[ORIGINAL_SHADE], opts.customMenuStripeColor=midColor(itsHighlightCols[ORIGINAL_SHADE], popupMenuCol(cg));
opts.lighterPopupMenuBgnd<0
? itsLighterPopupMenuBgndCol
: itsBackgroundCols[ORIGINAL_SHADE]);
return opts.customMenuStripeColor; return opts.customMenuStripeColor;
case SHADE_SELECTED: case SHADE_SELECTED:
return itsHighlightCols[MENU_STRIPE_SHADE]; return itsHighlightCols[MENU_STRIPE_SHADE];
case SHADE_DARKEN: case SHADE_DARKEN:
return USE_LIGHTER_POPUP_MENU return popupMenuCol(cg);
? itsLighterPopupMenuBgndCol
: itsBackgroundCols[MENU_STRIPE_SHADE];
} }
} }

@ -217,6 +217,8 @@ class QtCurveStyle : public BASE_STYLE
void shadeColors(const TQColor &base, TQColor *vals) const; void shadeColors(const TQColor &base, TQColor *vals) const;
const TQColor * buttonColors(const TQColorGroup &cg) const; const TQColor * buttonColors(const TQColorGroup &cg) const;
const TQColor * popupMenuCols(const TQColorGroup &cg) const;
const TQColor & popupMenuCol(const TQColorGroup &cg, int shade=ORIGINAL_SHADE) const;
const TQColor * checkRadioColors(const TQColorGroup &cg, SFlags flags) const; const TQColor * checkRadioColors(const TQColorGroup &cg, SFlags flags) const;
const TQColor * sliderColors(/*const TQColorGroup &cg, */SFlags flags) const; const TQColor * sliderColors(/*const TQColorGroup &cg, */SFlags flags) const;
const TQColor * backgroundColors(const TQColor &c) const; const TQColor * backgroundColors(const TQColor &c) const;
@ -225,6 +227,7 @@ class QtCurveStyle : public BASE_STYLE
const TQColor * borderColors(SFlags flags, const TQColor *use) const; const TQColor * borderColors(SFlags flags, const TQColor *use) const;
const TQColor * getSidebarButtons() const; const TQColor * getSidebarButtons() const;
void setMenuColors(const TQColorGroup &cg); void setMenuColors(const TQColorGroup &cg);
void setMenuTextColors(TQWidget *widget, bool isMenuBar) const;
const TQColor * menuColors(const TQColorGroup &cg, bool active) const; const TQColor * menuColors(const TQColorGroup &cg, bool active) const;
void setDecorationColors(bool init=false); void setDecorationColors(bool init=false);
const TQColor * getMdiColors(const TQColorGroup &cg, bool active) const; const TQColor * getMdiColors(const TQColorGroup &cg, bool active) const;
@ -235,7 +238,7 @@ class QtCurveStyle : public BASE_STYLE
const TQColor & getFill(SFlags flags, const TQColor *use, bool cr=false, bool darker=false) const; const TQColor & getFill(SFlags flags, const TQColor *use, bool cr=false, bool darker=false) const;
const TQColor & getListViewFill(SFlags flags, const TQColor *use) const; const TQColor & getListViewFill(SFlags flags, const TQColor *use) const;
const TQColor & getTabFill(bool current, bool highlight, const TQColor *use) const; const TQColor & getTabFill(bool current, bool highlight, const TQColor *use) const;
const TQColor & menuStripeCol() const; const TQColor & menuStripeCol(const TQColorGroup &cg) const;
const TQColor & checkRadioCol(SFlags flags, const TQColorGroup &cg) const; const TQColor & checkRadioCol(SFlags flags, const TQColorGroup &cg) const;
TQColor shade(const TQColor &a, float k) const; TQColor shade(const TQColor &a, float k) const;
void shade(const color &ca, color *cb, double k) const; void shade(const color &ca, color *cb, double k) const;

Loading…
Cancel
Save