changeset 1343:16ed4ed58863

only set tooltips for UI if prefs.show_tooltip set
author corvid <corvid@lavabit.com>
date Sat, 03 Oct 2009 15:29:57 +0000
parents c580c135d45c
children 9904cdebd2a6
files dillorc src/findbar.cc src/ui.cc src/uicmd.cc
diffstat 4 files changed, 44 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/dillorc	Sat Oct 03 03:39:10 2009 +0000
+++ b/dillorc	Sat Oct 03 15:29:57 2009 +0000
@@ -61,7 +61,7 @@
 # Minimum font size in pixels
 #font_min_size=6
 
-# Show tooltip popup for title attributes
+# Show tooltip popups for UI and for HTML title attributes
 #show_tooltip=YES
 
 # Set this to YES if you want to limit the word wrap width to the viewport
--- a/src/findbar.cc	Sat Oct 03 03:39:10 2009 +0000
+++ b/src/findbar.cc	Sat Oct 03 15:29:57 2009 +0000
@@ -122,7 +122,6 @@
     hide_btn = new HighlightButton(x, border, 16, height, 0);
     hideImg = new xpmImage(new_s_xpm);
     hide_btn->image(hideImg);
-    hide_btn->tooltip("Hide");
     x += 16 + gap;
     hide_btn->callback(hide_cb, this);
     hide_btn->clear_tab_to_focus();
@@ -138,16 +137,12 @@
 
     next_btn = new HighlightButton(x, border, button_width, height, "Next");
     x += button_width + gap;
-    next_btn->tooltip("Find next occurrence of the search phrase\n"
-                      "shortcut: Enter");
     next_btn->add_shortcut(ReturnKey);
     next_btn->add_shortcut(KeypadEnter);
     next_btn->callback(search_cb, this);
     next_btn->clear_tab_to_focus();
 
     prev_btn= new HighlightButton(x, border, button_width, height, "Previous");
-    prev_btn->tooltip("Find previous occurrence of the search phrase\n"
-                      "shortcut: Shift+Enter");
     prev_btn->add_shortcut(SHIFT+ReturnKey);
     prev_btn->callback(searchBackwards_cb, this);
     prev_btn->clear_tab_to_focus();
@@ -159,6 +154,14 @@
     x += 2 * button_width + gap;
 
    end();
+
+   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()
--- a/src/ui.cc	Sat Oct 03 03:39:10 2009 +0000
+++ b/src/ui.cc	Sat Oct 03 15:29:57 2009 +0000
@@ -376,56 +376,58 @@
    p1->begin();
     Back = b = new HighlightButton(xpos, 0, bw, bh, (lbl) ? "Back" : 0);
     b->image(icons->ImgLeftMulti);
-    b->tooltip("Previous page");
     b->callback(b1_cb, (void *)UI_BACK);
     b->clear_tab_to_focus();
     HighlightButton::default_style->highlight_color(CuteColor);
 
     Forw = b = new HighlightButton(xpos, 0, bw, bh, (lbl) ? "Forw" : 0);
     b->image(icons->ImgRightMulti);
-    b->tooltip("Next page");
     b->callback(b1_cb, (void *)UI_FORW);
     b->clear_tab_to_focus();
 
     Home = b = new HighlightButton(xpos, 0, bw, bh, (lbl) ? "Home" : 0);
     b->image(icons->ImgHome);
-    b->tooltip("Go to the Home page");
     b->callback(b1_cb, (void *)UI_HOME);
     b->clear_tab_to_focus();
 
     Reload = b = new HighlightButton(xpos, 0, bw, bh, (lbl) ? "Reload" : 0);
     b->image(icons->ImgReload);
-    b->tooltip("Reload");
     b->callback(b1_cb, (void *)UI_RELOAD);
     b->clear_tab_to_focus();
 
     Save = b = new HighlightButton(xpos, 0, bw, bh, (lbl) ? "Save" : 0);
     b->image(icons->ImgSave);
-    b->tooltip("Save this page");
     b->callback(b1_cb, (void *)UI_SAVE);
     b->clear_tab_to_focus();
 
     Stop = b = new HighlightButton(xpos, 0, bw, bh, (lbl) ? "Stop" : 0);
     b->image(icons->ImgStopMulti);
-    b->tooltip("Stop loading");
     b->callback(b1_cb, (void *)UI_STOP);
     b->clear_tab_to_focus();
 
     Bookmarks = b = new HighlightButton(xpos, 0, bw, bh, (lbl) ? "Book" : 0);
     b->image(icons->ImgBook);
