# HG changeset patch
# User Yuya Nishihara <y...@tcha.org>
# Date 1268317985 -32400
# Branch stable
# Node ID eda32ed05cf138b0e7204064125804ea5bce0d29
# Parent  9c25484a5a67126fee57433efefcf01fac7e2ffb
hggtk: show tag/branch name with underline correctly

Fixed the following widgets:

 * Menu of repository explorer (hgtk log)
 * Branch button of commit dialog (hgtk commit)

fixes #1004

diff --git a/tortoisehg/hgtk/commit.py b/tortoisehg/hgtk/commit.py
--- a/tortoisehg/hgtk/commit.py
+++ b/tortoisehg/hgtk/commit.py
@@ -384,7 +384,7 @@ class GCommit(GStatus):
 
         mbox = gtk.HBox()
         self.connect('thg-accept', self.thgaccept)
-        self.branchbutton = gtk.Button()
+        self.branchbutton = gtk.Button(use_underline=False)
         self.branchbutton.connect('clicked', self.branch_clicked)
         mbox.pack_start(self.branchbutton, False, False, 2)
         if self.is_merge():
diff --git a/tortoisehg/hgtk/gtklib.py b/tortoisehg/hgtk/gtklib.py
--- a/tortoisehg/hgtk/gtklib.py
+++ b/tortoisehg/hgtk/gtklib.py
@@ -766,6 +766,8 @@ def create_menuitem(label, handler=None,
     check: toggle or selection state for check/radio menu item.
            Default: False.
     sensitive: sensitive state on init. Default: True.
+    use_underline: handle underline as accelerator key prefix.
+                   Default: True.
     args: an argument list for 'handler' parameter.
           Default: [] (an empty list).
     """
@@ -779,11 +781,12 @@ def create_menuitem(label, handler=None,
         menu = gtk.ImageMenuItem(label)
         menu.set_image(get_icon_image(icon))
     else:
-        menu = gtk.MenuItem(label, True)
+        menu = gtk.MenuItem(label)
     if handler:
         args = kargs.get('args', [])
         menu.connect('activate', handler, *args)
     menu.set_sensitive(kargs.get('sensitive', True))
+    menu.set_use_underline(kargs.get('use_underline', True))
     menu.set_border_width(1)
     return menu
 
diff --git a/tortoisehg/hgtk/history.py b/tortoisehg/hgtk/history.py
--- a/tortoisehg/hgtk/history.py
+++ b/tortoisehg/hgtk/history.py
@@ -274,10 +274,11 @@ class GLog(gdialog.GWindow):
             navi_b = []
             for name in lb[:10]:
                 lname = hglib.fromutf(name)
-                navi_b.append(dict(text=name, func=navigate, args=[lname]))
+                navi_b.append(dict(text=name, func=navigate, args=[lname],
+                                   use_underline=False))
                 filter_b.append(dict(text=name, name='@' + name,
                          func=self.filter_handler, args=['branch', name],
-                         asradio=True, rg='all'))
+                         asradio=True, rg='all', use_underline=False))
             if len(navi_b) > 0:
                 navi_menu.append(dict(text='----'))
                 navi_menu.append(dict(text=_('Branches'), subitems=navi_b,
@@ -289,7 +290,8 @@ class GLog(gdialog.GWindow):
         navi_t = []
         for tag in ft:
             tname = hglib.toutf(tag)
-            navi_t.append(dict(text=tname, func=navigate, args=[tag]))
+            navi_t.append(dict(text=tname, func=navigate, args=[tag],
+                               use_underline=False))
         if len(navi_t) > 0:
             if len(navi_menu) == 0:
                 navi_menu.append(dict(text='----'))

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to