Browse Source

Fixed GLib-GObject-WARNING messages for older GTK+ versions without underline-rgba property.

merge-requests/365/head
eidheim 11 years ago
parent
commit
b109ebf380
  1. 4
      juci/source.cc

4
juci/source.cc

@ -360,6 +360,9 @@ void Source::ClangView::update_diagnostics() {
diagnostic_tooltips.add(diagnostic.severity_spelling+": "+diagnostic.spelling, get_source_buffer()->create_mark(start), get_source_buffer()->create_mark(end));
auto tag=buffer->create_tag();
tag->property_underline()=Pango::Underline::UNDERLINE_ERROR;
auto tag_class=G_OBJECT_GET_CLASS(tag->gobj()); //For older GTK+ 3 versions:
auto param_spec=g_object_class_find_property(tag_class, "underline-rgba");
if(param_spec!=NULL) {
if(diagnostic.severity<=CXDiagnostic_Warning) {
//TODO: get color from config.json
tag->set_property("underline-rgba", Gdk::RGBA("orange"));
@ -368,6 +371,7 @@ void Source::ClangView::update_diagnostics() {
//TODO: get color from config.json
tag->set_property("underline-rgba", Gdk::RGBA("red"));
}
}
buffer->apply_tag(tag, start, end);
}
}

Loading…
Cancel
Save