summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dpi/downloads.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/dpi/downloads.cc b/dpi/downloads.cc
index 32c72420..d565001b 100644
--- a/dpi/downloads.cc
+++ b/dpi/downloads.cc
@@ -1092,6 +1092,29 @@ DLWin::DLWin(int ww, int wh) {
// ---------------------------------------------------------------------------
+/*
+ * Set FL_NORMAL_LABEL to interpret neither symbols (@) nor shortcuts (&)
+ */
+static void custLabelDraw(const Fl_Label* o, int X, int Y, int W, int H,
+ Fl_Align align)
+{
+ const int interpret_symbols = 0;
+
+ fl_draw_shortcut = 0;
+ fl_font(o->font, o->size);
+ fl_color((Fl_Color)o->color);
+ fl_draw(o->value, X, Y, W, H, align, o->image, interpret_symbols);
+}
+
+static void custLabelMeasure(const Fl_Label* o, int& W, int& H)
+{
+ const int interpret_symbols = 0;
+
+ fl_draw_shortcut = 0;
+ fl_font(o->font, o->size);
+ fl_measure(o->value, W, H, interpret_symbols);
+}
+
//int main(int argc, char **argv)
@@ -1101,6 +1124,9 @@ int main()
Fl::lock();
+ // Disable '@' and '&' interpretation in normal labels.
+ Fl::set_labeltype(FL_NORMAL_LABEL, custLabelDraw, custLabelMeasure);
+
// Create the download window
dl_win = new DLWin(ww, wh);