From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.devel Subject: Re: Using images in tabs Date: Wed, 18 Sep 2019 15:43:27 +0200 Message-ID: <87h859lny8.fsf@gnus.org> References: <87tv9ir38c.fsf@mail.linkov.net> <83ftl11xdn.fsf@gnu.org> <87impxnqjm.fsf_-_@mail.linkov.net> <837e6c1zr2.fsf@gnu.org> <87o8zle0rn.fsf@mail.linkov.net> <87k1a8yngo.fsf@mail.linkov.net> <87v9tsos4k.fsf@gnus.org> <877e66oeo6.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="1954"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) Cc: Eli Zaretskii , Emacs developers , Yuri Khan To: Juri Linkov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Sep 18 15:43:45 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iAaFF-0000OV-Fd for ged-emacs-devel@m.gmane.org; Wed, 18 Sep 2019 15:43:45 +0200 Original-Received: from localhost ([::1]:59232 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAaFE-0006Be-1y for ged-emacs-devel@m.gmane.org; Wed, 18 Sep 2019 09:43:44 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34911) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iAaF3-00068s-UJ for emacs-devel@gnu.org; Wed, 18 Sep 2019 09:43:35 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iAaF2-0005uq-R3 for emacs-devel@gnu.org; Wed, 18 Sep 2019 09:43:33 -0400 Original-Received: from quimby.gnus.org ([80.91.231.51]:52182) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iAaF2-0005uS-Iu; Wed, 18 Sep 2019 09:43:32 -0400 Original-Received: from cm-84.212.202.86.getinternet.no ([84.212.202.86] helo=marnie) by quimby.gnus.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iAaEx-0002Dh-Rb; Wed, 18 Sep 2019 15:43:30 +0200 In-Reply-To: <877e66oeo6.fsf@mail.linkov.net> (Juri Linkov's message of "Tue, 17 Sep 2019 23:33:21 +0300") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 80.91.231.51 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:240139 Archived-At: Juri Linkov writes: > Maybe xg_get_scale should be exposed to Lisp, then find-image > could use it to choose a suitable image specification among e.g. > > etc/images/icons/hicolor/16x16/ > etc/images/icons/hicolor/24x24/ > etc/images/icons/hicolor/32x32/ > etc/images/icons/hicolor/48x48/ > etc/images/icons/hicolor/128x128/ > etc/images/icons/hicolor/scalable/ > > Similar subdirs could be added to other images as well > because this problem exists for other features, e.g. for > subtree arrows in customization buffers, tool-bar icons, etc. Yup. Emacs currently auto-scales images using this very er ad-hoc method: (defun image-compute-scaling-factor (scaling) [...] ((eq scaling 'auto) (let ((width (/ (float (window-width nil t)) (window-width)))) ;; If we assume that a typical character is 10 pixels in width, ;; then we should scale all images according to how wide they ;; are. But don't scale images down. (if (< width 10) 1 (/ (float width) 10)))) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no