~ubuntu-branches/ubuntu/oneiric/codelite/oneiric

« back to all changes in this revision

Viewing changes to Plugin/drawingutils.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Alessio Treglia
  • Date: 2010-04-09 02:03:19 UTC
  • mfrom: (0.1.3 sid) (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20100409020319-302693n3vroavxwe
Tags: 2.5.2.4031~dfsg-1
* New upstream release.
* Refresh patches.

Show diffs side-by-side

added added

removed removed

Lines of Context:
365
365
        return wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE);
366
366
#endif
367
367
}
 
368
 
 
369
wxColor DrawingUtils::GetTextCtrlTextColour()
 
370
{
 
371
#ifdef __WXGTK__
 
372
        static bool     intitialized(false);
 
373
        static wxColour textColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
 
374
        
 
375
        if( !intitialized ) {
 
376
                // try to get the background colour from a menu
 
377
                GtkWidget *textCtrl = gtk_text_view_new();
 
378
                GtkStyle   *def = gtk_rc_get_style( textCtrl );
 
379
                if(!def)
 
380
                        def = gtk_widget_get_default_style();
 
381
                
 
382
                if(def) {
 
383
                        GdkColor col = def->text[GTK_STATE_NORMAL];
 
384
                        textColour = wxColour(col);
 
385
                }
 
386
                gtk_widget_destroy( textCtrl );
 
387
                intitialized = true;
 
388
        }
 
389
        return textColour;
 
390
#else
 
391
        return wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT);
 
392
#endif
 
393
}