diff options
Diffstat (limited to 'tdegtk/tdegtk-theme.cpp')
-rw-r--r-- | tdegtk/tdegtk-theme.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/tdegtk/tdegtk-theme.cpp b/tdegtk/tdegtk-theme.cpp index e18e30d..924f7ef 100644 --- a/tdegtk/tdegtk-theme.cpp +++ b/tdegtk/tdegtk-theme.cpp @@ -630,6 +630,39 @@ void writeGtkThemeControlFile(int forceRecreate) { gtk_icon_factory_add_default(factory); } + TQScrollBar sbar(NULL); + sbar.setOrientation(TQt::Horizontal); + sbar.setValue(1); + sbar.resize(200,25); + + // The following code determines how many buttons are on a scrollbar + // It works by looking at each pixel of the scrollbar's area not taken up by the groove, + // and asking the style which subcontrol is at that location. + TQRect rect = tqApp->style().querySubControlMetrics(TQStyle::CC_ScrollBar, &sbar, TQStyle::SC_ScrollBarGroove); + + TQStyle::SubControl sc = TQStyle::SC_None; + for (TQPoint pos(0,7) ; pos.x()<rect.x() ; pos.setX(pos.x()+1)) + { + TQStyle::SubControl sc2 = tqApp->style().querySubControl(TQStyle::CC_ScrollBar, &sbar, pos); + if (sc != sc2) + { + if (sc2 == TQStyle::SC_ScrollBarAddLine) m_scrollbarForward1 = true; + if (sc2 == TQStyle::SC_ScrollBarSubLine) m_scrollbarBack1 = true; + sc = sc2; + } + } + sc = TQStyle::SC_None; + for (TQPoint pos(rect.x()+rect.width(),7) ; pos.x()<200 ; pos.setX(pos.x()+1)) + { + TQStyle::SubControl sc2 = tqApp->style().querySubControl(TQStyle::CC_ScrollBar, &sbar, pos); + if (sc != sc2) + { + if (sc2 == TQStyle::SC_ScrollBarAddLine) m_scrollbarForward2 = true; + if (sc2 == TQStyle::SC_ScrollBarSubLine) m_scrollbarBack2 = true; + sc = sc2; + } + } + // This function takes quite a long time to execute, and is run at the start of every app. // In order to speed it up, we can store the results in a file, along with the name of icon // theme and style. This file can then be regenerated when the icon theme or style change. @@ -664,7 +697,7 @@ void writeGtkThemeControlFile(int forceRecreate) { themeFile.open(IO_ReadOnly); stream.setDevice(TQT_TQIODEVICE(&themeFile)); - if (stream.readLine() == "/* " + iconTheme + ", " + tqApp->style().name() + ", " + RC_CACHE_VERSION + " */") { + if (stream.readLine() == "/* " + iconTheme + ", " + tqApp->style().name() + ", " + RC_CACHE_VERSION + ", " + __DATE__ + ", " + __TIME__ + " */") { // This cache matches the current icon theme and style themeFile.close(); @@ -683,43 +716,10 @@ void writeGtkThemeControlFile(int forceRecreate) { themeFile.open(IO_WriteOnly | IO_Truncate); stream.setDevice(TQT_TQIODEVICE(&themeFile)); - - stream << "/* " << iconTheme << ", " << tqApp->style().name() << ", " << RC_CACHE_VERSION << " */\n\n"; + + stream << "/* " << iconTheme << ", " << tqApp->style().name() << ", " << RC_CACHE_VERSION << ", " << __DATE__ << ", " << __TIME__ << " */\n\n"; stream << "/* This file was generated by the Gtk TQt Theme Engine */\n"; stream << "/* It will be recreated when you change your TDE icon theme or widget style */\n\n"; - - TQScrollBar sbar(NULL); - sbar.setOrientation(TQt::Horizontal); - sbar.setValue(1); - sbar.resize(200,25); - - // The following code determines how many buttons are on a scrollbar - // It works by looking at each pixel of the scrollbar's area not taken up by the groove, - // and asking the style which subcontrol is at that location. - TQRect rect = tqApp->style().querySubControlMetrics(TQStyle::CC_ScrollBar, &sbar, TQStyle::SC_ScrollBarGroove); - - TQStyle::SubControl sc = TQStyle::SC_None; - for (TQPoint pos(0,7) ; pos.x()<rect.x() ; pos.setX(pos.x()+1)) - { - TQStyle::SubControl sc2 = tqApp->style().querySubControl(TQStyle::CC_ScrollBar, &sbar, pos); - if (sc != sc2) - { - if (sc2 == TQStyle::SC_ScrollBarAddLine) m_scrollbarForward1 = true; - if (sc2 == TQStyle::SC_ScrollBarSubLine) m_scrollbarBack1 = true; - sc = sc2; - } - } - sc = TQStyle::SC_None; - for (TQPoint pos(rect.x()+rect.width(),7) ; pos.x()<200 ; pos.setX(pos.x()+1)) - { - TQStyle::SubControl sc2 = tqApp->style().querySubControl(TQStyle::CC_ScrollBar, &sbar, pos); - if (sc != sc2) - { - if (sc2 == TQStyle::SC_ScrollBarAddLine) m_scrollbarForward2 = true; - if (sc2 == TQStyle::SC_ScrollBarSubLine) m_scrollbarBack2 = true; - sc = sc2; - } - } // FIXME // The items in a GTK3 combobox cannot be styled, either to draw them in a custom manner or to change their height |