diff options
author | Timothy Pearson <[email protected]> | 2012-10-29 16:17:27 -0500 |
---|---|---|
committer | Timothy Pearson <[email protected]> | 2012-10-29 16:17:27 -0500 |
commit | a66a6bbf0a4c7dc521f03a3473fb3f550a4990c9 (patch) | |
tree | b1dab72fc3a8f9ec87d499c43e722a2ab14a4a25 /tdegtk/tdegtk-draw.cpp | |
parent | 0bf8ed2645fa9721cdf2ebab5e81307e1649b967 (diff) | |
download | gtk3-tqt-engine-a66a6bbf0a4c7dc521f03a3473fb3f550a4990c9.tar.gz gtk3-tqt-engine-a66a6bbf0a4c7dc521f03a3473fb3f550a4990c9.zip |
Add tab prelighting support
Diffstat (limited to 'tdegtk/tdegtk-draw.cpp')
-rw-r--r-- | tdegtk/tdegtk-draw.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/tdegtk/tdegtk-draw.cpp b/tdegtk/tdegtk-draw.cpp index 77c0b7c..a4788f2 100644 --- a/tdegtk/tdegtk-draw.cpp +++ b/tdegtk/tdegtk-draw.cpp @@ -32,6 +32,7 @@ #include "tdegtk-types.h" #include "tdegtk-widgetlookup.h" #include "tdegtk-utils.h" +#include "tdegtk-animations.h" #include "tqtcairopainter.h" @@ -49,6 +50,7 @@ p.drawRect(x, y, w, h); WidgetLookup m_widgetLookup; +Animations m_animations; // Keep this in sync with gtkToTQPaletteColorGroup() below static TQColorGroup gtkToTQtColorGroup(GtkThemingEngine* engine, GtkStateFlags state) { @@ -662,11 +664,13 @@ tdegtk_draw_extension (DRAW_ARGS, widget = m_widgetLookup.find(cr, path); if (gtk_theming_engine_has_class(engine, GTK_STYLE_CLASS_NOTEBOOK)) { + // Register tabbar with animation engine + m_animations.tabWidgetEngine().registerWidget(widget); + // Check tab properties const int tabIndex = Gtk::gtk_notebook_find_tab(widget, x+width/2, y+height/2); -// Style::instance().animations().tabWidgetEngine().updateTabRect(widget, tabIndex, x, y, width, height); -// bool prelight = (tabIndex == Style::instance().animations().tabWidgetEngine().hoveredTab(widget)); - bool prelight = false; + m_animations.tabWidgetEngine().updateTabRect(widget, tabIndex, x, y, width, height); + bool prelight = (tabIndex == m_animations.tabWidgetEngine().hoveredTab(widget)); GtkNotebook* notebook = GTK_NOTEBOOK(widget); // bool firstTab = (tabIndex == 0); // bool lastTab = (tabIndex == gtk_notebook_get_n_pages(notebook)-1); @@ -725,7 +729,7 @@ tdegtk_draw_extension (DRAW_ARGS, DRAW_FILLED_RECTANGLE_OVER_SPECIFIC_AREA(p2, brush, 0, 0, width, height) // Draw tab - tqApp->style().drawControl(TQStyle::CE_TabBarTab, &p2, ceData, elementFlags, boundingRect, gtkToTQtColorGroup(engine, state), gtkToTQtStyleFlags(engine, state, TQT3WT_NONE) | ((tabIndex==currentPage)?TQStyle::Style_Selected:TQStyle::Style_Default), tabOpt); + tqApp->style().drawControl(TQStyle::CE_TabBarTab, &p2, ceData, elementFlags, boundingRect, gtkToTQtColorGroup(engine, state), gtkToTQtStyleFlags(engine, state, TQT3WT_NONE) | ((tabIndex==currentPage)?TQStyle::Style_Selected:TQStyle::Style_Default) | ((prelight)?TQStyle::Style_MouseOver:TQStyle::Style_Default), tabOpt); cairo_restore(cr); } |