changeset 1971:a529c15e35bd

merge
author Jorge Arellano Cid <jcid@dillo.org>
date Tue, 19 Apr 2011 13:49:08 -0300
parents b0a67ac65949 (current diff) 7bfc11c78869 (diff)
children e4be2e379f81
files
diffstat 2 files changed, 26 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/dillo.cc	Tue Apr 19 02:07:57 2011 +0000
+++ b/src/dillo.cc	Tue Apr 19 13:49:08 2011 -0300
@@ -169,13 +169,16 @@
    return opt_id;
 }
 
+/*
+ * We'll set FL_NORMAL_LABEL to not interpret special symbols,
+ * and FL_FREE_LABELTYPE to interpret them.
+ */
 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);
@@ -186,7 +189,26 @@
    const int interpret_symbols = 0;
 
    fl_draw_shortcut = 0;
+   fl_font(o->font, o->size);
+   fl_measure(o->value, W, H, interpret_symbols);
+}
 
+static void custMenuLabelDraw(const Fl_Label* o, int X, int Y, int W, int H,
+                              Fl_Align align)
+{
+   const int interpret_symbols = 0;
+
+   fl_draw_shortcut = 1;
+   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 custMenuLabelMeasure(const Fl_Label* o, int& W, int& H)
+{
+   const int interpret_symbols = 1;
+
+   fl_draw_shortcut = 1;
    fl_font(o->font, o->size);
    fl_measure(o->value, W, H, interpret_symbols);
 }
@@ -343,8 +365,9 @@
    // Sets WM_CLASS hint on X11
    Fl_Window::default_xclass("dillo");
 
-   // Disable '@' interpretation in labels
+   // Disable '@' interpretation in normal labels
    Fl::set_labeltype(FL_NORMAL_LABEL, custLabelDraw, custLabelMeasure);
+   Fl::set_labeltype(FL_FREE_LABELTYPE,custMenuLabelDraw,custMenuLabelMeasure);
 
 #if 0
 PORT1.3
--- a/src/ui.cc	Tue Apr 19 02:07:57 2011 +0000
+++ b/src/ui.cc	Tue Apr 19 13:49:08 2011 -0300
@@ -524,6 +524,7 @@
    int w,h, padding;
 
    FileButton = btn = new Fl_Button(p_xpos,0,0,0,"W");
+   btn->labeltype(FL_FREE_LABELTYPE);
    btn->measure_label(w, h);
    padding = w;
    btn->copy_label(PanelSize == P_tiny ? "&F" : "&File");