Repair menu icon handling

Various control and primitive fixes
r14.0.x
Timothy Pearson 13 years ago
parent 5374f02e91
commit d4b531e2cc

@ -56,6 +56,7 @@
#include <kcmdlineargs.h> #include <kcmdlineargs.h>
#include <kaboutdata.h> #include <kaboutdata.h>
#include <kicontheme.h> #include <kicontheme.h>
#include <kiconloader.h>
#endif #endif
#define DEBUG_WARNINGS 1 #define DEBUG_WARNINGS 1
@ -125,50 +126,67 @@ inline TQString convertQt4ToTQt3String(QString qt4string)
return TQString::fromUtf8(qt4string.toUtf8().data()); return TQString::fromUtf8(qt4string.toUtf8().data());
} }
inline TQIconSet convertQt4ToTQt3IconSet(QIcon qt4icon) inline TQIconSet convertQt4ToTQt3IconSet(QIcon qt4icon, int smallsize, int largesize)
{ {
int i=0; int i=0;
int j=0; int j=0;
int k=0;
QIcon::Mode qt4iconmode; QIcon::Mode qt4iconmode;
TQIconSet::Mode tqt3iconmode; TQIconSet::Mode tqt3iconmode;
QIcon::State qt4iconstate; QIcon::State qt4iconstate;
TQIconSet::State tqt3iconstate; TQIconSet::State tqt3iconstate;
TQIconSet::Size tqt3iconsize;
TQSize tqt3iconsized;
TQIconSet tqt3iconset; TQIconSet tqt3iconset;
// Get the maximum icon size stored in the QIcon and generate a pixmap of that size // Generate all required sizes of icon from the TQt3 settings
QSize qt4size = qt4icon.actualSize(QSize(32768,32768)); TQSize smallIconSize(smallsize, smallsize);
TQSize largeIconSize(largesize, largesize);
for (i=0;i<3;i++) { for (i=0;i<3;i++) {
for (j=0;j<2;j++) { for (j=0;j<2;j++) {
if (i==0) { for (k=0;k<2;k++) {
qt4iconmode = QIcon::Normal; if (i==0) {
tqt3iconmode = TQIconSet::Normal; qt4iconmode = QIcon::Normal;
} tqt3iconmode = TQIconSet::Normal;
if (i==1) { }
qt4iconmode = QIcon::Disabled; if (i==1) {
tqt3iconmode = TQIconSet::Disabled; qt4iconmode = QIcon::Disabled;
} tqt3iconmode = TQIconSet::Disabled;
if (i==2) { }
qt4iconmode = QIcon::Active; if (i==2) {
tqt3iconmode = TQIconSet::Active; qt4iconmode = QIcon::Active;
} tqt3iconmode = TQIconSet::Active;
if (j==0) { }
qt4iconstate = QIcon::On; if (j==0) {
tqt3iconstate = TQIconSet::On; qt4iconstate = QIcon::On;
} tqt3iconstate = TQIconSet::On;
if (j==1) { }
qt4iconstate = QIcon::Off; if (j==1) {
tqt3iconstate = TQIconSet::Off; qt4iconstate = QIcon::Off;
tqt3iconstate = TQIconSet::Off;
}
if (k==0) {
tqt3iconsize = TQIconSet::Small;
tqt3iconsized = smallIconSize;
}
if (k==1) {
tqt3iconsize = TQIconSet::Large;
tqt3iconsized = largeIconSize;
}
QPixmap qt4iconpm = qt4icon.pixmap(QSize(tqt3iconsized.width(), tqt3iconsized.height()), qt4iconmode, qt4iconstate);
TQPixmap tqtPM(qt4iconpm.width(), qt4iconpm.height(), qt4iconpm.depth());
QPixmap qtPM = QPixmap::fromX11Pixmap(tqtPM.handle(), QPixmap::ExplicitlyShared);
qtPM.fill(Qt::transparent);
QPainter qt4painter(&qtPM);
qt4painter.drawPixmap(0, 0, qt4iconpm);
qt4painter.end();
tqt3iconset.setPixmap(tqtPM, tqt3iconsize, tqt3iconmode, tqt3iconstate);
} }
QPixmap qt4iconpm = qt4icon.pixmap(qt4size, qt4iconmode, qt4iconstate);
TQPixmap tqtPM(qt4iconpm.width(), qt4iconpm.height(), qt4iconpm.depth());
QPixmap qtPM = QPixmap::fromX11Pixmap(tqtPM.handle(), QPixmap::ExplicitlyShared);
QPainter qt4painter(&qtPM);
qt4painter.drawPixmap(0, 0, qt4iconpm);
qt4painter.end();
tqt3iconset.setPixmap(tqtPM, TQIconSet::Automatic, tqt3iconmode, tqt3iconstate);
} }
} }
@ -183,6 +201,8 @@ inline TQPixmap convertQt4ToTQt3Pixmap(QIcon qt4icon)
QPixmap qt4iconpm = qt4icon.pixmap(qt4size); QPixmap qt4iconpm = qt4icon.pixmap(qt4size);
TQPixmap tqtPM(qt4iconpm.width(), qt4iconpm.height(), qt4iconpm.depth()); TQPixmap tqtPM(qt4iconpm.width(), qt4iconpm.height(), qt4iconpm.depth());
QPixmap qtPM = QPixmap::fromX11Pixmap(tqtPM.handle(), QPixmap::ExplicitlyShared); QPixmap qtPM = QPixmap::fromX11Pixmap(tqtPM.handle(), QPixmap::ExplicitlyShared);
qtPM.fill(Qt::transparent);
QPainter qt4painter(&qtPM); QPainter qt4painter(&qtPM);
qt4painter.drawPixmap(0, 0, qt4iconpm); qt4painter.drawPixmap(0, 0, qt4iconpm);
qt4painter.end(); qt4painter.end();
@ -561,7 +581,7 @@ inline TQStyle::SFlags convertQt4ToTQt3SFlags(QStyle::State qt4stateflags, TQt3W
} }
#define NO_QT3_EQUIVALENT can_override = false; #define NO_QT3_EQUIVALENT can_override = false;
#define DO_NOT_DRAW can_override = false; do_not_draw = true; #define DO_NOT_DRAW can_override = true; do_not_draw = true;
SimpleStyle::SimpleStyle() SimpleStyle::SimpleStyle()
{ {
@ -588,12 +608,50 @@ SimpleStyle::SimpleStyle()
// Set the Qt4 icon set to the TDE icon set // Set the Qt4 icon set to the TDE icon set
QIcon::setThemeName(convertTQt3ToQt4String(KIconTheme::current())); QIcon::setThemeName(convertTQt3ToQt4String(KIconTheme::current()));
// Set up Qt4 size hints to match the TDE sizes
// FIXME
// m_tqt3IconSize_MenuItem and m_tqt3IconSize_Large are still hardcoded
// Verify all mappings
m_tqt3IconSize_NoGroup = IconSize(KIcon::NoGroup);
m_tqt3IconSize_Desktop = IconSize(KIcon::Desktop);
m_tqt3IconSize_FirstGroup = IconSize(KIcon::FirstGroup);
m_tqt3IconSize_Toolbar = IconSize(KIcon::Toolbar);
m_tqt3IconSize_MainToolbar = IconSize(KIcon::MainToolbar);
m_tqt3IconSize_Small = IconSize(KIcon::Small);
m_tqt3IconSize_Large = 32;
m_tqt3IconSize_Panel = IconSize(KIcon::Panel);
m_tqt3IconSize_LastGroup = IconSize(KIcon::LastGroup);
m_tqt3IconSize_User = IconSize(KIcon::User);
m_tqt3IconSize_MenuItem = 16;
m_tqt3IconSize_Tabbar = m_tqt3IconSize_MenuItem;
m_tqt3IconSize_Listview = m_tqt3IconSize_MenuItem;
m_tqt3IconSize_Button = m_tqt3IconSize_MenuItem;
#else // INTEGRATE_WITH_TDE #else // INTEGRATE_WITH_TDE
if (!tqApp) { if (!tqApp) {
// Qt4 can be SO STUPID sometimes...why can't I get the X11 display directly from qApp?!?!?? // Qt4 can be SO STUPID sometimes...why can't I get the X11 display directly from qApp?!?!??
QWidget myhackedwidget; QWidget myhackedwidget;
new TQApplication(myhackedwidget.x11Info().display()); new TQApplication(myhackedwidget.x11Info().display());
} }
// Set up Qt4 size hints to match the hardcoded TQt3 sizes
// FIXME
// Verify all mappings
m_tqt3IconSize_NoGroup = 32;
m_tqt3IconSize_Desktop = 32;
m_tqt3IconSize_FirstGroup = m_tqt3IconSize_NoGroup;
m_tqt3IconSize_Toolbar = 22;
m_tqt3IconSize_MainToolbar = 22;
m_tqt3IconSize_Small = 22; // Hardcoded in TQt3 qiconset.cpp:56
m_tqt3IconSize_Large = 32; // Hardcoded in TQt3 qiconset.cpp:56
m_tqt3IconSize_Panel = 22;
m_tqt3IconSize_LastGroup = m_tqt3IconSize_NoGroup;
m_tqt3IconSize_User = m_tqt3IconSize_NoGroup;
m_tqt3IconSize_MenuItem = 16;
m_tqt3IconSize_Tabbar = m_tqt3IconSize_MenuItem;
m_tqt3IconSize_Listview = m_tqt3IconSize_MenuItem;
m_tqt3IconSize_Button = m_tqt3IconSize_MenuItem;
#endif // INTEGRATE_WITH_TDE #endif // INTEGRATE_WITH_TDE
// Set the Qt4 palette to the TQt3 palette // Set the Qt4 palette to the TQt3 palette
@ -998,20 +1056,40 @@ int SimpleStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const
tqt3pixelmetric = TQStyle::PM_HeaderMargin; tqt3pixelmetric = TQStyle::PM_HeaderMargin;
retswitch = 1; retswitch = 1;
break; break;
// case QStyle::PM_SpinBoxSliderHeight: case QStyle::PM_ToolBarIconSize:
// tqt3pixelmetric = TQStyle::PM_SpinBoxSliderHeight; retval = m_tqt3IconSize_Toolbar;
// retswitch = 1; retswitch = 2;
// break; break;
// case QStyle::PM_ToolBarIconSize: case QStyle::PM_SmallIconSize:
// tqt3pixelmetric = TQStyle::PM_ToolBarIconSize; retval = m_tqt3IconSize_Small;
// retswitch = 1; retswitch = 2;
// break; break;
// case QStyle::PM_SmallIconSize: case QStyle::PM_LargeIconSize:
// tqt3pixelmetric = TQStyle::PM_SmallIconSize; retval = m_tqt3IconSize_Large;
retswitch = 2;
break;
case QStyle::PM_TabBarIconSize:
retval = m_tqt3IconSize_Tabbar;
retswitch = 2;
break;
case QStyle::PM_IconViewIconSize:
retval = m_tqt3IconSize_Desktop;
retswitch = 2;
break;
case QStyle::PM_ListViewIconSize:
retval = m_tqt3IconSize_Listview;
retswitch = 2;
break;
case QStyle::PM_ButtonIconSize:
retval = m_tqt3IconSize_Button;
retswitch = 2;
break;
// case QStyle::PM_MessageBoxIconSize:
// tqt3pixelmetric = TQStyle::PM_MessageBoxIconSize;
// retswitch = 1; // retswitch = 1;
// break; // break;
// case QStyle::PM_LargeIconSize: // case QStyle::PM_SpinBoxSliderHeight:
// tqt3pixelmetric = TQStyle::PM_LargeIconSize; // tqt3pixelmetric = TQStyle::PM_SpinBoxSliderHeight;
// retswitch = 1; // retswitch = 1;
// break; // break;
// case QStyle::PM_FocusFrameHMargin: // case QStyle::PM_FocusFrameHMargin:
@ -1022,14 +1100,6 @@ int SimpleStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const
// tqt3pixelmetric = TQStyle::PM_FocusFrameVMargin; // tqt3pixelmetric = TQStyle::PM_FocusFrameVMargin;
// retswitch = 1; // retswitch = 1;
// break; // break;
// case QStyle::PM_IconViewIconSize:
// tqt3pixelmetric = TQStyle::PM_IconViewIconSize;
// retswitch = 1;
// break;
// case QStyle::PM_ListViewIconSize:
// tqt3pixelmetric = TQStyle::PM_ListViewIconSize;
// retswitch = 1;
// break;
// case QStyle::PM_ToolTipLabelFrameWidth: // case QStyle::PM_ToolTipLabelFrameWidth:
// tqt3pixelmetric = TQStyle::PM_ToolTipLabelFrameWidth; // tqt3pixelmetric = TQStyle::PM_ToolTipLabelFrameWidth;
// retswitch = 1; // retswitch = 1;
@ -1042,22 +1112,10 @@ int SimpleStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const
// tqt3pixelmetric = TQStyle::PM_RadioButtonLabelSpacing; // tqt3pixelmetric = TQStyle::PM_RadioButtonLabelSpacing;
// retswitch = 1; // retswitch = 1;
// break; // break;
// case QStyle::PM_TabBarIconSize:
// tqt3pixelmetric = TQStyle::PM_TabBarIconSize;
// retswitch = 1;
// break;
// case QStyle::PM_SizeGripSize: // case QStyle::PM_SizeGripSize:
// tqt3pixelmetric = TQStyle::PM_SizeGripSize; // tqt3pixelmetric = TQStyle::PM_SizeGripSize;
// retswitch = 1; // retswitch = 1;
// break; // break;
// case QStyle::PM_MessageBoxIconSize:
// tqt3pixelmetric = TQStyle::PM_MessageBoxIconSize;
// retswitch = 1;
// break;
// case QStyle::PM_ButtonIconSize:
// tqt3pixelmetric = TQStyle::PM_ButtonIconSize;
// retswitch = 1;
// break;
// case QStyle::PM_TextCursorWidth: // case QStyle::PM_TextCursorWidth:
// tqt3pixelmetric = TQStyle::PM_TextCursorWidth; // tqt3pixelmetric = TQStyle::PM_TextCursorWidth;
// retswitch = 1; // retswitch = 1;
@ -1162,7 +1220,7 @@ TQWidget* SimpleStyle::initializeInterfaceWidget(TQt3WidgetType wt, const QWidge
newTab->setIdentifier(i); newTab->setIdentifier(i);
} }
else { else {
TQTab* newTab = new TQTab(convertQt4ToTQt3IconSet(qt4tabbar_widget->tabIcon(i)), convertQt4ToTQt3String(qt4tabbar_widget->tabText(i))); TQTab* newTab = new TQTab(convertQt4ToTQt3IconSet(qt4tabbar_widget->tabIcon(i), m_tqt3IconSize_Small, m_tqt3IconSize_Large), convertQt4ToTQt3String(qt4tabbar_widget->tabText(i)));
m_tqt3tabbar_widget->insertTab(newTab, i); m_tqt3tabbar_widget->insertTab(newTab, i);
newTab->setIdentifier(i); newTab->setIdentifier(i);
} }
@ -1248,7 +1306,7 @@ TQWidget* SimpleStyle::initializeInterfaceWidget(TQt3WidgetType wt, const QWidge
m_tqt3popupmenu_widget->insertItem(convertQt4ToTQt3String(currentAction->text()), i, i); m_tqt3popupmenu_widget->insertItem(convertQt4ToTQt3String(currentAction->text()), i, i);
} }
else { else {
m_tqt3popupmenu_widget->insertItem(convertQt4ToTQt3IconSet(currentAction->icon()), convertQt4ToTQt3String(currentAction->text()), i, i); m_tqt3popupmenu_widget->insertItem(convertQt4ToTQt3IconSet(currentAction->icon(), m_tqt3IconSize_Small, m_tqt3IconSize_Large), convertQt4ToTQt3String(currentAction->text()), i, i);
} }
// FIXME // FIXME
// Handle pixmaps, etc. // Handle pixmaps, etc.
@ -1284,7 +1342,7 @@ TQWidget* SimpleStyle::initializeInterfaceWidget(TQt3WidgetType wt, const QWidge
m_tqt3menubar_widget->insertItem(convertQt4ToTQt3String(currentAction->text()), i, i); m_tqt3menubar_widget->insertItem(convertQt4ToTQt3String(currentAction->text()), i, i);
} }
else { else {
m_tqt3menubar_widget->insertItem(convertQt4ToTQt3IconSet(currentAction->icon()), convertQt4ToTQt3String(currentAction->text()), i, i); m_tqt3menubar_widget->insertItem(convertQt4ToTQt3IconSet(currentAction->icon(), m_tqt3IconSize_Small, m_tqt3IconSize_Large), convertQt4ToTQt3String(currentAction->text()), i, i);
} }
// FIXME // FIXME
// Handle pixmaps, etc. // Handle pixmaps, etc.
@ -1678,6 +1736,7 @@ void SimpleStyle::drawControl(ControlElement element, const QStyleOption *opt, Q
TQStyle::SFlags sflags = 0; TQStyle::SFlags sflags = 0;
bool can_override = true; bool can_override = true;
bool do_not_draw = false;
TQStyle::ControlElement tqtCE; TQStyle::ControlElement tqtCE;
bool draw_second_element = false; bool draw_second_element = false;
@ -1853,12 +1912,26 @@ void SimpleStyle::drawControl(ControlElement element, const QStyleOption *opt, Q
} }
} }
break; break;
case QStyle::CE_ToolBar:
// TQt3 treats this as a primitive
// It is drawn as such below
DO_NOT_DRAW
break;
case QStyle::CE_HeaderSection:
// TQt3 treats this as a primitive
// It is drawn as such below
DO_NOT_DRAW
break;
case QStyle::CE_MenuBarEmptyArea: case QStyle::CE_MenuBarEmptyArea:
tqtCE = TQStyle::CE_MenuBarEmptyArea; tqtCE = TQStyle::CE_MenuBarEmptyArea;
break; break;
case QStyle::CE_MenuEmptyArea: case QStyle::CE_MenuEmptyArea:
tqtCE = TQStyle::CE_MenuBarEmptyArea; tqtCE = TQStyle::CE_MenuBarEmptyArea;
break; break;
case QStyle::CE_ItemViewItem:
// Ignore request as Qt3 has no equivalent
can_override = false;
break;
case QStyle::CE_ShapedFrame: case QStyle::CE_ShapedFrame:
// Ignore request as Qt3 has no equivalent // Ignore request as Qt3 has no equivalent
can_override = false; can_override = false;
@ -1914,15 +1987,25 @@ void SimpleStyle::drawControl(ControlElement element, const QStyleOption *opt, Q
tqtPainter.fillRect(TQRect(tqt3elementrect.x()+tqt3tabwidth, tqt3elementrect.y(), tqt3elementrect.width()-(tqt3tabwidth*2), tqt3elementrect.height()), tqt3colorgroup.background()); tqtPainter.fillRect(TQRect(tqt3elementrect.x()+tqt3tabwidth, tqt3elementrect.y(), tqt3elementrect.width()-(tqt3tabwidth*2), tqt3elementrect.height()), tqt3colorgroup.background());
} }
// Instruct TQt3 to draw the control if (element == QStyle::CE_ToolBar) {
// FIXME tqApp->style().drawPrimitive(TQStyle::PE_PanelDockWindow, &tqtPainter, tqt3elementrect, tqt3colorgroup, sflags, tqt3opt);
// Implement sflags and QStyleOption }
tqApp->style().drawControl(tqtCE, &tqtPainter, interfaceWidget, tqt3elementrect, tqt3colorgroup, sflags, tqt3opt);
if (draw_second_element == true) { if (element == QStyle::CE_HeaderSection) {
tqApp->style().drawControl(tqtCE_element2, &tqtPainter, interfaceWidget, tqt3element2rect, tqt3colorgroup, sflags, tqt3opt_element2); tqApp->style().drawPrimitive(TQStyle::PE_HeaderSection, &tqtPainter, tqt3elementrect, tqt3colorgroup, sflags, tqt3opt);
} }
if (draw_third_element == true) {
tqApp->style().drawControl(tqtCE_element3, &tqtPainter, interfaceWidget, tqt3element3rect, tqt3colorgroup, sflags, tqt3opt_element3); if (do_not_draw == false) {
// Instruct TQt3 to draw the control
// FIXME
// Implement sflags and QStyleOption
tqApp->style().drawControl(tqtCE, &tqtPainter, interfaceWidget, tqt3elementrect, tqt3colorgroup, sflags, tqt3opt);
if (draw_second_element == true) {
tqApp->style().drawControl(tqtCE_element2, &tqtPainter, interfaceWidget, tqt3element2rect, tqt3colorgroup, sflags, tqt3opt_element2);
}
if (draw_third_element == true) {
tqApp->style().drawControl(tqtCE_element3, &tqtPainter, interfaceWidget, tqt3element3rect, tqt3colorgroup, sflags, tqt3opt_element3);
}
} }
tqtPainter.end(); tqtPainter.end();
@ -1934,8 +2017,10 @@ void SimpleStyle::drawControl(ControlElement element, const QStyleOption *opt, Q
#endif #endif
} }
else { else {
// Tell Qt4 to draw it if (do_not_draw == false) {
QCommonStyle::drawControl(element, opt, p, w); // Tell Qt4 to draw it
QCommonStyle::drawControl(element, opt, p, w);
}
} }
} }
@ -1974,6 +2059,10 @@ void SimpleStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QP
tqtPE = TQStyle::PE_PanelPopup; tqtPE = TQStyle::PE_PanelPopup;
tqt3opt = TQStyleOption(static_cast<const QStyleOptionFrame*>(opt)->lineWidth, static_cast<const QStyleOptionFrame*>(opt)->midLineWidth); tqt3opt = TQStyleOption(static_cast<const QStyleOptionFrame*>(opt)->lineWidth, static_cast<const QStyleOptionFrame*>(opt)->midLineWidth);
break; break;
case QStyle::PE_PanelToolBar:
tqtPE = TQStyle::PE_PanelDockWindow;
tqt3opt = TQStyleOption(static_cast<const QStyleOptionFrame*>(opt)->lineWidth, static_cast<const QStyleOptionFrame*>(opt)->midLineWidth);
break;
case QStyle::PE_PanelButtonBevel: case QStyle::PE_PanelButtonBevel:
tqtPE = TQStyle::PE_ButtonBevel; tqtPE = TQStyle::PE_ButtonBevel;
break; break;
@ -1991,14 +2080,55 @@ void SimpleStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QP
tqt3opt = TQStyleOption(static_cast<const QStyleOptionFrame*>(opt)->lineWidth, static_cast<const QStyleOptionFrame*>(opt)->midLineWidth); tqt3opt = TQStyleOption(static_cast<const QStyleOptionFrame*>(opt)->lineWidth, static_cast<const QStyleOptionFrame*>(opt)->midLineWidth);
break; break;
case QStyle::PE_FrameFocusRect: case QStyle::PE_FrameFocusRect:
tqtPE = TQStyle::PE_FocusRect; // HACK
// Qt4 tries to draw a focus rectangle around the entire tab
// Needless to say this is ugly
// TQt3 tries to draw the focus rectangle around the tab text only, which is better
if (dynamic_cast<const QTabBar*>(w)) {
// FIXME
// We should attempt to draw the focus rectangle around the tab's text instead
DO_NOT_DRAW
}
else {
tqtPE = TQStyle::PE_FocusRect;
}
break; break;
case QStyle::PE_FrameButtonTool: case QStyle::PE_FrameButtonTool:
tqtPE = TQStyle::PE_ButtonTool; tqtPE = TQStyle::PE_ButtonTool;
break; break;
case QStyle::PE_IndicatorToolBarHandle:
tqtPE = TQStyle::PE_DockWindowHandle;
break;
case QStyle::PE_IndicatorToolBarSeparator:
tqtPE = TQStyle::PE_DockWindowSeparator;
break;
case QStyle::PE_IndicatorDockWidgetResizeHandle:
tqtPE = TQStyle::PE_DockWindowResizeHandle;
break;
case QStyle::PE_IndicatorMenuCheckMark:
tqtPE = TQStyle::PE_Indicator;
break;
case QStyle::PE_PanelTipLabel:
NO_QT3_EQUIVALENT
break;
case QStyle::PE_PanelItemViewItem:
NO_QT3_EQUIVALENT
break;
case QStyle::PE_PanelItemViewRow:
NO_QT3_EQUIVALENT
break;
case QStyle::PE_PanelScrollAreaCorner:
NO_QT3_EQUIVALENT
break;
case QStyle::PE_FrameTabBarBase: case QStyle::PE_FrameTabBarBase:
NO_QT3_EQUIVALENT NO_QT3_EQUIVALENT
break; break;
case QStyle::PE_IndicatorBranch:
NO_QT3_EQUIVALENT
break;
case QStyle::PE_IndicatorHeaderArrow:
tqtPE = TQStyle::PE_HeaderArrow;
break;
case QStyle::PE_FrameTabWidget: case QStyle::PE_FrameTabWidget:
tqtPE = TQStyle::PE_PanelTabWidget; tqtPE = TQStyle::PE_PanelTabWidget;
// HACK // HACK
@ -2113,9 +2243,11 @@ void SimpleStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QP
} }
} }
// Instruct TQt3 to draw the primitive if (do_not_draw == false) {
if (!((tqtPE == TQStyle::PE_PanelLineEdit) && (draw_transparent_background == true))) { // Instruct TQt3 to draw the primitive
tqApp->style().drawPrimitive(tqtPE, &tqtPainter, tqt3paintrect, tqt3colorgroup, sflags, tqt3opt); if (!((tqtPE == TQStyle::PE_PanelLineEdit) && (draw_transparent_background == true))) {
tqApp->style().drawPrimitive(tqtPE, &tqtPainter, tqt3paintrect, tqt3colorgroup, sflags, tqt3opt);
}
} }
tqtPainter.end(); tqtPainter.end();

@ -90,6 +90,21 @@ private:
TQWidget* m_tqt3window_widget; TQWidget* m_tqt3window_widget;
TQTitleBar* m_tqt3titlebar_widget; TQTitleBar* m_tqt3titlebar_widget;
TQMenuBar* m_tqt3menubar_widget; TQMenuBar* m_tqt3menubar_widget;
int m_tqt3IconSize_NoGroup;
int m_tqt3IconSize_Desktop;
int m_tqt3IconSize_FirstGroup;
int m_tqt3IconSize_Toolbar;
int m_tqt3IconSize_Tabbar;
int m_tqt3IconSize_MainToolbar;
int m_tqt3IconSize_Small;
int m_tqt3IconSize_Panel;
int m_tqt3IconSize_LastGroup;
int m_tqt3IconSize_User;
int m_tqt3IconSize_MenuItem;
int m_tqt3IconSize_Large;
int m_tqt3IconSize_Listview;
int m_tqt3IconSize_Button;
}; };
#endif #endif

Loading…
Cancel
Save