aboutsummaryrefslogtreecommitdiff
path: root/dpi/downloads.cc
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2011-07-27 00:06:33 +0000
committercorvid <corvid@lavabit.com>2011-07-27 00:06:33 +0000
commit038bb372cd0400e71b47b156e39dabaa01b599d4 (patch)
treef092716122745567a52775d7f0d8762bd3f51de5 /dpi/downloads.cc
parent8f2c3adf4cae04c723ef115ec471939f3e0e1720 (diff)
disable symbol/shortcut interpretation in the downloads dpi's labels
TODO: '@' in the wget output tooltip
Diffstat (limited to 'dpi/downloads.cc')
-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);