summaryrefslogtreecommitdiffstats
path: root/plugin/simplestyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/simplestyle.cpp')
-rw-r--r--plugin/simplestyle.cpp40
1 files changed, 30 insertions, 10 deletions
diff --git a/plugin/simplestyle.cpp b/plugin/simplestyle.cpp
index 4d4b9e7..18cf536 100644
--- a/plugin/simplestyle.cpp
+++ b/plugin/simplestyle.cpp
@@ -164,6 +164,9 @@ Qt4TDEStyle::Qt4TDEStyle()
// Set the Qt4 icon set to the TDE icon set
QIcon::setThemeName(convertTQt3ToQt4String(KIconTheme::current()));
+ // Set the Qt4 default font
+ QApplication::setFont(convertTQt3ToQt4Font(TQApplication::font()));
+
// Set up Qt4 size hints to match the TDE sizes
// FIXME
// m_tqt3DialogButtons_ShowIcons, m_tqt3IconSize_MenuItem, and m_tqt3IconSize_Large are still hardcoded
@@ -1547,7 +1550,7 @@ int Qt4TDEStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const
return retval;
}
-TQWidget* Qt4TDEStyle::initializeInterfaceWidget(TQt3WidgetType wt, const QWidget* w, const QStyleOption* qt4styleoptions) const
+TQWidget* Qt4TDEStyle::initializeInterfaceWidget(TQt3WidgetType wt, const QWidget* w, const QStyleOption* qt4styleoptions, bool forceReload) const
{
int i;
TQWidget* interfaceWidget = 0;
@@ -1575,16 +1578,33 @@ TQWidget* Qt4TDEStyle::initializeInterfaceWidget(TQt3WidgetType wt, const QWidge
TQColor bgcolor;
- // FIXME
- // Enabling this breaks sliders and all other dynamically updated widgets
-#if 0
- // If the interface widget was already initialized for this widget then do nothing
- // This is a very simplistic algorithm that should probably be replaced with a full hashtable lookup scheme
- if (m_previousQt4InterfaceWidget == w) {
- return m_previousTQt3InterfaceWidget;
+ if (forceReload == false) {
+ // NOTE
+ // Enabling this for every widget breaks sliders and all other dynamically updated widgets
+ // Disabling it for every widget makes the style engine run too slowly to be of much use
+ // Much of the slowdown appears to be from Qt4TDEStyle::pixelMetric calling this method
+ if (/*(wt == TQT3WT_TQProgressBar)*/
+ /*||*/ (wt == TQT3WT_TQTabBar)
+ || (wt == TQT3WT_TQRadioButton)
+ || (wt == TQT3WT_TQCheckBox)
+ || (wt == TQT3WT_TQPopupMenu)
+ || (wt == TQT3WT_TQComboBox)
+ //|| (wt == TQT3WT_TQSlider)
+ //|| (wt == TQT3WT_TQScrollBar)
+ //|| (wt == TQT3WT_TQSpinBox)
+ //|| (wt == TQT3WT_TQSpinWidget)
+ || (wt == TQT3WT_TQTitleBar)
+ || (wt == TQT3WT_TQMenuBar)
+ || (wt == TQT3WT_TQToolBox)
+ || (wt == TQT3WT_TQToolButton)) {
+ // If the interface widget was already initialized for this widget then do nothing
+ // This is a very simplistic algorithm that should probably be replaced with a full hashtable lookup scheme
+ if (m_previousQt4InterfaceWidget == w) {
+ return m_previousTQt3InterfaceWidget;
+ }
+ m_previousQt4InterfaceWidget = w;
+ }
}
- m_previousQt4InterfaceWidget = w;
-#endif
switch (wt) {
case TQT3WT_TQProgressBar: