Issue 2990: workaround for

style->get_background_color(Gtk::STATE_FLAG_SELECTED) which is not
handled properly by Gtk3
This commit is contained in:
Hombre 2015-11-30 01:26:00 +01:00
parent 9cac516219
commit 72acf67304
2 changed files with 10 additions and 35 deletions

View File

@ -39,40 +39,11 @@ void setExpandAlignProperties(Gtk::Widget *widget, bool hExpand, bool vExpand, e
guint add_idle (GSourceFunc function, gpointer data);
/**
* @brief Lock GTK for critical section.
*
* Will unlock on destruction. To use:
*
* <code>
* {
* GThreadLock lock;
* // critical code
* }
* </code>
*
* This is a replacement for the former gdk_threads_enter / gdk_threads_leave pair that has been deprecated.
* It does the same, but there may be a speed penalty, hopefully negligible.
*/
/*
*
* This, doesn't work. But we have to find a replacement for gdk_threads_enter and gdk_threads_leave that are deprecated and will be removed.
*
*
class GThreadLock
{
public:
Glib::Threads::Mutex operation;
Glib::Threads::Cond operationCond;
Glib::Threads::Mutex GUI;
Glib::Threads::Cond GUICond;
bool sameThread;
GThreadLock();
~GThreadLock();
};
*/
// TODO: The documentation says gdk_threads_enter and gdk_threads_leave should be replaced
// by g_main_context_invoke(), g_idle_add() and related functions, but this will require more extensive changes.
// We silence those warnings until then so that we notice the others.
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
/**
* @brief Lock GTK for critical section.
@ -117,6 +88,7 @@ public:
}
};
#pragma GCC diagnostic pop
/**
* @brief Glue box to control visibility of the MyExpender's content ; also handle the frame around it
@ -496,6 +468,7 @@ private:
int refCount;
public:
RefCount() : refCount(1) {}
virtual ~RefCount() {}
void reference()
{

View File

@ -92,7 +92,9 @@ void ThumbBrowserEntryBase::updateBackBuffer ()
Gdk::RGBA textn = style->get_color(Gtk::STATE_FLAG_NORMAL);
Gdk::RGBA texts = style->get_color(Gtk::STATE_FLAG_SELECTED);
Gdk::RGBA bgn = style->get_background_color(Gtk::STATE_FLAG_NORMAL);
Gdk::RGBA bgs = style->get_background_color(Gtk::STATE_FLAG_SELECTED);
//Gdk::RGBA bgs = style->get_background_color(Gtk::STATE_FLAG_SELECTED);
Gdk::RGBA bgs;
bgs.set_rgba(0.3372549, 0.3372549, 0.3372549);
// clear area, draw frames and background
style->render_background(cc, 0., 0., exp_width, exp_height);