summaryrefslogtreecommitdiff
path: root/fluid/factory.cxx
diff options
context:
space:
mode:
authorMatthias Melcher <github@matthiasm.com>2023-07-19 21:26:17 +0200
committerMatthias Melcher <github@matthiasm.com>2023-07-19 21:26:27 +0200
commitd0331e6342a4eea53e068b175d3b811718d5dde8 (patch)
treea73b4f260fb5de0caa812dbcd98feef3c3d36dc9 /fluid/factory.cxx
parente8eccde8db246d262d7a9e1c6088cc24e82c84e8 (diff)
FLUID: layout preset no longer forces text font selection
Diffstat (limited to 'fluid/factory.cxx')
-rw-r--r--fluid/factory.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/fluid/factory.cxx b/fluid/factory.cxx
index d42941f73..7ed855cd5 100644
--- a/fluid/factory.cxx
+++ b/fluid/factory.cxx
@@ -350,7 +350,7 @@ class Fl_Counter_Type : public Fl_Valuator_Type
}
public:
void ideal_size(int &w, int &h) FL_OVERRIDE {
- h = layout->textsize + 8;
+ h = layout->textsize_not_null() + 8;
w = layout->labelsize * 4 + 4 * h; // make room for the arrows
Fd_Snap_Action::better_size(w, h);
}
@@ -791,8 +791,8 @@ class Fl_Text_Display_Type : public Fl_Widget_Type
}
public:
void ideal_size(int &w, int &h) FL_OVERRIDE {
- h = layout->textsize * 4 + 8;
- w = layout->textsize * 10 + 8;
+ h = layout->textsize_not_null() * 4 + 8;
+ w = layout->textsize_not_null() * 10 + 8;
Fd_Snap_Action::better_size(w, h);
}
const char *type_name() FL_OVERRIDE { return "Fl_Text_Display"; }
@@ -1155,14 +1155,17 @@ Fl_Type *add_new_widget_from_user(Fl_Type *inPrototype, Strategy strategy) {
// Set font sizes...
wt->o->labelsize(layout->labelsize);
- wt->o->labelfont(layout->labelfont);
+ if (layout->labelfont >= 0)
+ wt->o->labelfont(layout->labelfont);
Fl_Font f = layout->textfont;
int s = layout->textsize;
Fl_Color c;
- wt->textstuff(1, f, s, c);
- wt->textstuff(2, f, s, c);
+ if (layout->textfont >= 0)
+ wt->textstuff(1, f, s, c);
+ if (layout->textsize > 0)
+ wt->textstuff(2, f, s, c);
// Resize and/or reposition new widget...
int w = 0, h = 0;