From 89aa5726f8d772e0fec1ebcbdfa3b74aa7a217f8 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Mon, 5 Jan 2026 12:54:12 +0100 Subject: Fluid: Improve std::string output Fluid: Update Widget_Node to std::string Fluid: Image names to std::string Fluid: std::string tooltip Fluid: stringify Widget_Node::subtype Fluid:: extra_code --- fluid/widgets/Node_Browser.cxx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'fluid/widgets/Node_Browser.cxx') diff --git a/fluid/widgets/Node_Browser.cxx b/fluid/widgets/Node_Browser.cxx index 745282e23..91611f876 100644 --- a/fluid/widgets/Node_Browser.cxx +++ b/fluid/widgets/Node_Browser.cxx @@ -393,27 +393,28 @@ void Node_Browser::item_draw(void *v, int X, int Y, int, int) const { // Indent=12 per level: Now write the text that comes after the graphics representation Y += comment_incr; if (l->is_widget() || l->is_class()) { - const char* c = subclassname(l); - if (!strncmp(c,"Fl_",3)) c += 3; + std::string c = subclassname(l); + if (c.compare(0, 3, "Fl_")==0) c.erase(0, 3); // -- class fl_font(class_font, textsize()); if (l->new_selected) fl_color(fl_contrast(class_color, FL_SELECTION_COLOR)); else fl_color(class_color); - fl_draw(c, X, Y+13); - X += int(fl_width(c)+fl_width('n')); - c = l->name(); - if (c) { + fl_draw(c.c_str(), X, Y+13); + X += int(fl_width(c.c_str())+fl_width('n')); + c = l->name() ? l->name() : ""; + if (!c.empty()) { // -- name fl_font(name_font, textsize()); if (l->new_selected) fl_color(fl_contrast(name_color, FL_SELECTION_COLOR)); else fl_color(name_color); - fl_draw(c, X, Y+13); - } else if ((c = l->label())) { + fl_draw(c.c_str(), X, Y+13); + } else if (l->label()) { // -- label + c = l->label(); fl_font(label_font, textsize()); if (l->new_selected) fl_color(fl_contrast(label_color, FL_SELECTION_COLOR)); else fl_color(label_color); - copy_trunc(buf, c, 32, 1, 0); // quoted string + copy_trunc(buf, c.c_str(), 32, 1, 0); // quoted string fl_draw(buf, X, Y+13); } } else { -- cgit v1.2.3