diff --git a/GtkAbstractInspector.cpp b/GtkAbstractInspector.cpp index 751a6dc..082d1e4 100644 --- a/GtkAbstractInspector.cpp +++ b/GtkAbstractInspector.cpp @@ -95,7 +95,9 @@ void GtkAbstractInspector::inspectAsMain(const char* name, Inspectable& object) auto& frame = childPopulator.ensureChild(); std::string label = object.getName(); if (name && strlen(name)) label = std::string(name) + ": " + label; - frame.set_label(label); + if (frame.get_label() != label) { + frame.set_label(label); + } frame.childPopulator.reset(); object.onInspect(frame); frame.childPopulator.pruneRemaining(); @@ -108,7 +110,9 @@ void GtkAbstractInspector::inspectAsMain(const char* name, Inspectable& object) auto& frame = childPopulator.ensureChild(); std::string label = getNameAndType(*component); if (name && strlen(name)) label = std::string(name) + ": " + label; - frame.set_label(label); + if (frame.get_label() != label) { + frame.set_label(label); + } frame.childPopulator.reset(); component->onInspect(frame); frame.childPopulator.pruneRemaining(); diff --git a/GtkAbstractInspector.h b/GtkAbstractInspector.h index f79c05b..27e4d0e 100644 --- a/GtkAbstractInspector.h +++ b/GtkAbstractInspector.h @@ -73,7 +73,9 @@ class GtkAbstractInspector : public Inspector FieldValueWidget& addField(const char* name) { GtkInspectionField& field = childPopulator.ensureChild(); - field.getLabel().set_text(name); + if (field.getLabel().get_text() != name) { + field.getLabel().set_text(name); + } return field.ensureChild(); } diff --git a/GtkAbstractInspector.hpp b/GtkAbstractInspector.hpp index c501c03..2634345 100644 --- a/GtkAbstractInspector.hpp +++ b/GtkAbstractInspector.hpp @@ -171,7 +171,9 @@ inline void GtkAbstractInspector::editable(const char* name, Inspectable* i) { frame.childPopulator.reset(); std::string label = i->getName() + " (" + demangle(typeid(*i).name()) + ")"; if (name && strlen(name)) label = std::string(name) + ": " + label; - frame.set_label(label); + if (frame.get_label() != label) { + frame.set_label(label); + } i->onInspect(frame); frame.childPopulator.pruneRemaining(); } @@ -182,7 +184,9 @@ inline void GtkAbstractInspector::readonly(const char* name, Inspectable* i) { frame.childPopulator.reset(); std::string label = i->getName() + " (" + demangle(typeid(*i).name()) + ")"; if (name && strlen(name)) label = std::string(name) + ": " + label; - frame.set_label(label); + if (frame.get_label() != label) { + frame.set_label(label); + } i->onInspect(frame); frame.childPopulator.pruneRemaining(); }