From 4472e0fdac7e83bd7db6e891d27c7f5d9309d390 Mon Sep 17 00:00:00 2001 From: corvid Date: Sat, 3 Sep 2011 01:15:33 +0000 Subject: use Fl::option() when disabling UI tooltips --- src/dillo.cc | 5 +++++ src/findbar.cc | 12 +++++------- src/ui.cc | 34 ++++++++++++++-------------------- 3 files changed, 24 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/dillo.cc b/src/dillo.cc index e5fca5c5..5e6615c2 100644 --- a/src/dillo.cc +++ b/src/dillo.cc @@ -365,6 +365,11 @@ int main(int argc, char **argv) // Sets WM_CLASS hint on X11 Fl_Window::default_xclass("dillo"); + if (!prefs.show_tooltip) { + // turn off UI tooltips + Fl::option(Fl::OPTION_SHOW_TOOLTIPS, false); + } + // Disable '@' and '&' interpretation in normal labels. Fl::set_labeltype(FL_NORMAL_LABEL, custLabelDraw, custLabelMeasure); diff --git a/src/findbar.cc b/src/findbar.cc index dcb9db53..47363db0 100644 --- a/src/findbar.cc +++ b/src/findbar.cc @@ -125,6 +125,7 @@ Findbar::Findbar(int width, int height) : hide_btn->callback(hide_cb, this); hide_btn->clear_visible_focus(); hide_btn->box(FL_THIN_UP_BOX); + hide_btn->tooltip("Hide"); add(hide_btn); i = new MyInput(x, border, input_width, height); @@ -140,6 +141,8 @@ Findbar::Findbar(int width, int height) : next_btn->callback(search_cb, this); next_btn->clear_visible_focus(); next_btn->box(FL_THIN_UP_BOX); + next_btn->tooltip("Find next occurrence of the search phrase\n" + "shortcut: Enter"); add(next_btn); prev_btn= new Fl_Button(x, border, button_width, height, "Previous"); @@ -148,6 +151,8 @@ Findbar::Findbar(int width, int height) : prev_btn->callback(searchBackwards_cb, this); prev_btn->clear_visible_focus(); prev_btn->box(FL_THIN_UP_BOX); + prev_btn->tooltip("Find previous occurrence of the search phrase\n" + "shortcut: Shift+Enter"); add(prev_btn); check_btn = new Fl_Check_Button(x, border, 2*button_width, height, @@ -156,13 +161,6 @@ Findbar::Findbar(int width, int height) : check_btn->clear_visible_focus(); add(check_btn); - if (prefs.show_tooltip) { - hide_btn->tooltip("Hide"); - next_btn->tooltip("Find next occurrence of the search phrase\n" - "shortcut: Enter"); - prev_btn->tooltip("Find previous occurrence of the search phrase\n" - "shortcut: Shift+Enter"); - } } Findbar::~Findbar() diff --git a/src/ui.cc b/src/ui.cc index 33022440..fe68f408 100644 --- a/src/ui.cc +++ b/src/ui.cc @@ -408,16 +408,14 @@ void UI::make_toolbar(int tw, int th) Bookmarks = make_button("Book", icons->ImgBook, NULL, UI_BOOK); Tools = make_button("Tools", icons->ImgTools, NULL, UI_TOOLS); - if (prefs.show_tooltip) { - Back->tooltip("Previous page"); - Forw->tooltip("Next page"); - Home->tooltip("Go to the Home page"); - Reload->tooltip("Reload"); - Save->tooltip("Save this page"); - Stop->tooltip("Stop loading"); - Bookmarks->tooltip("View bookmarks"); - Tools->tooltip("Settings"); - } + Back->tooltip("Previous page"); + Forw->tooltip("Next page"); + Home->tooltip("Go to the Home page"); + Reload->tooltip("Reload"); + Save->tooltip("Save this page"); + Stop->tooltip("Stop loading"); + Bookmarks->tooltip("View bookmarks"); + Tools->tooltip("Settings"); } /* @@ -432,12 +430,14 @@ void UI::make_location(int ww) b->callback(clear_cb, this); b->clear_visible_focus(); b->box(FL_THIN_UP_BOX); + b->tooltip("Clear the URL box.\nMiddle-click to paste a URL."); p_xpos += b->w(); Fl_Input *i = Location = new CustInput(p_xpos,0,ww-p_xpos-32,lh,0); i->color(CuteColor); i->when(FL_WHEN_ENTER_KEY); i->callback(location_cb, this); + i->tooltip("Location"); p_xpos += i->w(); Search = b = new CustLightButton(p_xpos,0,16,lh,0); @@ -445,6 +445,7 @@ void UI::make_location(int ww) b->callback(search_cb, this); b->clear_visible_focus(); b->box(FL_THIN_UP_BOX); + b->tooltip("Search the Web"); p_xpos += b->w(); Help = b = new CustLightButton(p_xpos,0,16,lh,0); @@ -452,14 +453,9 @@ void UI::make_location(int ww) b->callback(help_cb, this); b->clear_visible_focus(); b->box(FL_THIN_UP_BOX); + b->tooltip("Help"); p_xpos += b->w(); - if (prefs.show_tooltip) { - Clear->tooltip("Clear the URL box.\nMiddle-click to paste a URL."); - Location->tooltip("Location"); - Search->tooltip("Search the Web"); - Help->tooltip("Help"); - } } /* @@ -503,8 +499,7 @@ Fl_Widget *UI::make_filemenu_button() _MSG("UI::make_filemenu_button w=%d h=%d padding=%d\n", w, h, padding); btn->box(FL_THIN_UP_BOX); btn->callback(filemenu_cb, this); - if (prefs.show_tooltip) - btn->tooltip("File menu"); + btn->tooltip("File menu"); btn->clear_visible_focus(); if (!prefs.show_filemenu) btn->hide(); @@ -614,8 +609,7 @@ void UI::make_status_bar(int ww, int wh) BugMeter->image(icons->ImgMeterOK); BugMeter->box(FL_THIN_DOWN_BOX); BugMeter->align(FL_ALIGN_INSIDE | FL_ALIGN_TEXT_NEXT_TO_IMAGE); - if (prefs.show_tooltip) - BugMeter->tooltip("Show HTML bugs\n(right-click for menu)"); + BugMeter->tooltip("Show HTML bugs\n(right-click for menu)"); BugMeter->callback(bugmeter_cb, this); BugMeter->clear_visible_focus(); -- cgit v1.2.3