diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2011-04-19 13:49:08 -0300 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2011-04-19 13:49:08 -0300 |
commit | b9481f9bcc31b71b105f3a3b6d6cee320d1004c4 (patch) | |
tree | 4b4e04575204572931b81e68e369d82daa05add4 /src | |
parent | edb2435a81c2d1cdc466e17c5d1c506c3c035d8f (diff) | |
parent | b949237e024ec19cfddda9003d5905c60e8599c8 (diff) |
merge
Diffstat (limited to 'src')
-rw-r--r-- | src/dillo.cc | 27 | ||||
-rw-r--r-- | src/ui.cc | 1 |
2 files changed, 26 insertions, 2 deletions
diff --git a/src/dillo.cc b/src/dillo.cc index a45ecdd1..0e76411b 100644 --- a/src/dillo.cc +++ b/src/dillo.cc @@ -169,13 +169,16 @@ static OptID getCmdOption(const CLI_options *options, int argc, char **argv, 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 @@ 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); +} + +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 @@ int main(int argc, char **argv) // 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 @@ -524,6 +524,7 @@ Fl_Widget *UI::make_filemenu_button() 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"); |