|
Lines 141-147
Link Here
|
| 141 |
|
141 |
|
| 142 |
if(w) |
142 |
if(w) |
| 143 |
{ |
143 |
{ |
| 144 |
static const Atom constAtom = XInternAtom(tqt_xdisplay(), MENU_SIZE_ATOM, False); |
144 |
static const Atom constAtom = XInternAtom(tqt_xdisplay(), MENU_SIZE_ATOM, False); |
| 145 |
XChangeProperty(tqt_xdisplay(), w->parentWidget() ? w->parentWidget()->winId() : w->winId(), |
145 |
XChangeProperty(tqt_xdisplay(), w->parentWidget() ? w->parentWidget()->winId() : w->winId(), |
| 146 |
constAtom, XA_CARDINAL, 16, PropModeReplace, (unsigned char *)&size, 1); |
146 |
constAtom, XA_CARDINAL, 16, PropModeReplace, (unsigned char *)&size, 1); |
| 147 |
} |
147 |
} |
|
Lines 153-161
Link Here
|
| 153 |
|
153 |
|
| 154 |
if(w) |
154 |
if(w) |
| 155 |
{ |
155 |
{ |
| 156 |
static const Atom constAtom = XInternAtom(tqt_xdisplay(), BGND_ATOM, False); |
156 |
static const Atom constAtom = XInternAtom(tqt_xdisplay(), BGND_ATOM, False); |
|
|
157 |
unsigned long prop=((APPEARANCE_STRIPED==app || APPEARANCE_FILE==app ? app : APPEARANCE_FLAT)&0xFF) | |
| 158 |
(widget->palette().active().background().rgb()&0x00FFFFFF)<<8; |
| 159 |
|
| 157 |
XChangeProperty(tqt_xdisplay(), w->parentWidget() ? w->parentWidget()->winId() : w->winId(), |
160 |
XChangeProperty(tqt_xdisplay(), w->parentWidget() ? w->parentWidget()->winId() : w->winId(), |
| 158 |
constAtom, XA_CARDINAL, 16, PropModeReplace, (unsigned char *)&app, 1); |
161 |
constAtom, XA_CARDINAL, 32, PropModeReplace, (unsigned char *)&prop, 1); |
| 159 |
} |
162 |
} |
| 160 |
} |
163 |
} |
| 161 |
|
164 |
|
|
Lines 182-187
Link Here
|
| 182 |
#define MO_ARROW_X(FLAGS, COL) (MO_NONE!=opts.coloredMouseOver && FLAGS&Style_MouseOver && FLAGS&Style_Enabled ? itsMouseOverCols[ARROW_MO_SHADE] : COL) |
185 |
#define MO_ARROW_X(FLAGS, COL) (MO_NONE!=opts.coloredMouseOver && FLAGS&Style_MouseOver && FLAGS&Style_Enabled ? itsMouseOverCols[ARROW_MO_SHADE] : COL) |
| 183 |
#define MO_ARROW(COL) MO_ARROW_X(flags, COL) |
186 |
#define MO_ARROW(COL) MO_ARROW_X(flags, COL) |
| 184 |
|
187 |
|
|
|
188 |
static void adjustToolbarButtons(const TQWidget *widget, const TQToolBar *toolbar, int &leftAdjust, int &topAdjust, |
| 189 |
int &rightAdjust, int &bottomAdjust, int &round) |
| 190 |
{ |
| 191 |
const int constAdjust=4; |
| 192 |
const int d = 1; |
| 193 |
TQRect geo(widget->geometry()); |
| 194 |
|
| 195 |
if (TQt::Horizontal==toolbar->orientation()) |
| 196 |
{ |
| 197 |
bool haveLeft=::tqqt_cast<TQToolButton*>(toolbar->childAt(geo.x()-d, geo.y())), |
| 198 |
haveRight=::tqqt_cast<TQToolButton*>(toolbar->childAt(geo.right()+d, geo.y())); |
| 199 |
|
| 200 |
if(haveLeft && haveRight) |
| 201 |
leftAdjust=-constAdjust, rightAdjust=constAdjust, round=ROUNDED_NONE; |
| 202 |
else if(haveLeft) |
| 203 |
leftAdjust=-constAdjust, round=ROUNDED_RIGHT; |
| 204 |
else if(haveRight) |
| 205 |
rightAdjust=constAdjust, round=ROUNDED_LEFT; |
| 206 |
} |
| 207 |
else |
| 208 |
{ |
| 209 |
bool haveTop=::tqqt_cast<TQToolButton*>(toolbar->childAt(geo.x(), geo.y()-d)), |
| 210 |
haveBot=::tqqt_cast<TQToolButton*>(toolbar->childAt(geo.x(), geo.bottom()+d)); |
| 211 |
|
| 212 |
if(haveTop && haveBot) |
| 213 |
topAdjust=-constAdjust, bottomAdjust=constAdjust, round=ROUNDED_NONE; |
| 214 |
else if(haveTop) |
| 215 |
topAdjust=-constAdjust, round=ROUNDED_BOTTOM; |
| 216 |
else if(haveBot) |
| 217 |
bottomAdjust=constAdjust, round=ROUNDED_TOP; |
| 218 |
} |
| 219 |
} |
| 220 |
|
| 185 |
static const int constMenuPixmapWidth=22; |
221 |
static const int constMenuPixmapWidth=22; |
| 186 |
|
222 |
|
| 187 |
static bool useTQt3Settings() |
223 |
static bool useTQt3Settings() |
|
Lines 1415-1420
Link Here
|
| 1415 |
|
1451 |
|
| 1416 |
if(APPEARANCE_STRIPED==opts.bgndAppearance) |
1452 |
if(APPEARANCE_STRIPED==opts.bgndAppearance) |
| 1417 |
pal.setBrush(TQColorGroup::Background, TQBrush(pal.active().background(), *createStripePixmap(pal.active().background(), true))); |
1453 |
pal.setBrush(TQColorGroup::Background, TQBrush(pal.active().background(), *createStripePixmap(pal.active().background(), true))); |
|
|
1454 |
else if(APPEARANCE_FILE==opts.bgndAppearance) |
| 1455 |
{ |
| 1456 |
TQPixmap pix(opts.bgndPixmap.img.width(), opts.bgndPixmap.img.height()); |
| 1457 |
TQPainter p(&pix); |
| 1458 |
WindowBorders borders=qtcGetWindowBorderSize(); |
| 1459 |
int xadjust=borders.sides>0 && borders.sides!=opts.bgndPixmap.img.width() |
| 1460 |
? borders.sides>opts.bgndPixmap.img.width() |
| 1461 |
? borders.sides%opts.bgndPixmap.img.width() |
| 1462 |
: borders.sides |
| 1463 |
:0, |
| 1464 |
yadjust=borders.titleHeight>0 && borders.titleHeight!=opts.bgndPixmap.img.height() |
| 1465 |
? borders.titleHeight>opts.bgndPixmap.img.height() |
| 1466 |
? borders.titleHeight%opts.bgndPixmap.img.height() |
| 1467 |
: borders.titleHeight |
| 1468 |
:0; |
| 1469 |
|
| 1470 |
p.fillRect(0, 0, opts.bgndPixmap.img.width(), opts.bgndPixmap.img.height(), pal.active().background()); |
| 1471 |
|
| 1472 |
p.drawPixmap(-xadjust, -yadjust, opts.bgndPixmap.img); |
| 1473 |
if(xadjust>0) |
| 1474 |
p.drawPixmap(opts.bgndPixmap.img.width()-xadjust, -yadjust, opts.bgndPixmap.img); |
| 1475 |
if(yadjust>0) |
| 1476 |
p.drawPixmap(-xadjust, opts.bgndPixmap.img.height()-yadjust, opts.bgndPixmap.img); |
| 1477 |
if(xadjust>0 && yadjust>0) |
| 1478 |
p.drawPixmap(opts.bgndPixmap.img.width()-xadjust, opts.bgndPixmap.img.height()-yadjust, opts.bgndPixmap.img); |
| 1479 |
|
| 1480 |
p.end(); |
| 1481 |
pal.setBrush(TQColorGroup::Background, TQBrush(pal.active().background(), pix)); |
| 1482 |
} |
| 1418 |
} |
1483 |
} |
| 1419 |
|
1484 |
|
| 1420 |
static TQColor disable(const TQColor &col, const TQColor &bgnd) |
1485 |
static TQColor disable(const TQColor &col, const TQColor &bgnd) |
|
Lines 1475-1482
Link Here
|
| 1475 |
if(isWindowDragWidget(TQT_TQOBJECT(widget))) |
1540 |
if(isWindowDragWidget(TQT_TQOBJECT(widget))) |
| 1476 |
installObjectEventHandler(ceData, elementFlags, ptr, this); |
1541 |
installObjectEventHandler(ceData, elementFlags, ptr, this); |
| 1477 |
|
1542 |
|
| 1478 |
if(APPEARANCE_STRIPED==opts.bgndAppearance && (::tqqt_cast<TQDialog *>(widget) || ::tqqt_cast<TQMainWindow *>(widget))) |
1543 |
if(::tqqt_cast<TQDialog *>(widget) || ::tqqt_cast<TQMainWindow *>(widget)) |
| 1479 |
setBgndProp(widget, APPEARANCE_STRIPED); |
1544 |
{ |
|
|
1545 |
setBgndProp(widget, opts.bgndAppearance); |
| 1546 |
installObjectEventHandler(ceData, elementFlags, ptr, this); // To trap palette change |
| 1547 |
} |
| 1480 |
|
1548 |
|
| 1481 |
if(widget->parentWidget() && ::tqqt_cast<TQScrollView *>(widget) && ::tqqt_cast<TQComboBox *>(widget->parentWidget())) |
1549 |
if(widget->parentWidget() && ::tqqt_cast<TQScrollView *>(widget) && ::tqqt_cast<TQComboBox *>(widget->parentWidget())) |
| 1482 |
{ |
1550 |
{ |
|
Lines 1543-1550
Link Here
|
| 1543 |
(widget->parentWidget() && ::tqqt_cast<const TQListBox *>(widget) && |
1611 |
(widget->parentWidget() && ::tqqt_cast<const TQListBox *>(widget) && |
| 1544 |
::tqqt_cast<const TQComboBox *>(widget->parentWidget())))) |
1612 |
::tqqt_cast<const TQComboBox *>(widget->parentWidget())))) |
| 1545 |
((TQFrame *)widget)->setLineWidth(0); |
1613 |
((TQFrame *)widget)->setLineWidth(0); |
| 1546 |
else if ((USE_LIGHTER_POPUP_MENU || !IS_FLAT_BGND(opts.menuBgndAppearance)) && !opts.borderMenuitems && |
1614 |
else if (!DRAW_MENU_BORDER && !opts.borderMenuitems && widget && ::tqqt_cast<const TQPopupMenu *>(widget)) |
| 1547 |
widget && ::tqqt_cast<const TQPopupMenu *>(widget)) |
|
|
| 1548 |
((TQFrame *)widget)->setLineWidth(1); |
1615 |
((TQFrame *)widget)->setLineWidth(1); |
| 1549 |
|
1616 |
|
| 1550 |
if (::tqqt_cast<TQRadioButton *>(widget) || ::tqqt_cast<TQCheckBox *>(widget)) |
1617 |
if (::tqqt_cast<TQRadioButton *>(widget) || ::tqqt_cast<TQCheckBox *>(widget)) |
|
Lines 1619-1657
Link Here
|
| 1619 |
installObjectEventHandler(ceData, elementFlags, ptr, this); |
1686 |
installObjectEventHandler(ceData, elementFlags, ptr, this); |
| 1620 |
if(BLEND_TITLEBAR || opts.windowBorder&WINDOW_BORDER_USE_MENUBAR_COLOR_FOR_TITLEBAR) |
1687 |
if(BLEND_TITLEBAR || opts.windowBorder&WINDOW_BORDER_USE_MENUBAR_COLOR_FOR_TITLEBAR) |
| 1621 |
emitMenuSize(widget, ceData.rect.height()); |
1688 |
emitMenuSize(widget, ceData.rect.height()); |
| 1622 |
if(SHADE_WINDOW_BORDER==opts.shadeMenubars) |
1689 |
setMenuTextColors(widget, true); |
| 1623 |
{ |
|
|
| 1624 |
TQPalette pal(ceData.palette); |
| 1625 |
TQColorGroup act(pal.active()); |
| 1626 |
TQColorGroup inact(pal.inactive()); |
| 1627 |
|
| 1628 |
getMdiColors(act, true); |
| 1629 |
act.setColor(TQColorGroup::Foreground, itsActiveMdiTextColor); |
| 1630 |
inact.setColor(TQColorGroup::Foreground, opts.shadeMenubarOnlyWhenActive ? itsMdiTextColor : itsActiveMdiTextColor); |
| 1631 |
pal.setInactive(inact); |
| 1632 |
pal.setActive(act); |
| 1633 |
widget->setPalette(pal); |
| 1634 |
} |
| 1635 |
else if(opts.customMenuTextColor || SHADE_BLEND_SELECTED==opts.shadeMenubars || SHADE_SELECTED==opts.shadeMenubars || |
| 1636 |
(SHADE_CUSTOM==opts.shadeMenubars && TOO_DARK(itsMenubarCols[ORIGINAL_SHADE]))) |
| 1637 |
{ |
| 1638 |
TQPalette pal(ceData.palette); |
| 1639 |
TQColorGroup act(pal.active()); |
| 1640 |
|
| 1641 |
act.setColor(TQColorGroup::Foreground, opts.customMenuTextColor |
| 1642 |
? opts.customMenuNormTextColor |
| 1643 |
: TQApplication::palette().active().highlightedText()); |
| 1644 |
|
| 1645 |
if(!opts.shadeMenubarOnlyWhenActive) |
| 1646 |
{ |
| 1647 |
TQColorGroup inact(pal.inactive()); |
| 1648 |
inact.setColor(TQColorGroup::Foreground, act.color(TQColorGroup::Foreground)); |
| 1649 |
pal.setInactive(inact); |
| 1650 |
} |
| 1651 |
|
| 1652 |
pal.setActive(act); |
| 1653 |
widget->setPalette(pal); |
| 1654 |
} |
| 1655 |
} |
1690 |
} |
| 1656 |
else if(::tqqt_cast<TQToolBar *>(widget)) |
1691 |
else if(::tqqt_cast<TQToolBar *>(widget)) |
| 1657 |
{ |
1692 |
{ |
|
Lines 1659-1665
Link Here
|
| 1659 |
widget->setBackgroundMode(PaletteBackground); |
1694 |
widget->setBackgroundMode(PaletteBackground); |
| 1660 |
} |
1695 |
} |
| 1661 |
else if(::tqqt_cast<TQPopupMenu *>(widget)) |
1696 |
else if(::tqqt_cast<TQPopupMenu *>(widget)) |
|
|
1697 |
{ |
| 1662 |
widget->setBackgroundMode(NoBackground); // PaletteBackground); |
1698 |
widget->setBackgroundMode(NoBackground); // PaletteBackground); |
|
|
1699 |
setMenuTextColors(widget, true); |
| 1700 |
} |
| 1663 |
else if (ceData.widgetObjectTypes.contains("TDEToolBarSeparator") || |
1701 |
else if (ceData.widgetObjectTypes.contains("TDEToolBarSeparator") || |
| 1664 |
(ceData.widgetObjectTypes.contains("TDEListViewSearchLineWidget") && |
1702 |
(ceData.widgetObjectTypes.contains("TDEListViewSearchLineWidget") && |
| 1665 |
widget->parent() && ::tqqt_cast<TQToolBar *>(widget->parent()))) |
1703 |
widget->parent() && ::tqqt_cast<TQToolBar *>(widget->parent()))) |
|
Lines 1833-1839
Link Here
|
| 1833 |
widget->setPalette(pal); |
1871 |
widget->setPalette(pal); |
| 1834 |
} |
1872 |
} |
| 1835 |
|
1873 |
|
| 1836 |
if(APPEARANCE_STRIPED==opts.bgndAppearance) |
1874 |
if(APPEARANCE_STRIPED==opts.bgndAppearance || APPEARANCE_FILE==opts.bgndAppearance) |
| 1837 |
widget->setBackgroundOrigin(TQWidget::WindowOrigin); |
1875 |
widget->setBackgroundOrigin(TQWidget::WindowOrigin); |
| 1838 |
} |
1876 |
} |
| 1839 |
|
1877 |
|
|
Lines 2092-2103
Link Here
|
| 2092 |
{ |
2130 |
{ |
| 2093 |
TQWidget *widget=(TQWidget*)object; |
2131 |
TQWidget *widget=(TQWidget*)object; |
| 2094 |
TQPainter painter(widget); |
2132 |
TQPainter painter(widget); |
| 2095 |
TQColor col(USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol : ceData.palette.active().background()); |
2133 |
TQColor col(popupMenuCol(widget->palette().active())); |
| 2096 |
|
2134 |
|
| 2097 |
if(APPEARANCE_STRIPED==opts.menuBgndAppearance) |
2135 |
if(APPEARANCE_STRIPED==opts.menuBgndAppearance) |
| 2098 |
{ |
2136 |
{ |
| 2099 |
painter.drawTiledPixmap(ceData.rect, *createStripePixmap(col, false)); |
2137 |
painter.drawTiledPixmap(ceData.rect, *createStripePixmap(col, false)); |
| 2100 |
} |
2138 |
} |
|
|
2139 |
else if(APPEARANCE_FILE==opts.menuBgndAppearance) |
| 2140 |
{ |
| 2141 |
painter.fillRect(widget->rect(), col); |
| 2142 |
painter.drawTiledPixmap(widget->rect(), opts.menuBgndPixmap.img); |
| 2143 |
} |
| 2101 |
else |
2144 |
else |
| 2102 |
{ |
2145 |
{ |
| 2103 |
drawBevelGradientReal(col, &painter, ceData.rect, GT_HORIZ==opts.menuBgndGrad, false, |
2146 |
drawBevelGradientReal(col, &painter, ceData.rect, GT_HORIZ==opts.menuBgndGrad, false, |
|
Lines 2320-2326
Link Here
|
| 2320 |
default: |
2363 |
default: |
| 2321 |
break; |
2364 |
break; |
| 2322 |
} |
2365 |
} |
| 2323 |
|
2366 |
if(TQEvent::PaletteChange==event->type() && (::tqqt_cast<TQDialog *>(object) || ::tqqt_cast<TQMainWindow *>(object))) |
|
|
2367 |
setBgndProp(static_cast<TQWidget *>(object), opts.bgndAppearance); |
| 2324 |
#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT |
2368 |
#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT |
| 2325 |
if(opts.fixParentlessDialogs && ::tqqt_cast<TQDialog *>(object)) |
2369 |
if(opts.fixParentlessDialogs && ::tqqt_cast<TQDialog *>(object)) |
| 2326 |
{ |
2370 |
{ |
|
Lines 2684-2690
Link Here
|
| 2684 |
} |
2728 |
} |
| 2685 |
|
2729 |
|
| 2686 |
if(doEtch || glowFocus) { |
2730 |
if(doEtch || glowFocus) { |
| 2687 |
if( (!sunken || sunkenToggleMo) && |
2731 |
if( (!sunken || sunkenToggleMo) && !(opts.thin&THIN_FRAMES) && |
| 2688 |
((WIDGET_OTHER!=w && WIDGET_SLIDER_TROUGH!=w && MO_GLOW==opts.coloredMouseOver && flags&Style_MouseOver) || |
2732 |
((WIDGET_OTHER!=w && WIDGET_SLIDER_TROUGH!=w && MO_GLOW==opts.coloredMouseOver && flags&Style_MouseOver) || |
| 2689 |
glowFocus || |
2733 |
glowFocus || |
| 2690 |
(WIDGET_DEF_BUTTON==w && IND_GLOW==opts.defBtnIndicator)/* || |
2734 |
(WIDGET_DEF_BUTTON==w && IND_GLOW==opts.defBtnIndicator)/* || |
|
Lines 2793-2832
Link Here
|
| 2793 |
if(WIDGET_TAB_BOT==w || WIDGET_TAB_TOP==w) |
2837 |
if(WIDGET_TAB_BOT==w || WIDGET_TAB_TOP==w) |
| 2794 |
cols=itsBackgroundCols; |
2838 |
cols=itsBackgroundCols; |
| 2795 |
|
2839 |
|
| 2796 |
switch(borderProfile) |
2840 |
if(!(opts.thin&THIN_FRAMES)) |
| 2797 |
{ |
2841 |
switch(borderProfile) |
| 2798 |
case BORDER_FLAT: |
2842 |
{ |
| 2799 |
break; |
2843 |
case BORDER_FLAT: |
| 2800 |
case BORDER_RAISED: |
2844 |
break; |
| 2801 |
case BORDER_SUNKEN: |
2845 |
case BORDER_RAISED: |
| 2802 |
case BORDER_LIGHT: |
2846 |
case BORDER_SUNKEN: |
| 2803 |
if(flags&Style_Enabled && (hasMouseOver || hasFocus) && (WIDGET_ENTRY==w || WIDGET_SCROLLVIEW==w || WIDGET_COMBO==w || WIDGET_SPIN==w)) |
2847 |
case BORDER_LIGHT: |
| 2804 |
p->setPen(midColorF(cg.background(), cols[BORDER_RAISED==borderProfile || BORDER_LIGHT==borderProfile |
2848 |
if(flags&Style_Enabled && (hasMouseOver || hasFocus) && (WIDGET_ENTRY==w || WIDGET_SCROLLVIEW==w || WIDGET_COMBO==w || WIDGET_SPIN==w)) |
| 2805 |
? 0 : FRAME_DARK_SHADOW], 1.5-ENTRY_INNER_ALPHA)); |
2849 |
p->setPen(midColorF(cg.background(), cols[BORDER_RAISED==borderProfile || BORDER_LIGHT==borderProfile |
| 2806 |
else |
2850 |
? 0 : FRAME_DARK_SHADOW], 1.5-ENTRY_INNER_ALPHA)); |
| 2807 |
p->setPen(flags&Style_Enabled && (BORDER_RAISED==borderProfile || BORDER_LIGHT==borderProfile || APPEARANCE_FLAT!=app) |
2851 |
else |
| 2808 |
? blendBorderColors |
2852 |
p->setPen(flags&Style_Enabled && (BORDER_RAISED==borderProfile || BORDER_LIGHT==borderProfile || APPEARANCE_FLAT!=app) |
| 2809 |
? midColor(cg.background(), cols[BORDER_RAISED==borderProfile |
2853 |
? blendBorderColors |
| 2810 |
? 0 : FRAME_DARK_SHADOW]) // Was base??? |
2854 |
? midColor(cg.background(), cols[BORDER_RAISED==borderProfile |
| 2811 |
: cols[BORDER_RAISED==borderProfile || BORDER_LIGHT==borderProfile ? 0 : FRAME_DARK_SHADOW] |
2855 |
? 0 : FRAME_DARK_SHADOW]) // Was base??? |
| 2812 |
: cg.background()); |
2856 |
: cols[BORDER_RAISED==borderProfile || BORDER_LIGHT==borderProfile ? 0 : FRAME_DARK_SHADOW] |
| 2813 |
p->drawLine(r.x()+1, r.y()+1, r.x()+1, r.y()+r.height()-2); |
2857 |
: cg.background()); |
| 2814 |
p->drawLine(r.x()+1, r.y()+1, r.x()+r.width()-2, r.y()+1); |
2858 |
p->drawLine(r.x()+1, r.y()+1, r.x()+1, r.y()+r.height()-2); |
| 2815 |
if(!hasFocus && !hasMouseOver && BORDER_LIGHT!=borderProfile) |
2859 |
p->drawLine(r.x()+1, r.y()+1, r.x()+r.width()-2, r.y()+1); |
| 2816 |
p->setPen(WIDGET_SCROLLVIEW==w |
2860 |
if(!hasFocus && !hasMouseOver && BORDER_LIGHT!=borderProfile) |
| 2817 |
? cg.background() |
2861 |
p->setPen(WIDGET_SCROLLVIEW==w |
| 2818 |
: WIDGET_ENTRY==w |
2862 |
? cg.background() |
| 2819 |
? cg.base() |
2863 |
: WIDGET_ENTRY==w |
| 2820 |
: flags&Style_Enabled && (BORDER_SUNKEN==borderProfile || APPEARANCE_FLAT!=app || |
2864 |
? cg.base() |
| 2821 |
WIDGET_TAB_TOP==w || WIDGET_TAB_BOT==w) |
2865 |
: flags&Style_Enabled && (BORDER_SUNKEN==borderProfile || APPEARANCE_FLAT!=app || |
| 2822 |
? blendBorderColors |
2866 |
WIDGET_TAB_TOP==w || WIDGET_TAB_BOT==w) |
| 2823 |
? midColor(cg.background(), cols[BORDER_RAISED==borderProfile |
2867 |
? blendBorderColors |
| 2824 |
? FRAME_DARK_SHADOW : 0]) // Was base??? |
2868 |
? midColor(cg.background(), cols[BORDER_RAISED==borderProfile |
| 2825 |
: cols[BORDER_RAISED==borderProfile ? FRAME_DARK_SHADOW : 0] |
2869 |
? FRAME_DARK_SHADOW : 0]) // Was base??? |
| 2826 |
: cg.background()); |
2870 |
: cols[BORDER_RAISED==borderProfile ? FRAME_DARK_SHADOW : 0] |
| 2827 |
p->drawLine(r.x()+r.width()-2, r.y()+1, r.x()+r.width()-2, r.y()+r.height()-2); |
2871 |
: cg.background()); |
| 2828 |
p->drawLine(r.x()+1, r.y()+r.height()-2, r.x()+r.width()-2, r.y()+r.height()-2); |
2872 |
p->drawLine(r.x()+r.width()-2, r.y()+1, r.x()+r.width()-2, r.y()+r.height()-2); |
| 2829 |
} |
2873 |
p->drawLine(r.x()+1, r.y()+r.height()-2, r.x()+r.width()-2, r.y()+r.height()-2); |
|
|
2874 |
} |
| 2830 |
|
2875 |
|
| 2831 |
if(ROUNDED && ROUNDED_NONE!=round) |
2876 |
if(ROUNDED && ROUNDED_NONE!=round) |
| 2832 |
{ |
2877 |
{ |
|
Lines 3936-3961
Link Here
|
| 3936 |
} |
3981 |
} |
| 3937 |
case PE_PanelPopup: |
3982 |
case PE_PanelPopup: |
| 3938 |
{ |
3983 |
{ |
| 3939 |
const TQColor *use(backgroundColors(cg)); |
3984 |
const TQColor *use(popupMenuCols(cg)); |
|
|
3985 |
EGradientBorder border=getGradient(opts.menuBgndAppearance, &opts)->border; |
| 3940 |
|
3986 |
|
| 3941 |
p->setPen(use[STD_BORDER]); |
3987 |
p->setPen(use[STD_BORDER]); |
| 3942 |
p->setBrush(NoBrush); |
3988 |
p->setBrush(NoBrush); |
| 3943 |
p->drawRect(r); |
3989 |
p->drawRect(r); |
| 3944 |
if(!IS_FLAT_BGND(opts.menuBgndAppearance)) |
3990 |
|
| 3945 |
; |
3991 |
if(USE_BORDER(border) && APPEARANCE_FLAT!=opts.menuBgndAppearance) |
| 3946 |
else if(USE_LIGHTER_POPUP_MENU) |
|
|
| 3947 |
{ |
3992 |
{ |
| 3948 |
p->setPen(/*USE_LIGHTER_POPUP_MENU ? */itsLighterPopupMenuBgndCol/* : cg.background()*/); |
3993 |
p->setPen(use[0]); |
| 3949 |
p->drawRect(TQRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2)); |
3994 |
if(GB_LIGHT==border) |
|
|
3995 |
p->drawRect(TQRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2)); |
| 3996 |
else |
| 3997 |
{ |
| 3998 |
if(GB_3D==border) |
| 3999 |
p->setPen(popupMenuCol(cg)); |
| 4000 |
p->drawLine(r.x()+1, r.y()+1, r.x()+r.width()-2, r.y()+1); |
| 4001 |
p->drawLine(r.x()+1, r.y()+1, r.x()+1, r.y()+r.height()-2); |
| 4002 |
p->setPen(use[FRAME_DARK_SHADOW]); |
| 4003 |
p->drawLine(r.x()+1, r.y()+r.height()-2, r.x()+r.width()-2, r.y()+r.height()-2); |
| 4004 |
p->drawLine(r.x()+r.width()-2, r.y()+1, r.x()+r.width()-2, r.y()+r.height()-2); |
| 4005 |
} |
| 3950 |
} |
4006 |
} |
| 3951 |
else |
4007 |
else if(IS_FLAT_BGND(opts.menuBgndAppearance)) |
| 3952 |
{ |
4008 |
{ |
| 3953 |
p->setPen(use[0]); |
4009 |
p->setPen(/*USE_LIGHTER_POPUP_MENU ? */popupMenuCol(cg)/* : cg.background()*/); |
| 3954 |
p->drawLine(r.x()+1, r.y()+1, r.x()+r.width()-2, r.y()+1); |
4010 |
p->drawRect(TQRect(r.x()+1, r.y()+1, r.width()-2, r.height()-2)); |
| 3955 |
p->drawLine(r.x()+1, r.y()+1, r.x()+1, r.y()+r.height()-2); |
|
|
| 3956 |
p->setPen(use[FRAME_DARK_SHADOW]); |
| 3957 |
p->drawLine(r.x()+1, r.y()+r.height()-2, r.x()+r.width()-2, r.y()+r.height()-2); |
| 3958 |
p->drawLine(r.x()+r.width()-2, r.y()+1, r.x()+r.width()-2, r.y()+r.height()-2); |
| 3959 |
} |
4011 |
} |
| 3960 |
break; |
4012 |
break; |
| 3961 |
} |
4013 |
} |
|
Lines 4249-4255
Link Here
|
| 4249 |
(dynamic_cast<const TQButton *>(widget) || dynamic_cast<const TQComboBox *>(widget))) |
4301 |
(dynamic_cast<const TQButton *>(widget) || dynamic_cast<const TQComboBox *>(widget))) |
| 4250 |
return; |
4302 |
return; |
| 4251 |
|
4303 |
|
| 4252 |
if(FOCUS_LINE==opts.focus) |
4304 |
if(FOCUS_LINE==opts.focus || FOCUS_GLOW==opts.focus) |
| 4253 |
{ |
4305 |
{ |
| 4254 |
p->setPen(view && flags&Style_Selected |
4306 |
p->setPen(view && flags&Style_Selected |
| 4255 |
? cg.highlightedText() |
4307 |
? cg.highlightedText() |
|
Lines 4488-4494
Link Here
|
| 4488 |
{ |
4540 |
{ |
| 4489 |
case KPE_ToolBarHandle: |
4541 |
case KPE_ToolBarHandle: |
| 4490 |
{ |
4542 |
{ |
| 4491 |
if(APPEARANCE_STRIPED!=opts.bgndAppearance) |
4543 |
if(APPEARANCE_STRIPED!=opts.bgndAppearance && APPEARANCE_FILE!=opts.bgndAppearance) |
| 4492 |
{ |
4544 |
{ |
| 4493 |
TQRect r2(r); |
4545 |
TQRect r2(r); |
| 4494 |
r2.addCoords(-1, -1, 2, 2); |
4546 |
r2.addCoords(-1, -1, 2, 2); |
|
Lines 4580-4586
Link Here
|
| 4580 |
{ |
4632 |
{ |
| 4581 |
TQRect ar(r.x()+((r.width()-(LV_SIZE+4))>>1), r.y()+((r.height()-(LV_SIZE+4))>>1), LV_SIZE+4, |
4633 |
TQRect ar(r.x()+((r.width()-(LV_SIZE+4))>>1), r.y()+((r.height()-(LV_SIZE+4))>>1), LV_SIZE+4, |
| 4582 |
LV_SIZE+4); |
4634 |
LV_SIZE+4); |
| 4583 |
|
4635 |
#if 0 |
| 4584 |
if(LV_OLD==opts.lvLines) |
4636 |
if(LV_OLD==opts.lvLines) |
| 4585 |
{ |
4637 |
{ |
| 4586 |
int lo(ROUNDED ? 2 : 0); |
4638 |
int lo(ROUNDED ? 2 : 0); |
|
Lines 4607-4613
Link Here
|
| 4607 |
ar.y()+ar.height()-2); |
4659 |
ar.y()+ar.height()-2); |
| 4608 |
} |
4660 |
} |
| 4609 |
} |
4661 |
} |
| 4610 |
|
4662 |
#endif |
| 4611 |
::drawArrow(p, ar, flags&Style_Enabled ? cg.mid() : cg.text(), flags&Style_On // Collapsed = On |
4663 |
::drawArrow(p, ar, flags&Style_Enabled ? cg.mid() : cg.text(), flags&Style_On // Collapsed = On |
| 4612 |
? TQApplication::reverseLayout() |
4664 |
? TQApplication::reverseLayout() |
| 4613 |
? PE_ArrowLeft |
4665 |
? PE_ArrowLeft |
|
Lines 4660-4666
Link Here
|
| 4660 |
itsHover(itsHoverTab && itsHoverTab->isEnabled() && data.tab()==itsHoverTab && |
4712 |
itsHover(itsHoverTab && itsHoverTab->isEnabled() && data.tab()==itsHoverTab && |
| 4661 |
!(flags&Style_Selected) && |
4713 |
!(flags&Style_Selected) && |
| 4662 |
ceData.tabBarData.currentTabIndex!=tabIndex), |
4714 |
ceData.tabBarData.currentTabIndex!=tabIndex), |
| 4663 |
glowMo(!active && itsHover && opts.coloredMouseOver && TAB_MO_GLOW==opts.tabMouseOver); |
4715 |
glowMo(!active && itsHover && opts.coloredMouseOver && TAB_MO_GLOW==opts.tabMouseOver), |
|
|
4716 |
thin(opts.thin&THIN_FRAMES), |
| 4717 |
drawOuterGlow(glowMo && !thin); |
| 4664 |
int sizeAdjust(!active && TAB_MO_GLOW==opts.tabMouseOver ? 1 : 0); |
4718 |
int sizeAdjust(!active && TAB_MO_GLOW==opts.tabMouseOver ? 1 : 0); |
| 4665 |
const TQColor &fill(getTabFill(flags&Style_Selected, itsHover, itsBackgroundCols)); |
4719 |
const TQColor &fill(getTabFill(flags&Style_Selected, itsHover, itsBackgroundCols)); |
| 4666 |
EBorder borderProfile(active || opts.borderInactiveTab |
4720 |
EBorder borderProfile(active || opts.borderInactiveTab |
|
Lines 4742-4748
Link Here
|
| 4742 |
? (top ? ROUNDED_TOPRIGHT : ROUNDED_BOTTOMRIGHT) |
4796 |
? (top ? ROUNDED_TOPRIGHT : ROUNDED_BOTTOMRIGHT) |
| 4743 |
: ROUNDED_NONE, glowMo ? itsMouseOverCols : 0L, top ? WIDGET_TAB_TOP : WIDGET_TAB_BOT, true, |
4797 |
: ROUNDED_NONE, glowMo ? itsMouseOverCols : 0L, top ? WIDGET_TAB_TOP : WIDGET_TAB_BOT, true, |
| 4744 |
borderProfile, false); |
4798 |
borderProfile, false); |
| 4745 |
if(glowMo) |
4799 |
if(drawOuterGlow) |
| 4746 |
{ |
4800 |
{ |
| 4747 |
glowTr.addCoords(-1, -1, 1, 1); |
4801 |
glowTr.addCoords(-1, -1, 1, 1); |
| 4748 |
drawGlow(p, glowTr, cg, top ? WIDGET_TAB_TOP : WIDGET_TAB_BOT); |
4802 |
drawGlow(p, glowTr, cg, top ? WIDGET_TAB_TOP : WIDGET_TAB_BOT); |
|
Lines 4756-4771
Link Here
|
| 4756 |
p->setPen(itsBackgroundCols[STD_BORDER]); |
4810 |
p->setPen(itsBackgroundCols[STD_BORDER]); |
| 4757 |
p->drawPoint(r.x(), r.y()+r.height()-2); |
4811 |
p->drawPoint(r.x(), r.y()+r.height()-2); |
| 4758 |
p->drawPoint(r.x()+r.width()-1, r.y()+r.height()-2); |
4812 |
p->drawPoint(r.x()+r.width()-1, r.y()+r.height()-2); |
| 4759 |
p->setPen(itsBackgroundCols[0]); |
4813 |
if(!thin) |
| 4760 |
p->drawLine(r.x()+1, r.y()+r.height()-3, r.x()+1, r.y()+r.height()-1); |
4814 |
{ |
| 4761 |
//p->drawPoint(r.x()+r.width()-2, r.y()+r.height()-1); |
4815 |
p->setPen(itsBackgroundCols[0]); |
| 4762 |
p->setPen(itsBackgroundCols[opts.borderTab ? 0 : FRAME_DARK_SHADOW]); |
4816 |
p->drawLine(r.x()+1, r.y()+r.height()-3, r.x()+1, r.y()+r.height()-1); |
| 4763 |
p->drawPoint(r.x()+r.width()-2, r.y()+r.height()-2); |
4817 |
//p->drawPoint(r.x()+r.width()-2, r.y()+r.height()-1); |
|
|
4818 |
p->setPen(itsBackgroundCols[opts.borderTab ? 0 : FRAME_DARK_SHADOW]); |
| 4819 |
p->drawPoint(r.x()+r.width()-2, r.y()+r.height()-2); |
| 4820 |
} |
| 4764 |
} |
4821 |
} |
| 4765 |
else |
4822 |
else |
| 4766 |
{ |
4823 |
{ |
| 4767 |
p->setPen(itsBackgroundCols[0]); |
4824 |
if(!thin) |
| 4768 |
p->drawLine(r.x(), r.y()+r.height()-1, r.x()+r.width()-1, r.y()+r.height()-1); |
4825 |
{ |
|
|
4826 |
p->setPen(itsBackgroundCols[0]); |
| 4827 |
p->drawLine(r.x(), r.y()+r.height()-1, r.x()+r.width()-1, r.y()+r.height()-1); |
| 4828 |
} |
| 4769 |
p->setPen(itsBackgroundCols[STD_BORDER]); |
4829 |
p->setPen(itsBackgroundCols[STD_BORDER]); |
| 4770 |
p->drawLine(r.x(), r.y()+r.height()-2, r.x()+r.width()-1, r.y()+r.height()-2); |
4830 |
p->drawLine(r.x(), r.y()+r.height()-2, r.x()+r.width()-1, r.y()+r.height()-2); |
| 4771 |
|
4831 |
|
|
Lines 4784-4790
Link Here
|
| 4784 |
p->setPen(itsBackgroundCols[!active && TAB_MO_GLOW==opts.tabMouseOver && opts.round>ROUND_SLIGHT && !(opts.square&SQUARE_TAB_FRAME) |
4844 |
p->setPen(itsBackgroundCols[!active && TAB_MO_GLOW==opts.tabMouseOver && opts.round>ROUND_SLIGHT && !(opts.square&SQUARE_TAB_FRAME) |
| 4785 |
? ORIGINAL_SHADE : STD_BORDER]); |
4845 |
? ORIGINAL_SHADE : STD_BORDER]); |
| 4786 |
p->drawLine(x, r.y()+r.height()-1, x, r.height()-2); |
4846 |
p->drawLine(x, r.y()+r.height()-1, x, r.height()-2); |
| 4787 |
if(active) |
4847 |
if(active && !thin) |
| 4788 |
{ |
4848 |
{ |
| 4789 |
p->setPen(itsBackgroundCols[reverse ? dark : 0]); |
4849 |
p->setPen(itsBackgroundCols[reverse ? dark : 0]); |
| 4790 |
p->drawLine(x2, r.y()+r.height()-1, x2, r.y()+r.height()-2); |
4850 |
p->drawLine(x2, r.y()+r.height()-1, x2, r.y()+r.height()-2); |
|
Lines 4823-4838
Link Here
|
| 4823 |
p->setPen(itsBackgroundCols[STD_BORDER]); |
4883 |
p->setPen(itsBackgroundCols[STD_BORDER]); |
| 4824 |
p->drawPoint(r.x(), r.y()+1); |
4884 |
p->drawPoint(r.x(), r.y()+1); |
| 4825 |
p->drawPoint(r.x()+r.width()-1, r.y()+1); |
4885 |
p->drawPoint(r.x()+r.width()-1, r.y()+1); |
| 4826 |
p->setPen(itsBackgroundCols[0]); |
4886 |
if(!thin) |
| 4827 |
p->drawLine(r.x()+1, r.y()+2, r.x()+1, r.y()); |
4887 |
{ |
| 4828 |
p->setPen(itsBackgroundCols[opts.borderTab ? 0 : FRAME_DARK_SHADOW]); |
4888 |
p->setPen(itsBackgroundCols[0]); |
| 4829 |
p->drawLine(r.x()+r.width()-2, r.y()+1, r.x()+r.width()-2, r.y()); |
4889 |
p->drawLine(r.x()+1, r.y()+2, r.x()+1, r.y()); |
| 4830 |
p->drawPoint(r.x()+r.width()-1, r.y()); |
4890 |
p->setPen(itsBackgroundCols[opts.borderTab ? 0 : FRAME_DARK_SHADOW]); |
|
|
4891 |
p->drawLine(r.x()+r.width()-2, r.y()+1, r.x()+r.width()-2, r.y()); |
| 4892 |
p->drawPoint(r.x()+r.width()-1, r.y()); |
| 4893 |
} |
| 4831 |
} |
4894 |
} |
| 4832 |
else |
4895 |
else |
| 4833 |
{ |
4896 |
{ |
| 4834 |
p->setPen(itsBackgroundCols[opts.borderTab ? 0 : dark]); |
4897 |
if(!thin) |
| 4835 |
p->drawLine(r.x(), r.y(), r.x()+r.width()-1, r.y()); |
4898 |
{ |
|
|
4899 |
p->setPen(itsBackgroundCols[opts.borderTab ? 0 : dark]); |
| 4900 |
p->drawLine(r.x(), r.y(), r.x()+r.width()-1, r.y()); |
| 4901 |
} |
| 4836 |
p->setPen(itsBackgroundCols[STD_BORDER]); |
4902 |
p->setPen(itsBackgroundCols[STD_BORDER]); |
| 4837 |
p->drawLine(r.x(), r.y()+1, r.x()+r.width()-1, r.y()+1); |
4903 |
p->drawLine(r.x(), r.y()+1, r.x()+r.width()-1, r.y()+1); |
| 4838 |
|
4904 |
|
|
Lines 5055-5060
Link Here
|
| 5055 |
if(data.isDefault()) |
5121 |
if(data.isDefault()) |
| 5056 |
break; |
5122 |
break; |
| 5057 |
|
5123 |
|
|
|
5124 |
//const TQPopupMenu *popupmenu((const QPopupMenu *)widget); |
| 5058 |
TQMenuItem *mi(data.menuItem()); |
5125 |
TQMenuItem *mi(data.menuItem()); |
| 5059 |
int tab(data.tabWidth()), |
5126 |
int tab(data.tabWidth()), |
| 5060 |
maxpmw(data.maxIconWidth()), |
5127 |
maxpmw(data.maxIconWidth()), |
|
Lines 5069-5088
Link Here
|
| 5069 |
else |
5136 |
else |
| 5070 |
{ |
5137 |
{ |
| 5071 |
if(IS_FLAT_BGND(opts.menuBgndAppearance)) |
5138 |
if(IS_FLAT_BGND(opts.menuBgndAppearance)) |
| 5072 |
p->fillRect(r, USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol |
5139 |
p->fillRect(r, popupMenuCol(cg)); |
| 5073 |
: itsBackgroundCols[ORIGINAL_SHADE]); |
|
|
| 5074 |
|
5140 |
|
| 5075 |
if(opts.menuStripe) |
5141 |
if(opts.menuStripe) |
| 5076 |
drawBevelGradient(menuStripeCol(), p, |
5142 |
drawBevelGradient(menuStripeCol(cg), p, |
| 5077 |
TQRect(reverse ? r.right()-maxpmw : r.x(), |
5143 |
TQRect(reverse ? r.right()-maxpmw : r.x(), |
| 5078 |
r.y(), maxpmw, r.height()), false, |
5144 |
r.y(), maxpmw, r.height()), false, |
| 5079 |
false, opts.menuStripeAppearance, WIDGET_OTHER); |
5145 |
false, opts.menuStripeAppearance, WIDGET_OTHER); |
| 5080 |
} |
5146 |
} |
| 5081 |
|
5147 |
|
| 5082 |
if((flags&Style_Active) && (flags&Style_Enabled)) |
5148 |
if((flags&Style_Active) && (flags&Style_Enabled)) |
| 5083 |
drawMenuItem(p, r, flags, cg, false, ROUNDED_ALL, |
5149 |
drawMenuItem(p, r, flags, cg, false, ROUNDED_ALL, popupMenuCol(cg), |
| 5084 |
USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol |
|
|
| 5085 |
: itsBackgroundCols[ORIGINAL_SHADE], |
| 5086 |
opts.useHighlightForMenu ? itsHighlightCols : itsBackgroundCols); |
5150 |
opts.useHighlightForMenu ? itsHighlightCols : itsBackgroundCols); |
| 5087 |
|
5151 |
|
| 5088 |
if(!mi) |
5152 |
if(!mi) |
|
Lines 5091-5097
Link Here
|
| 5091 |
if(mi->isSeparator()) |
5155 |
if(mi->isSeparator()) |
| 5092 |
{ |
5156 |
{ |
| 5093 |
y=r.y()+(r.height()>>1); |
5157 |
y=r.y()+(r.height()>>1); |
| 5094 |
p->setPen(itsBackgroundCols[MENU_SEP_SHADE]); |
5158 |
p->setPen(popupMenuCols(cg)[MENU_SEP_SHADE]); |
| 5095 |
p->drawLine(r.x()+3+(!reverse && opts.menuStripe ? maxpmw : 0), y, |
5159 |
p->drawLine(r.x()+3+(!reverse && opts.menuStripe ? maxpmw : 0), y, |
| 5096 |
r.x()+r.width()-4-(reverse && opts.menuStripe ? maxpmw : 0), y); |
5160 |
r.x()+r.width()-4-(reverse && opts.menuStripe ? maxpmw : 0), y); |
| 5097 |
// p->setPen(itsBackgroundCols[0]); |
5161 |
// p->setPen(itsBackgroundCols[0]); |
|
Lines 5667-5677
Link Here
|
| 5667 |
break; |
5731 |
break; |
| 5668 |
bflags|=DW_CLOSE_BUTTON; |
5732 |
bflags|=DW_CLOSE_BUTTON; |
| 5669 |
} |
5733 |
} |
| 5670 |
|
5734 |
|
| 5671 |
if (!tb && !onExtender && (elementFlags & CEF_HasParentWidget) && |
5735 |
if (!tb && !onExtender && (elementFlags & CEF_HasParentWidget) && |
| 5672 |
!qstrcmp(ceData.parentWidgetData.name.ascii(), "qt_maxcontrols")) |
5736 |
!qstrcmp(ceData.parentWidgetData.name.ascii(), "qt_maxcontrols")) |
| 5673 |
onControlButtons = true; |
5737 |
onControlButtons = true; |
| 5674 |
|
5738 |
|
|
|
5739 |
int round(ROUNDED_ALL), leftAdjust(0), topAdjust(0), rightAdjust(0), bottomAdjust(0); |
| 5740 |
bool horizTBar(true), |
| 5741 |
raised(!onControlButtons && (TBTN_RAISED==opts.tbarBtns || TBTN_JOINED==opts.tbarBtns)); |
| 5742 |
|
| 5743 |
if(raised) |
| 5744 |
{ |
| 5745 |
if(tb) |
| 5746 |
{ |
| 5747 |
if(TBTN_JOINED==opts.tbarBtns) |
| 5748 |
{ |
| 5749 |
horizTBar=Qt::Horizontal==tb->orientation(); |
| 5750 |
adjustToolbarButtons(widget, tb, leftAdjust, topAdjust, rightAdjust, bottomAdjust, round); |
| 5751 |
} |
| 5752 |
} |
| 5753 |
else |
| 5754 |
raised=false; |
| 5755 |
} |
| 5756 |
|
| 5675 |
if(active & SC_ToolButton) |
5757 |
if(active & SC_ToolButton) |
| 5676 |
bflags |=Style_Down; |
5758 |
bflags |=Style_Down; |
| 5677 |
if(active & SC_ToolButtonMenu) |
5759 |
if(active & SC_ToolButtonMenu) |
|
Lines 5688-5697
Link Here
|
| 5688 |
|
5770 |
|
| 5689 |
// If we're pressed, on, or raised... |
5771 |
// If we're pressed, on, or raised... |
| 5690 |
#if defined TQTC_TQT_ONLY || !defined TDE_VERSION |
5772 |
#if defined TQTC_TQT_ONLY || !defined TDE_VERSION |
| 5691 |
if(bflags &(Style_Down | Style_On | Style_Raised) || onControlButtons) |
5773 |
if(bflags &(Style_Down | Style_On | Style_Raised) || onControlButtons || raised) |
| 5692 |
#else |
5774 |
#else |
| 5693 |
if(bflags &(Style_Down | Style_On | Style_Raised | Style_MouseOver) || |
5775 |
if(bflags &(Style_Down | Style_On | Style_Raised | Style_MouseOver) || onControlButtons || raised) |
| 5694 |
onControlButtons) |
|
|
| 5695 |
#endif |
5776 |
#endif |
| 5696 |
{ |
5777 |
{ |
| 5697 |
//Make sure the standalone toolbuttons have a gradient in the right direction |
5778 |
//Make sure the standalone toolbuttons have a gradient in the right direction |
|
Lines 5707-5716
Link Here
|
| 5707 |
} |
5788 |
} |
| 5708 |
} |
5789 |
} |
| 5709 |
|
5790 |
|
|
|
5791 |
if(raised && TBTN_JOINED==opts.tbarBtns && !horizTBar) |
| 5792 |
bflags &= ~Style_Horizontal; |
| 5793 |
|
| 5710 |
if(elementFlags & CEF_BiState) |
5794 |
if(elementFlags & CEF_BiState) |
| 5711 |
bflags|=TOGGLE_BUTTON; |
5795 |
bflags|=TOGGLE_BUTTON; |
| 5712 |
|
5796 |
|
| 5713 |
drawPrimitive(PE_ButtonTool, p, ceData, elementFlags, button, cg, bflags, data); |
5797 |
const TQColor *use(buttonColors(cg)); |
|
|
5798 |
|
| 5799 |
TQRect btnRect(r); |
| 5800 |
|
| 5801 |
btnRect.addCoords(leftAdjust, topAdjust, rightAdjust, bottomAdjust); |
| 5802 |
drawLightBevel(cg.background(), p, btnRect, cg, bflags, round, getFill(bflags, use), use, true, true, WIDGET_STD_BUTTON); |
| 5803 |
|
| 5804 |
if(raised && TBTN_JOINED==opts.tbarBtns) |
| 5805 |
{ |
| 5806 |
const int constSpace=opts.fadeLines ? 7 : 4; |
| 5807 |
|
| 5808 |
p->setPen(use[0]); |
| 5809 |
if(leftAdjust) |
| 5810 |
p->drawLine(r.x(), r.y()+constSpace, r.x(), r.height()-(constSpace+1)); |
| 5811 |
if(topAdjust) |
| 5812 |
p->drawLine(r.x()+constSpace, r.y(), r.width()-(constSpace+1), r.y()); |
| 5813 |
p->setPen(use[STD_BORDER]); |
| 5814 |
if(rightAdjust) |
| 5815 |
p->drawLine(r.x()+r.width()-1, r.y()+constSpace, r.x()+r.width()-1, r.height()-(constSpace+1)); |
| 5816 |
if(bottomAdjust) |
| 5817 |
p->drawLine(r.x()+constSpace, r.y()+r.height()-1, r.width()-(constSpace+1), r.y()+r.height()-1); |
| 5818 |
} |
| 5819 |
//drawPrimitive(PE_ButtonTool, p, button, cg, bflags, data); |
| 5714 |
} |
5820 |
} |
| 5715 |
|
5821 |
|
| 5716 |
// Check whether to draw a background pixmap |
5822 |
// Check whether to draw a background pixmap |
|
Lines 5956-5962
Link Here
|
| 5956 |
{ |
6062 |
{ |
| 5957 |
bool glowFocus(USE_GLOW_FOCUS(flags&Style_MouseOver) && flags&Style_HasFocus && flags&Style_Enabled); |
6063 |
bool glowFocus(USE_GLOW_FOCUS(flags&Style_MouseOver) && flags&Style_HasFocus && flags&Style_Enabled); |
| 5958 |
|
6064 |
|
| 5959 |
if(!sunken && !editable && |
6065 |
if(!sunken && !editable && !(opts.thin&THIN_FRAMES) && |
| 5960 |
((MO_GLOW==opts.coloredMouseOver && flags&Style_MouseOver)/* || |
6066 |
((MO_GLOW==opts.coloredMouseOver && flags&Style_MouseOver)/* || |
| 5961 |
(FOCUS_FULL==opts.focus && flags&Style_HasFocus)*/ || glowFocus)) |
6067 |
(FOCUS_FULL==opts.focus && flags&Style_HasFocus)*/ || glowFocus)) |
| 5962 |
drawGlow(p, widget ? TQT_TQRECT_OBJECT(ceData.rect) : r, cg, WIDGET_COMBO, glowFocus ? itsFocusCols : NULL); |
6068 |
drawGlow(p, widget ? TQT_TQRECT_OBJECT(ceData.rect) : r, cg, WIDGET_COMBO, glowFocus ? itsFocusCols : NULL); |
|
Lines 5973-5978
Link Here
|
| 5973 |
{ |
6079 |
{ |
| 5974 |
itsFormMode = isFormWidget(widget); |
6080 |
itsFormMode = isFormWidget(widget); |
| 5975 |
|
6081 |
|
|
|
6082 |
//const TQSpinWidget *spinwidget((const QSpinWidget *)widget); |
| 5976 |
TQRect frame(querySubControlMetrics(CC_SpinWidget, ceData, elementFlags, SC_SpinWidgetFrame, |
6083 |
TQRect frame(querySubControlMetrics(CC_SpinWidget, ceData, elementFlags, SC_SpinWidgetFrame, |
| 5977 |
data, widget)), |
6084 |
data, widget)), |
| 5978 |
up(ceData.spinWidgetData.upRect), |
6085 |
up(ceData.spinWidgetData.upRect), |
|
Lines 6909-6930
Link Here
|
| 6909 |
w=constMinW; |
7016 |
w=constMinW; |
| 6910 |
} |
7017 |
} |
| 6911 |
|
7018 |
|
| 6912 |
return TQSize(w, contentsSize.height() + margin+(DO_EFFECT && !isFormWidget(widget) && !opts.thinnerBtns |
7019 |
return TQSize(w, contentsSize.height() + margin+(DO_EFFECT && !isFormWidget(widget) && !(opts.thin&THIN_BUTTONS) ? 6 : 4)); |
| 6913 |
? 6 : 4)); |
|
|
| 6914 |
} |
7020 |
} |
| 6915 |
break; |
7021 |
break; |
| 6916 |
} |
7022 |
} |
| 6917 |
case CT_ComboBox: |
7023 |
case CT_ComboBox: |
| 6918 |
{ |
7024 |
{ |
| 6919 |
TQSize sz(BASE_STYLE::sizeFromContents(contents, ceData, elementFlags, contentsSize, data, widget)); |
7025 |
TQSize sz(BASE_STYLE::sizeFromContents(contents, ceData, elementFlags, contentsSize, data, widget)); |
| 6920 |
return TQSize(sz.width(), sz.height()+(DO_EFFECT && !isFormWidget(widget) && !opts.thinnerBtns ? 4 : 2)); |
7026 |
return TQSize(sz.width(), sz.height()+(DO_EFFECT && !isFormWidget(widget) && !(opts.thin&THIN_BUTTONS) ? 4 : 2)); |
| 6921 |
} |
7027 |
} |
| 6922 |
case CT_PopupMenuItem: |
7028 |
case CT_PopupMenuItem: |
| 6923 |
{ |
7029 |
{ |
| 6924 |
if (!widget || data.isDefault()) |
7030 |
if (!widget || data.isDefault()) |
| 6925 |
break; |
7031 |
break; |
| 6926 |
|
7032 |
|
| 6927 |
const int constMinH(opts.thinnerMenuItems ? 25 : 27); |
7033 |
const int constMinH((opts.thin&THIN_MENU_ITEMS) ? 25 : 27); |
| 6928 |
|
7034 |
|
| 6929 |
TQMenuItem *mi(data.menuItem()); |
7035 |
TQMenuItem *mi(data.menuItem()); |
| 6930 |
int maxpmw(data.maxIconWidth()), |
7036 |
int maxpmw(data.maxIconWidth()), |
|
Lines 6956-6962
Link Here
|
| 6956 |
h = TQMAX(h, TQFontMetrics(ceData.font).height() + 2); |
7062 |
h = TQMAX(h, TQFontMetrics(ceData.font).height() + 2); |
| 6957 |
if (mi->iconSet()!= 0) |
7063 |
if (mi->iconSet()!= 0) |
| 6958 |
h = TQMAX(h, mi->iconSet()->pixmap(TQIconSet::Small, TQIconSet::Normal).height()); |
7064 |
h = TQMAX(h, mi->iconSet()->pixmap(TQIconSet::Small, TQIconSet::Normal).height()); |
| 6959 |
h+=(opts.thinnerMenuItems ? 2 : 4); |
7065 |
h+=((opts.thin&THIN_MENU_ITEMS) ? 2 : 4); |
| 6960 |
} |
7066 |
} |
| 6961 |
|
7067 |
|
| 6962 |
// check | 4 pixels | item | 8 pixels | accel | 4 pixels | check |
7068 |
// check | 4 pixels | item | 8 pixels | accel | 4 pixels | check |
|
Lines 7181-7192
Link Here
|
| 7181 |
if(ROUNDED) |
7287 |
if(ROUNDED) |
| 7182 |
{ |
7288 |
{ |
| 7183 |
main.addCoords(-1, -1, 1, 1); |
7289 |
main.addCoords(-1, -1, 1, 1); |
| 7184 |
drawBorder(USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol : itsBackgroundCols[ORIGINAL_SHADE], p, main, |
7290 |
drawBorder(popupMenuCol(cg), p, main, cg, Style_Horizontal|Style_Raised, reverse ? ROUNDED_RIGHT : ROUNDED_LEFT, |
| 7185 |
cg, Style_Horizontal|Style_Raised, reverse ? ROUNDED_RIGHT : ROUNDED_LEFT, |
|
|
| 7186 |
cols, WIDGET_MENU_ITEM, false, BORDER_FLAT, false, fill); |
7291 |
cols, WIDGET_MENU_ITEM, false, BORDER_FLAT, false, fill); |
| 7187 |
} |
7292 |
} |
| 7188 |
|
7293 |
|
| 7189 |
TQColor bgnd(USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol : itsBackgroundCols[ORIGINAL_SHADE]); |
7294 |
TQColor bgnd(popupMenuCol(cg)); |
| 7190 |
drawGradient(reverse ? bgnd : cols[fill], reverse ? cols[fill] : bgnd, p, fade, false); |
7295 |
drawGradient(reverse ? bgnd : cols[fill], reverse ? cols[fill] : bgnd, p, fade, false); |
| 7191 |
} |
7296 |
} |
| 7192 |
else if(mbi || opts.borderMenuitems) |
7297 |
else if(mbi || opts.borderMenuitems) |
|
Lines 7785-7791
Link Here
|
| 7785 |
void QtCurveStyle::drawMenuOrToolBarBackground(TQPainter *p, const TQRect &r, const TQColorGroup &cg, |
7890 |
void QtCurveStyle::drawMenuOrToolBarBackground(TQPainter *p, const TQRect &r, const TQColorGroup &cg, |
| 7786 |
bool menu, bool horiz) const |
7891 |
bool menu, bool horiz) const |
| 7787 |
{ |
7892 |
{ |
| 7788 |
if(menu && APPEARANCE_STRIPED==opts.bgndAppearance && IS_FLAT(opts.menubarAppearance) && SHADE_NONE==opts.shadeMenubars) |
7893 |
if(menu && (APPEARANCE_STRIPED==opts.bgndAppearance || APPEARANCE_FILE==opts.bgndAppearance) && |
|
|
7894 |
IS_FLAT(opts.menubarAppearance) && SHADE_NONE==opts.shadeMenubars) |
| 7789 |
return; |
7895 |
return; |
| 7790 |
|
7896 |
|
| 7791 |
TQRect rx(r); |
7897 |
TQRect rx(r); |
|
Lines 7889-7894
Link Here
|
| 7889 |
return itsButtonCols; |
7995 |
return itsButtonCols; |
| 7890 |
} |
7996 |
} |
| 7891 |
|
7997 |
|
|
|
7998 |
const TQColor * QtCurveStyle::popupMenuCols(const TQColorGroup &cg) const |
| 7999 |
{ |
| 8000 |
return opts.shadePopupMenu ? menuColors(cg, true) : backgroundColors(cg); |
| 8001 |
} |
| 8002 |
|
| 8003 |
const TQColor & QtCurveStyle::popupMenuCol(const TQColorGroup &cg, int shade) const |
| 8004 |
{ |
| 8005 |
return opts.shadePopupMenu |
| 8006 |
? menuColors(cg, true)[ORIGINAL_SHADE] |
| 8007 |
: USE_LIGHTER_POPUP_MENU |
| 8008 |
? itsLighterPopupMenuBgndCol |
| 8009 |
: itsBackgroundCols[shade]; |
| 8010 |
} |
| 8011 |
|
| 7892 |
const TQColor * QtCurveStyle::checkRadioColors(const TQColorGroup &cg, SFlags flags) const |
8012 |
const TQColor * QtCurveStyle::checkRadioColors(const TQColorGroup &cg, SFlags flags) const |
| 7893 |
{ |
8013 |
{ |
| 7894 |
return opts.crColor && flags&Style_Enabled && (flags&Style_On || !(flags&Style_Off)) |
8014 |
return opts.crColor && flags&Style_Enabled && (flags&Style_On || !(flags&Style_Off)) |
|
Lines 7968-7973
Link Here
|
| 7968 |
} |
8088 |
} |
| 7969 |
} |
8089 |
} |
| 7970 |
|
8090 |
|
|
|
8091 |
void QtCurveStyle::setMenuTextColors(TQWidget *widget, bool isMenuBar) const |
| 8092 |
{ |
| 8093 |
if(SHADE_WINDOW_BORDER==opts.shadeMenubars) |
| 8094 |
{ |
| 8095 |
TQPalette pal(widget->palette()); |
| 8096 |
|
| 8097 |
getMdiColors(pal.active(), false); |
| 8098 |
|
| 8099 |
pal.setBrush(TQPalette::Active, TQColorGroup::Foreground, itsActiveMdiTextColor); |
| 8100 |
pal.setBrush(TQPalette::Active, TQColorGroup::Text, pal.brush(TQPalette::Active, TQColorGroup::Foreground)); |
| 8101 |
if(isMenuBar) |
| 8102 |
{ |
| 8103 |
pal.setBrush(TQPalette::Inactive, TQColorGroup::Foreground, |
| 8104 |
opts.shadeMenubarOnlyWhenActive ? itsMdiTextColor : itsActiveMdiTextColor); |
| 8105 |
pal.setBrush(TQPalette::Inactive, TQColorGroup::Text, pal.brush(TQPalette::Inactive, TQColorGroup::Foreground)); |
| 8106 |
} |
| 8107 |
else if(opts.shadePopupMenu) |
| 8108 |
{ |
| 8109 |
pal.setBrush(TQPalette::Disabled, TQColorGroup::Foreground, midColor(itsActiveMdiTextColor, popupMenuCol(pal.active()))); |
| 8110 |
pal.setBrush(TQPalette::Disabled, TQColorGroup::Text, pal.brush(TQPalette::Disabled, TQColorGroup::Foreground)); |
| 8111 |
} |
| 8112 |
|
| 8113 |
widget->setPalette(pal); |
| 8114 |
} |
| 8115 |
else if(opts.customMenuTextColor || SHADE_BLEND_SELECTED==opts.shadeMenubars || |
| 8116 |
SHADE_SELECTED==opts.shadeMenubars || |
| 8117 |
(SHADE_CUSTOM==opts.shadeMenubars && TOO_DARK(itsMenubarCols[ORIGINAL_SHADE]))) |
| 8118 |
{ |
| 8119 |
TQPalette pal(widget->palette()); |
| 8120 |
|
| 8121 |
pal.setBrush(TQPalette::Active, TQColorGroup::Foreground, opts.customMenuTextColor |
| 8122 |
? opts.customMenuNormTextColor |
| 8123 |
: pal.active().highlightedText()); |
| 8124 |
pal.setBrush(TQPalette::Active, TQColorGroup::Text, pal.brush(TQPalette::Active, TQColorGroup::Foreground)); |
| 8125 |
|
| 8126 |
if(isMenuBar && !opts.shadeMenubarOnlyWhenActive) |
| 8127 |
{ |
| 8128 |
pal.setBrush(TQPalette::Inactive, TQColorGroup::Foreground, opts.customMenuTextColor |
| 8129 |
? opts.customMenuNormTextColor |
| 8130 |
: pal.active().highlightedText()); |
| 8131 |
pal.setBrush(TQPalette::Inactive, TQColorGroup::Text, pal.brush(TQPalette::Inactive, TQColorGroup::Foreground)); |
| 8132 |
} |
| 8133 |
else if(!isMenuBar && opts.shadePopupMenu) |
| 8134 |
{ |
| 8135 |
pal.setBrush(TQPalette::Disabled, TQColorGroup::Foreground, |
| 8136 |
midColor(pal.brush(TQPalette::Active, TQColorGroup::Foreground).color(), popupMenuCol(pal.active()))); |
| 8137 |
pal.setBrush(TQPalette::Disabled, TQColorGroup::Text, pal.brush(TQPalette::Disabled, TQColorGroup::Foreground)); |
| 8138 |
} |
| 8139 |
widget->setPalette(pal); |
| 8140 |
} |
| 8141 |
} |
| 8142 |
|
| 7971 |
const TQColor * QtCurveStyle::menuColors(const TQColorGroup &cg, bool active) const |
8143 |
const TQColor * QtCurveStyle::menuColors(const TQColorGroup &cg, bool active) const |
| 7972 |
{ |
8144 |
{ |
| 7973 |
return SHADE_WINDOW_BORDER==opts.shadeMenubars |
8145 |
return SHADE_WINDOW_BORDER==opts.shadeMenubars |
|
Lines 8102-8109
Link Here
|
| 8102 |
} |
8274 |
} |
| 8103 |
} |
8275 |
} |
| 8104 |
|
8276 |
|
| 8105 |
if(itsMdiColors && opts.shadeMenubarOnlyWhenActive && SHADE_WINDOW_BORDER==opts.shadeMenubars && |
8277 |
if(opts.shadeMenubarOnlyWhenActive && SHADE_WINDOW_BORDER==opts.shadeMenubars && |
| 8106 |
itsActiveMdiColors[ORIGINAL_SHADE]==itsMdiColors[ORIGINAL_SHADE]) |
8278 |
itsActiveMdiColors && itsMdiColors && itsActiveMdiColors[ORIGINAL_SHADE]==itsMdiColors[ORIGINAL_SHADE]) |
| 8107 |
opts.shadeMenubarOnlyWhenActive=false; |
8279 |
opts.shadeMenubarOnlyWhenActive=false; |
| 8108 |
|
8280 |
|
| 8109 |
if(!itsActiveMdiColors) { |
8281 |
if(!itsActiveMdiColors) { |
|
Lines 8427-8433
Link Here
|
| 8427 |
: use[2]; |
8599 |
: use[2]; |
| 8428 |
} |
8600 |
} |
| 8429 |
|
8601 |
|
| 8430 |
const TQColor & QtCurveStyle::menuStripeCol() const |
8602 |
const TQColor & QtCurveStyle::menuStripeCol(const TQColorGroup &cg) const |
| 8431 |
{ |
8603 |
{ |
| 8432 |
switch(opts.menuStripe) |
8604 |
switch(opts.menuStripe) |
| 8433 |
{ |
8605 |
{ |
|
Lines 8439-8455
Link Here
|
| 8439 |
case SHADE_BLEND_SELECTED: |
8611 |
case SHADE_BLEND_SELECTED: |
| 8440 |
// Hack! Use opts.customMenuStripeColor to store this setting! |
8612 |
// Hack! Use opts.customMenuStripeColor to store this setting! |
| 8441 |
if(IS_BLACK(opts.customMenuStripeColor)) |
8613 |
if(IS_BLACK(opts.customMenuStripeColor)) |
| 8442 |
opts.customMenuStripeColor=midColor(itsHighlightCols[ORIGINAL_SHADE], |
8614 |
opts.customMenuStripeColor=midColor(itsHighlightCols[ORIGINAL_SHADE], popupMenuCol(cg)); |
| 8443 |
opts.lighterPopupMenuBgnd<0 |
|
|
| 8444 |
? itsLighterPopupMenuBgndCol |
| 8445 |
: itsBackgroundCols[ORIGINAL_SHADE]); |
| 8446 |
return opts.customMenuStripeColor; |
8615 |
return opts.customMenuStripeColor; |
| 8447 |
case SHADE_SELECTED: |
8616 |
case SHADE_SELECTED: |
| 8448 |
return itsHighlightCols[MENU_STRIPE_SHADE]; |
8617 |
return itsHighlightCols[MENU_STRIPE_SHADE]; |
| 8449 |
case SHADE_DARKEN: |
8618 |
case SHADE_DARKEN: |
| 8450 |
return USE_LIGHTER_POPUP_MENU |
8619 |
return popupMenuCol(cg); |
| 8451 |
? itsLighterPopupMenuBgndCol |
|
|
| 8452 |
: itsBackgroundCols[MENU_STRIPE_SHADE]; |
| 8453 |
} |
8620 |
} |
| 8454 |
} |
8621 |
} |
| 8455 |
|
8622 |
|