summaryrefslogtreecommitdiff
path: root/fluid/widgets
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2026-01-05 12:54:12 +0100
committerMatthias Melcher <github@matthiasm.com>2026-01-05 21:06:04 +0100
commit89aa5726f8d772e0fec1ebcbdfa3b74aa7a217f8 (patch)
tree2bb2c31e1b283d33a1bff29aa3a105362f2a9435 /fluid/widgets
parent5f10939cfa0fc943dfc28b441efa9e9028eef5e5 (diff)
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
Diffstat (limited to 'fluid/widgets')
-rw-r--r--fluid/widgets/Node_Browser.cxx19
1 files changed, 10 insertions, 9 deletions
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 {