From e363fd4cf89ebbabe94471bdc921d72796c05ade Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 1 Nov 2012 22:49:00 -0500 Subject: All widgets are now (more or less) drawn with TQt3 style primitives --- tdegtk/tdegtk-theme.cpp | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) (limited to 'tdegtk/tdegtk-theme.cpp') diff --git a/tdegtk/tdegtk-theme.cpp b/tdegtk/tdegtk-theme.cpp index 25c212c..79763b6 100644 --- a/tdegtk/tdegtk-theme.cpp +++ b/tdegtk/tdegtk-theme.cpp @@ -136,7 +136,9 @@ G_MODULE_EXPORT GtkThemingEngine* create_engine(void) { icon_sizes.push_back(std::make_pair("gtk-dialog", IconSize(KIcon::Small))); icon_sizes.push_back(std::make_pair("", IconSize(KIcon::Small))); - writeGtkThemeControlFile(false); + if (gtk3TQtDebug) { + writeGtkThemeControlFile(true); + } // Initialize hooks m_widgetLookup.initializeHooks(); @@ -608,6 +610,17 @@ void writeGtkThemeControlFile(int forceRecreate) { stream << parse_rc_string("-GtkRange-stepper-size: " + TQString::number(tqApp->style().pixelMetric(TQStyle::PM_ScrollBarExtent)), "GtkScrollbar"); stream << parse_rc_string("-GtkRange-trough-border: 0", "GtkScrollbar"); + { + //stream << parse_rc_string("-GtkRange-slider-width: " + TQString::number(tqApp->style().pixelMetric(TQStyle::PM_SliderControlThickness, ceData, elementFlags)), "GtkScale"); + //stream << parse_rc_string("-GtkRange-stepper-size: " + TQString::number(tqApp->style().pixelMetric(TQStyle::PM_SliderControlThickness)), "GtkScale"); + + // FIXME + // These are hardcoded for now as TQt3 does not easily give up its slider sizes + // We need to read the Gtk slider width for this to make any sense! + // Also, GTK does not seem to be able to set a minimum slider length at this time + stream << parse_rc_string("-GtkRange-slider-width: " + TQString::number(20), "GtkScale"); + } + stream << parse_rc_string("-GtkButton-child-displacement-x: " + TQString::number(tqApp->style().pixelMetric(TQStyle::PM_ButtonShiftHorizontal)), "*"); stream << parse_rc_string("-GtkButton-child-displacement-y: " + TQString::number(tqApp->style().pixelMetric(TQStyle::PM_ButtonShiftVertical)), "*"); stream << parse_rc_string("-GtkButton-default-border: 0 0 0 0", "*"); @@ -678,9 +691,6 @@ void writeGtkThemeControlFile(int forceRecreate) { // If not, it may be neccessary to override the GTK text drawing routines for notebooks to insert the proper shift //stream << parse_rc_string("-????: " + TQString::number(tqApp->style().pixelMetric(TQStyle::PM_TabBarTabShiftHorizontal)), "*"); - stream << parse_rc_string("-GtkButton-child-displacement-x: " + TQString::number(tqApp->style().pixelMetric(TQStyle::PM_ButtonShiftHorizontal)), "*"); - stream << parse_rc_string("-GtkButton-child-displacement-y: " + TQString::number(tqApp->style().pixelMetric(TQStyle::PM_ButtonShiftVertical)), "*"); - // Expand widget padding so as to keep the prelighting out of the active widget area // FIXME // Where do these 3px values actually come from? @@ -736,6 +746,10 @@ void writeGtkThemeControlFile(int forceRecreate) { stream << parse_rc_string("-GtkWidget-separator-width: " + TQString::number(tdeSeparatorMenuItemHeight), "GtkMenuItem"); stream << parse_rc_string("-GtkWidget-wide-separators: 1", "GtkMenuItem"); + // FIXME + // GTK does not seem to support inserting actual space between the items in a menu bar; instead it insists on expanding the size of the menu items themselves (GtkMenuBar>GtkMenuItem padding:) + // This is rather jarring visually; if a way is found to work around this GTK bug the menu bar item spacing should be fixed ASAP! + // stream << parse_rc_string("padding: " + TQString::number(tqApp->style().pixelMetric(TQStyle::PM_)), "GtkMenuBar"); stream << parse_rc_string("padding: " + TQString::number(tqApp->style().pixelMetric(TQStyle::PM_MenuBarFrameWidth)) + "px " + TQString::number(tqApp->style().pixelMetric(TQStyle::PM_MenuBarItemSpacing)*0.75) + "px", "GtkMenuBar>GtkMenuItem"); stream << parse_rc_string("padding: " + TQString::number((tdeStandardMenuItemHeight-tqApp->style().pixelMetric(TQStyle::PM_IndicatorHeight))/2) + "px " + TQString::number(0) + "px", "GtkMenu>GtkMenuItem"); @@ -877,7 +891,7 @@ void writeGtkThemeControlFile(int forceRecreate) { themeFile.close(); - if (!forceRecreate) { + if (!gtk3TQtDebug) { gtk3_tqt_reload_theme_definition_file(themeFilePath.latin1()); } } -- cgit v1.2.1