-    b->tooltip("View bookmarks");
     b->callback(b1_cb, (void *)UI_BOOK);
     b->clear_tab_to_focus();
 
     Tools = b = new HighlightButton(xpos, 0, bw, bh, (lbl) ? "Tools" : 0);
     b->image(icons->ImgTools);
-    b->tooltip("Settings");
     b->callback(b1_cb, (void *)UI_TOOLS);
     b->clear_tab_to_focus();
 
    p1->type(PackedGroup::ALL_CHILDREN_VERTICAL);
    p1->end();
 
+   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");
+   }
    return p1;
 }
 
@@ -439,12 +441,10 @@
    pg->begin();
     Clear = b = new CustHighlightButton(2,2,16,22,0);
     b->image(icons->ImgClear);
-    b->tooltip("Clear the URL box.\nMiddle-click to paste a URL.");
     b->callback(clear_cb, this);
     b->clear_tab_to_focus();
 
     Input *i = Location = new CustInput(0,0,0,0,0);
-    i->tooltip("Location");
     i->color(CuteColor);
     i->when(WHEN_ENTER_KEY);
     i->callback(location_cb, this);
@@ -452,7 +452,6 @@
 
     Search = b = new HighlightButton(0,0,16,22,0);
     b->image(icons->ImgSearch);
-    b->tooltip("Search the Web");
     b->callback(search_cb, this);
     b->clear_tab_to_focus();
 
@@ -460,6 +459,11 @@
    pg->resizable(i);
    pg->end();
 
+   if (prefs.show_tooltip) {
+      Clear->tooltip("Clear the URL box.\nMiddle-click to paste a URL.");
+      Location->tooltip("Location");
+      Search->tooltip("Search the Web");
+   }
    return pg;
 }
 
@@ -506,7 +510,8 @@
    _MSG("UI::make_filemenu_button w=%d h=%d padding=%d\n", w, h, padding);
    btn->box(PanelSize == P_large ? FLAT_BOX : THIN_UP_BOX);
    btn->callback(filemenu_cb, this);
-   btn->tooltip("File menu");
+   if (prefs.show_tooltip)
+      btn->tooltip("File menu");
    btn->clear_tab_to_focus();
    if (!prefs.show_filemenu && PanelSize != P_large)
       btn->hide();
@@ -648,7 +653,8 @@
    BugMeter->image(icons->ImgMeterOK);
    BugMeter->box(THIN_DOWN_BOX);
    BugMeter->align(ALIGN_INSIDE|ALIGN_CLIP|ALIGN_LEFT);
-   BugMeter->tooltip("Show HTML bugs\n(right-click for menu)");
+   if (prefs.show_tooltip)
+      BugMeter->tooltip("Show HTML bugs\n(right-click for menu)");
    BugMeter->callback(bugmeter_cb, this);
    BugMeter->clear_tab_to_focus();
    g->add(BugMeter);
--- a/src/uicmd.cc	Sat Oct 03 03:39:10 2009 +0000
+++ b/src/uicmd.cc	Sat Oct 03 15:29:57 2009 +0000
@@ -273,23 +273,26 @@
          if (event_inside(r) && children() > 1) {
             /* We're inside the button area */
             cstp->btn_highlight(true);
-            /* Prepare the tooltip for pop-up */
-            tooltipEnabled = true;
-            /* We use parent() if available because we are returning 0.
-             * Returning without having TabGroup processing makes the
-             * popup event never reach 'this', but it reaches parent() */
-            toolTip->enter(parent() ? parent() : this, r, "Close current Tab");
-
+            if (prefs.show_tooltip) {
+               /* Prepare the tooltip for pop-up */
+               tooltipEnabled = true;
+               /* We use parent() if available because we are returning 0.
+                * Returning without having TabGroup processing makes the
+                * popup event never reach 'this', but it reaches parent() */
+               toolTip->enter(parent() ?parent():this, r, "Close current Tab");
+            }
             return 0;              // Change focus
          } else {
             cstp->btn_highlight(false);
 
-            /* Hide the tooltip or enable it again.*/
-            if (tooltipEnabled) {
-               tooltipEnabled = false;
-               toolTip->exit();
-            } else {
-               toolTip->enable();
+            if (prefs.show_tooltip) {
+               /* Hide the tooltip or enable it again.*/
+               if (tooltipEnabled) {
+                  tooltipEnabled = false;
+                  toolTip->exit();
+               } else {
+                  toolTip->enable();
+               }
             }
          }
       } else if (e == PUSH && event_inside(r) &&