From 038bb372cd0400e71b47b156e39dabaa01b599d4 Mon Sep 17 00:00:00 2001 From: corvid Date: Wed, 27 Jul 2011 00:06:33 +0000 Subject: disable symbol/shortcut interpretation in the downloads dpi's labels TODO: '@' in the wget output tooltip --- dpi/downloads.cc | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'dpi/downloads.cc') 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); -- cgit v1.2.3