From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: David Reitter Newsgroups: gmane.emacs.devel Subject: tool-bar (Carbon port): labels under icons Date: Sat, 5 Apr 2008 08:50:01 +0100 Message-ID: <1B41BDB3-EFEC-4CFC-8006-2233F8D90024@inf.ed.ac.uk> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v919.2) Content-Type: multipart/mixed; boundary=Apple-Mail-53--706148636 X-Trace: ger.gmane.org 1207381827 19473 80.91.229.12 (5 Apr 2008 07:50:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 5 Apr 2008 07:50:27 +0000 (UTC) To: emacs- devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Apr 05 09:51:00 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1Ji3Ar-0005Wn-BG for ged-emacs-devel@m.gmane.org; Sat, 05 Apr 2008 09:50:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ji3AE-0003h2-Hy for ged-emacs-devel@m.gmane.org; Sat, 05 Apr 2008 03:50:14 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Ji3AA-0003gn-MQ for emacs-devel@gnu.org; Sat, 05 Apr 2008 03:50:10 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Ji3A9-0003gb-T5 for emacs-devel@gnu.org; Sat, 05 Apr 2008 03:50:10 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ji3A9-0003gY-Ly for emacs-devel@gnu.org; Sat, 05 Apr 2008 03:50:09 -0400 Original-Received: from mx20.gnu.org ([199.232.41.8]) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Ji3A9-0008HB-7x for emacs-devel@gnu.org; Sat, 05 Apr 2008 03:50:09 -0400 Original-Received: from fk-out-0910.google.com ([209.85.128.187]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Ji3A6-0005fG-L2 for emacs-devel@gnu.org; Sat, 05 Apr 2008 03:50:08 -0400 Original-Received: by fk-out-0910.google.com with SMTP id 26so564485fkx.10 for ; Sat, 05 Apr 2008 00:50:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to:content-type:mime-version:subject:date:x-mailer:sender; bh=O/D+crZRLpLhFk34QsY7GZOIYqS/hTWzDPtLcAWkrnY=; b=YEYguH0nGOl9c3yb29goTVTOkqrZWtk2h+AlhgQ9DbCt+mR2+dygxbJyZoZTzfQT/ViXev7u4ZZ2OfYH/3kXKvbfCHpmlyZGl5pb33ykxhSdzw+hYZt+Sm61qUc2mouxjGO7ipmf+U4ZUW8N7SOxvPxUBzMpyl9bKv69vR1KHVw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:content-type:mime-version:subject:date:x-mailer:sender; b=RxVTaDT3AdALy9RtRNUbAGZRHVg3qwl2hM5w6O8im2XrA2t1N09G98vSGG7akOMek5jPFTqNRERNYH/SIk3QilQMa1wq5zS7UjGfsb2rJyahbxdJUsq+D0LGEDMU1YcBbngEhDjQEu/ZhLglgLnPooLZEoxJx2x2ZtiOZhB8UBE= Original-Received: by 10.78.90.8 with SMTP id n8mr535799hub.112.1207381804911; Sat, 05 Apr 2008 00:50:04 -0700 (PDT) Original-Received: from scarlett.lan ( [89.241.128.168]) by mx.google.com with ESMTPS id 2sm5509703nfv.34.2008.04.05.00.50.03 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 05 Apr 2008 00:50:03 -0700 (PDT) X-Mailer: Apple Mail (2.919.2) X-detected-kernel: by mx20.gnu.org: Linux 2.6 (newer, 2) X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:94392 Archived-At: --Apple-Mail-53--706148636 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Can I suggest the following patch that allows the use of labels under the icons as is standard on the OS? 2008-04-05 David Reitter * tool-bar.el (tool-bar-local-item): Accept string for KEY as icon label. (tool-bar-setup): Use readable strings for labels. 2008-04-05 David Reitter * macterm.c [USE_MAC_TOOLBAR]: Add Vmac_tool_bar_display_mode. (update_frame_tool_bar) [USE_MAC_TOOLBAR]: set display mode. --Apple-Mail-53--706148636 Content-Disposition: attachment; filename=tool-bar-display-mode.patch Content-Type: application/octet-stream; x-mac-creator=454D4178; x-unix-mode=0644; x-mac-type=54455854; name="tool-bar-display-mode.patch" Content-Transfer-Encoding: 7bit Index: src/macterm.c =================================================================== RCS file: /sources/emacs/emacs/src/macterm.c,v retrieving revision 1.214.2.16 diff -c -r1.214.2.16 macterm.c *** src/macterm.c 29 Mar 2008 00:46:51 -0000 1.214.2.16 --- src/macterm.c 5 Apr 2008 07:42:28 -0000 *************** *** 87,92 **** --- 87,97 ---- Lisp_Object Vx_toolkit_scroll_bars; + #if USE_MAC_TOOLBAR + /* Specify whether to display the tool bar as icons with labels. */ + Lisp_Object Vmac_tool_bar_display_mode; + #endif + /* If non-zero, the text will be rendered using Core Graphics text rendering which may anti-alias the text. */ int mac_use_core_graphics; *************** *** 5955,5961 **** } if (err == noErr) ! err = HIToolbarSetDisplayMode (toolbar, kHIToolbarDisplayModeIconOnly); if (err == noErr) { static const EventTypeSpec specs[] = --- 5985,5991 ---- } if (err == noErr) ! err = HIToolbarSetDisplayMode (toolbar, kHIToolbarDisplayModeDefault); if (err == noErr) { static const EventTypeSpec specs[] = *** 6099,6104 **** --- 6130,6148 ---- while (pos < old_count) HIToolbarRemoveItemAtIndex (toolbar, --old_count); + if (EQ (Vmac_tool_bar_display_mode, intern ("labels"))) + { + HIToolbarSetDisplayMode (toolbar, kHIToolbarDisplayModeIconAndLabel); + } + else if (EQ (Vmac_tool_bar_display_mode, intern ("icons"))) + { + HIToolbarSetDisplayMode (toolbar, kHIToolbarDisplayModeIconOnly); + } + else + { + HIToolbarSetDisplayMode (toolbar, kHIToolbarDisplayModeDefault); + } + ShowHideWindowToolbar (FRAME_MAC_WINDOW (f), true, !win_gravity && f == mac_focus_frame (dpyinfo)); /* Mac OS X 10.3 does not issue kEventWindowBoundsChanged events on *************** *** 12984,12989 **** --- 13028,13042 ---- mouse-3 and the command-key will register for mouse-2. */); Vmac_emulate_three_button_mouse = Qnil; + #if USE_MAC_TOOLBAR + DEFVAR_LISP ("mac-tool-bar-display-mode", &Vmac_tool_bar_display_mode, + doc: /* *Specify whether to display the tool bar as icons with labels. + The value can be `icons' (for icons only), `labels' (for icons with labels) + and nil, in which case the system default is assumed. + The default is nil. */); + Vmac_tool_bar_display_mode = Qnil; + #endif + #if TARGET_API_MAC_CARBON DEFVAR_BOOL ("mac-wheel-button-is-mouse-2", &mac_wheel_button_is_mouse_2, doc: /* *Non-nil if the wheel button is mouse-2 and the right click mouse-3. *** lisp/tool-bar.el 05 Apr 2008 01:23:45 +0100 1.7.2.2 --- lisp/tool-bar.el 05 Apr 2008 01:24:23 +0100 *************** *** 141,147 **** (unless (image-mask-p image) (setq image (append image '(:mask heuristic)))) (define-key-after map (vector key) ! `(menu-item ,(symbol-name key) ,def :image ,image ,@props))))) ;;;###autoload (defun tool-bar-add-item-from-menu (command icon &optional map &rest props) --- 141,148 ---- (unless (image-mask-p image) (setq image (append image '(:mask heuristic)))) (define-key-after map (vector key) ! `(menu-item ,(if (stringp key) key (symbol-name key)) ! ,def :image ,image ,@props))))) ;;;###autoload (defun tool-bar-add-item-from-menu (command icon &optional map &rest props) *************** *** 273,285 **** ;; we must explicitly operate on the default value. (let ((tool-bar-map (default-value 'tool-bar-map))) ! (tool-bar-add-item "preferences" 'customize 'customize :help "Edit preferences (customize)") (tool-bar-add-item "help" (lambda () (interactive) (popup-menu menu-bar-help-menu)) ! 'help :help "Pop up the Help menu")) ) --- 274,286 ---- ;; we must explicitly operate on the default value. (let ((tool-bar-map (default-value 'tool-bar-map))) ! (tool-bar-add-item "preferences" 'customize "Customize" :help "Edit preferences (customize)") (tool-bar-add-item "help" (lambda () (interactive) (popup-menu menu-bar-help-menu)) ! "Help" :help "Pop up the Help menu")) ) --Apple-Mail-53--706148636--