GNU bug report logs - #56607
29.0.50; (setq auto-resize-tool-bars 'grow-only) has no effect (pgtk)

Previous Next

Package: emacs;

Reported by: Richard Hansen <rhansen <at> rhansen.org>

Date: Sun, 17 Jul 2022 01:53:02 UTC

Severity: normal

Found in version 29.0.50

Full log


Message #32 received at 56607 <at> debbugs.gnu.org (full text, mbox):

From: Richard Hansen <rhansen <at> rhansen.org>
To: Po Lu <luangruo <at> yahoo.com>
Cc: Eli Zaretskii <eliz <at> gnu.org>, Lars Ingebrigtsen <larsi <at> gnus.org>,
 56607 <at> debbugs.gnu.org
Subject: Re: bug#56607: 29.0.50; (setq auto-resize-tool-bars 'grow-only) has
 no effect (pgtk)
Date: Mon, 18 Jul 2022 01:43:32 -0400
[Message part 1 (text/plain, inline)]
On 7/18/22 00:35, Po Lu wrote:
> Richard Hansen <rhansen <at> rhansen.org> writes:
> 
>> Can the dimensions of the toolbar be inspected?
> 
> Yes, the height and width are constant when the tool bar is on the top
> or bottom.  When the tool bar is on the left or right of the frame, then
> resizing can happen, but in that case I'm not sure how it works.
> 
>> If so, we can force the container widget to never shrink if
>> `auto-resize-tool-bars' is `grow-only'.
> 
> GTK never resizes the tool bar itself, so I'm not sure how that would
> make a difference.

What I mean is we would inspect the size of the toolbar (before any clipping required to fit inside the container widget) then adjust the size of the container widget appropriately.

> 
>> If the toolbar width changes, we could do the (un)wrapping ourselves: 
>> move the buttons to/from another toolbar underneath the upper toolbar. 
>> The lower toolbar would still be inside the same container widget as 
>> the upper toolbar, and `grow-only' would pay attention to the sum of 
>> the heights of the toolbars.  Would that work?
> 
> Maybe, but it's a lot of trouble to create such a feature that the GTK 
> developers are bound to break at some point.

That's a good point.  Out of curiosity I looked into GTK4 and they did away with the toolbar class.  Users should instead use a GtkBox containing buttons, and apply appropriate styling.  libadwaita provides a toolbar style class for this purpose [1].  I'm guessing it would be straightforward to implement toolbar button wrapping in GTK4, if/when Emacs migrates to it.

[1] https://gnome.pages.gitlab.gnome.org/libadwaita/doc/1-latest/style-classes.html#toolbars

> 
> I'd rather just disable auto-resize-tool-bars under GTK.  That's not a 
> feature GTK tool bars are designed to support.

Fair enough.  In the meantime I filed bug#56627 about the inconsistent toolbar button icon sizing.  Maybe that issue is easier to fix.
[OpenPGP_signature (application/pgp-signature, attachment)]

This bug report was last modified 3 years and 28 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.