[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [oxygen-gtk/gtk3] src: deal with rendering progressbar text in white when over progressbar indicator
From: Hugo Pereira Da Costa <hugo () oxygen-icons ! org>
Date: 2012-06-21 14:31:02
Message-ID: 20120621143102.DF72CA60A9 () git ! kde ! org
[Download RAW message or body]
Git commit 4a7d2a509691be6acb28b82939e5eab46d07896b by Hugo Pereira Da Cost=
a.
Committed on 19/06/2012 at 14:17.
Pushed by hpereiradacosta into branch 'gtk3'.
deal with rendering progressbar text in white when over progressbar indicat=
or.
M +15 -1 src/oxygenthemingengine.cpp
http://commits.kde.org/oxygen-gtk/4a7d2a509691be6acb28b82939e5eab46d07896b
diff --git a/src/oxygenthemingengine.cpp b/src/oxygenthemingengine.cpp
index 679fb93..9346795 100644
--- a/src/oxygenthemingengine.cpp
+++ b/src/oxygenthemingengine.cpp
@@ -335,7 +335,7 @@ namespace Oxygen
// draw flat selection in combobox list
if( state & GTK_STATE_FLAG_SELECTED)
{
- ColorUtils::Rgba selection( Style::instance().settings=
().palette().color( Palette::Active, Palette::Selected ) );
+ const ColorUtils::Rgba selection( Style::instance().se=
ttings().palette().color( Palette::Active, Palette::Selected ) );
Style::instance().fill( context, x, y, w, h, selection=
);
}
=
@@ -2200,6 +2200,20 @@ namespace Oxygen
<< std::endl;
#endif
=
+ // draw progressbar text white if above indicator, black if not
+ if( gtk_theming_engine_has_class( engine, GTK_STYLE_CLASS_PROGRESS=
BAR ) )
+ {
+
+ cairo_save( context );
+ const ColorUtils::Rgba selection( Style::instance().settings()=
.palette().color( Palette::Active, Palette::SelectedText ) );
+ cairo_set_source( context, selection );
+ cairo_translate(context,x,y);
+ pango_cairo_show_layout(context,layout);
+ cairo_restore( context );
+ return;
+
+ }
+
const GtkWidgetPath* path( gtk_theming_engine_get_path(engine) );
if( Gtk::gtk_widget_path_has_type( path, GTK_TYPE_LABEL ) )
{
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic