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. 18
      juci/source.cc

18
juci/source.cc

@ -360,13 +360,17 @@ 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)); 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(); auto tag=buffer->create_tag();
tag->property_underline()=Pango::Underline::UNDERLINE_ERROR; tag->property_underline()=Pango::Underline::UNDERLINE_ERROR;
if(diagnostic.severity<=CXDiagnostic_Warning) { auto tag_class=G_OBJECT_GET_CLASS(tag->gobj()); //For older GTK+ 3 versions:
//TODO: get color from config.json auto param_spec=g_object_class_find_property(tag_class, "underline-rgba");
tag->set_property("underline-rgba", Gdk::RGBA("orange")); if(param_spec!=NULL) {
} if(diagnostic.severity<=CXDiagnostic_Warning) {
else { //TODO: get color from config.json
//TODO: get color from config.json tag->set_property("underline-rgba", Gdk::RGBA("orange"));
tag->set_property("underline-rgba", Gdk::RGBA("red")); }
else {
//TODO: get color from config.json
tag->set_property("underline-rgba", Gdk::RGBA("red"));
}
} }
buffer->apply_tag(tag, start, end); buffer->apply_tag(tag, start, end);
} }

Loading…
Cancel
Save