aboutsummaryrefslogtreecommitdiff
path: root/src/dillo.cc
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2011-02-09 01:31:14 +0000
committercorvid <corvid@lavabit.com>2011-02-09 01:31:14 +0000
commita11a2e0366866db9409760d312eda22a5bf0a690 (patch)
treec3aaaaf329bd6725bf02a38d2af5cf04bbcf05b6 /src/dillo.cc
parent5f25bfeed977c88e2b9ee2cb5f84bb2ba46f719f (diff)
disable symbol-interpretation in labels
There was some discussion of how to do this last month in fltk-dev http://fltk.org/newsgroups.php?s10630+gfltk.development+v10640+T0
Diffstat (limited to 'src/dillo.cc')
-rw-r--r--src/dillo.cc26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/dillo.cc b/src/dillo.cc
index 440457a6..86f0a57b 100644
--- a/src/dillo.cc
+++ b/src/dillo.cc
@@ -24,8 +24,9 @@
#include <signal.h>
#include <locale.h>
-#include <FL/Fl_Window.H>
#include <FL/Fl.H>
+#include <FL/Fl_Window.H>
+#include <FL/fl_draw.H>
#include "msg.h"
#include "paths.hh"
@@ -167,6 +168,25 @@ static OptID getCmdOption(const CLI_options *options, int argc, char **argv,
}
return opt_id;
}
+
+static void custLabelDraw(const Fl_Label* o, int X, int Y, int W, int H,
+ Fl_Align align)
+{
+ const int interpret_symbols = 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_font(o->font, o->size);
+ fl_measure(o->value, W, H, interpret_symbols);
+}
+
#if 0
PORT1.3
/*
@@ -318,6 +338,10 @@ int main(int argc, char **argv)
// Sets WM_CLASS hint on X11
Fl_Window::default_xclass("dillo");
+
+ // Disable '@' interpretation in labels
+ Fl::set_labeltype(FL_NORMAL_LABEL, custLabelDraw, custLabelMeasure);
+
#if 0
PORT1.3
checkPreferredFonts();