Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

%button layout/sizing bug

オープン
#291 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
38/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
macos
領域
desktop

調査の方向性

まず macOS 13.2.1 で提供された %button and horizontal-panel% の再現手順を実行し、次にボタンのサイズとマージンの挙動を追跡します。完了の条件は、複数行のボタンに過剰な最小幅が設定されなくなり、コンテンツが許す限り狭くでき、1 行のボタンと同等に適切なマージンを維持できることです。

索引モデルが issue の本文から書いたものです。

説明

The following demonstrates a subtle %button layout/sizing bug, which results in multi-line %button's being wider, and given proportionately less horizontal margin, than its single-line counterpart.

(when run under macos 13.2.1)...


#lang racket/gui
(define dialog (instantiate dialog% ("X")))

(define hpanel-1 (new horizontal-panel% [parent dialog] [horiz-margin 0]))
(new button% [parent hpanel-1] [label "X"]) ; much wider than it need be
(new button% [parent hpanel-1] [label "X"])
(new button% [parent hpanel-1] [label "X"])

(define hpanel-2 (new horizontal-panel% [parent dialog] [horiz-margin 0]))
(new button% [parent hpanel-2] [label "XXXX"]) ; max text prior to stretching
(new button% [parent hpanel-2] [label "XXXX"])
(new button% [parent hpanel-2] [label "XXXX"])

(define hpanel-4 (new horizontal-panel% [parent dialog] [horiz-margin 0]))
(new button% [parent hpanel-4] [label "X\nX"]) ; wider with less margin
(new button% [parent hpanel-4] [label "X\nX"])
(new button% [parent hpanel-4] [label "X\nX"])

(define hpanel-5 (new horizontal-panel% [parent dialog] [horiz-margin 0]))
(new button% [parent hpanel-5] [label "XXXXX\nXXXXX"]) ; max text prior to stretching
(new button% [parent hpanel-5] [label "XXXXX\nXXXXX"])
(new button% [parent hpanel-5] [label "XXXXX\nXXXXX"])

(send dialog show #t)


I personally prefer the less default margin associated with the multi-line %button; but would also strongly prefer their min-width be reduced to being no larger the min-height of the button (for a single line button), and thereby can be as small as required to be square and display a single character (or Nx1 chars for multi-line buttons, and thereby be N x taller than wide); and the horiz-margin around the label be reduced to be only slightly more than apparently allocated for its vert-margin, seemingly being only a few pixels or so (or whatever required to enable the smallest square button to cleanly display a single character).

This is related to the prior feature request #290.

主要言語
Racket
スター
68
フォーク
83
平均マージ
9日 8時間
マージ済み PR(30日)
4

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

racket/gui のほかの issue

racket/gui の issue をすべて見る

似ている issue

Desktop Dev の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。