Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

%button layout/sizing bug

Đang mở
#291 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
38/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
macos
Lĩnh vực
desktop

Hướng nghiên cứu

Bắt đầu bằng cách chạy bản tái hiện %button and horizontal-panel% được cung cấp trên macOS 13.2.1, sau đó theo dõi hành vi về kích thước và lề của nút. Công việc được xem là hoàn tất khi các nút nhiều dòng không còn nhận chiều rộng tối thiểu quá mức, có thể thu hẹp đến mức nội dung cho phép và vẫn giữ lề gọn gàng tương đương với các nút một dòng.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Racket
Star
68
Fork
83
Merge trung bình
9 ngày 8 giờ
Pull request đã merge (30 ngày)
4

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của racket/gui

Tất cả issue của racket/gui

Issue tương tự

Thêm issue về Desktop Dev

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.