unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Richard Hansen <rhansen@rhansen.org>
To: Po Lu <luangruo@yahoo.com>
Cc: Eli Zaretskii <eliz@gnu.org>, Lars Ingebrigtsen <larsi@gnus.org>,
	56607@debbugs.gnu.org
Subject: 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	[thread overview]
Message-ID: <dfad0cec-4121-ae54-0fc6-727bca03d942@rhansen.org> (raw)
In-Reply-To: <87v8rvca1t.fsf@yahoo.com>


[-- Attachment #1.1: Type: text/plain, Size: 1974 bytes --]

On 7/18/22 00:35, Po Lu wrote:
> Richard Hansen <rhansen@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.

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2022-07-18  5:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-17  1:52 bug#56607: 29.0.50; (setq auto-resize-tool-bars 'grow-only) has no effect (pgtk) Richard Hansen
2022-07-17  5:46 ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-17  5:57 ` Eli Zaretskii
2022-07-17 10:02   ` Eli Zaretskii
2022-07-17 23:37   ` Richard Hansen
2022-07-18  0:55     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-18  3:37       ` Richard Hansen
2022-07-18  4:35         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-18  5:43           ` Richard Hansen [this message]
2022-07-18  6:24             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-07-17  9:20 ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=dfad0cec-4121-ae54-0fc6-727bca03d942@rhansen.org \
    --to=rhansen@rhansen.org \
    --cc=56607@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=larsi@gnus.org \
    --cc=luangruo@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).