| Ticket UUID: | 3414673 | |||
| Title: | Improper look of ttk::checkbutton -style Toolbutton | |||
| Type: | Bug | Version: | 8.6.18, 9.0.5, 9.1.0 | |
| Submitter: | zbigniew_b | Created on: | 2011-09-27 20:02:32 | |
| Subsystem: | 88. Themed Tk | Assigned To: | jenglish | |
| Priority: | 5 Medium | Severity: | Minor | |
| Status: | Closed | Last Modified: | 2026-10-02 18:59:39 | |
| Resolution: | Fixed | Closed By: | nemethi | |
| Closed on: | 2026-10-02 18:59:39 | |||
| Description: |
Currently it has improperly arranged borders: it doesn't look by now as "pressed", but rather still like raised - with the difference, that the light comes from "bottom right". IMHO the white "border" (bottom and right) should be removed completely, then it would look as "pressed" (checked on Linux, Tk8.6b2, all themes). Making bottom and right sides "lit" is wrong; either they should be as gray, as the background (or in any other bg colour), or they should be 1-pixel thick black line. How does it look presently: http://postimage.org/image/c68zo0xw/ (Upper: "untouched" (sets the associated variable to 0), the lower one: "depressed" - which, in fact, doesn't look as "pushed in". The "default" style - but the same problem is using all the other styles). | |||
| User Comments: |
nemethi (claiming to be Csaba Nemethi) added on 2026-10-02 18:59:39:
Many thanks, Serhiy! Merged into main, core-9-0-branch, and core-8-6-branch by commits [bfa641b9], [fe646610], and [7d19595b]. serhiy.storchaka added on 2026-09-30 14:58:18: The colors of the sunken border are the usual ones (dark top and left, light bottom and right) and the same as for a pressed TButton. What is missing is the shift of the contents: TButton sets -shiftrelief 1 in the default, alt and winnative themes, but Toolbutton does not (only classic sets it), so a pressed or checked Toolbutton gets the sunken border without moving its contents. In the clam theme, whose border does not show the relief, a checked Toolbutton looked the same as an unchecked one. Other toolkits: the styles which shift the contents of pressed buttons (Windows toolbars in comctl32, Qt's Windows styles, GTK 2 themes such as Clearlooks and Redmond) shift checked tool buttons in the same way as pressed ones and as push buttons; flat styles (GTK 3 and 4, Qt Fusion, WinForms, macOS) shift neither, but show the pressed and checked states by a darker background, as clam does. Proposed fix in branch toolbutton-pressed-look: -shiftrelief 1 for Toolbutton in the default, alt and winnative themes, and the pressed background for a checked Toolbutton in the clam theme. Test ttk-17.2. Tested on Linux/X11 and Windows 11. Win32 toolbars also fill a checked button with a dither of the highlight and face colors; the winnative theme could do the same, but this is left for later. zbigniew_b added on 2011-09-29 03:04:43: I would to add, that a very good example, how "depressed" button should look like, is the look of "ordinary" tk button, for example: pack [button .b -image $someImage -relief flat -highlightthickness 0] When clicking (and holding LMB), such button has proper "look & feel" of depressed button (properly "lit" still from top-left, and the image has been slightly moved diagonally in bottom-right direction). So there's not much more than copy the existing, available solution. | |||
Home
Timeline
Branches
Tags
Forum
Tickets
Download
Wiki