View Issue Details

IDProjectCategoryView StatusLast Update
0027143LazarusLCLpublic2019-09-09 19:46
ReporterJanusz TomczakAssigned To 
PrioritynormalSeverityminorReproducibilityalways
Status acknowledgedResolutionopen 
Product Version1.3 (SVN)Product Build 
Target VersionFixed in Version 
Summary0027143: Glyph not properly centered in TSpeedButton
DescriptionSpacing property is missing in TEditButton. Default spacing=4. Glyph in EditButton is not centered.
Steps To ReproducePlease see the attached picture.
TagsNo tags attached.
Fixed in Revision
LazTarget-
WidgetsetWin32/Win64
Attached Files

Activities

Janusz Tomczak

2014-12-08 12:17

reporter  

eb.png (10,704 bytes)
eb.png (10,704 bytes)

Bart Broersma

2014-12-08 14:44

developer   ~0079701

Hmm, spacing determines the spacing between Glyph and Caption, so it should not have any effect when Caption is empty?

This is the hint in OI about Spacing of a TSpeedButton:
"Spacing between Glyph and Caption If Spacing is -1 and Margin is -1 then Glyph and Caption are centered and there is the same amount of space between Glyph and Caption and on the left and right. If Spacing is -1 and Margin is not -1 then Spacing will fill the remaining space.

Package
LCLBase"

Bart Broersma

2014-12-08 14:44

developer  

editbtn-with-glyph.png (8,804 bytes)
editbtn-with-glyph.png (8,804 bytes)

Bart Broersma

2014-12-08 15:03

developer   ~0079703

I implemented spacing property in r47138 nevertheless.

Vojtech Cihak

2014-12-08 15:18

reporter   ~0079705

Last edited: 2014-12-08 15:19

View 2 revisions

@ See attached image "editbtn-with-glyph.png", the glyph is perfectly centered.
 (Same in trunk as in the old implementation).
 Also the glyphs for TFilenameEdit etc. are perfectly centered as well.

I don't think so.

Thre glyph of TButtonEdit you attached is not in center, it's 1-2 pixels more to top-left than it should be.

EDIT: The same is with TFileEdit, TCalcEdit etc., I can see it in Qt.

Janusz Tomczak

2014-12-09 15:25

reporter   ~0079717

Thanks for implement.

Bart Broersma

2014-12-09 16:13

developer   ~0079719

> Thre glyph of TButtonEdit you attached is not in center, it's 1-2 pixels more
> to top-left than it should be.

I take your word for it, I need better glasses to detect that ;-)

It should be the same for a normal TSpeedButton.
Again: Spacing should have no effect when Caption is empty.
Can you test with TSpeedButton to see if it behaves differently (which would be odd)?

Janusz Tomczak

2014-12-10 13:24

reporter   ~0079735

Not working yet.
Glyphs in EditButton and SpeedButton is not centered.
Probably problem is in procedure TCustomSpeedButton.MeasureDraw (speedbutton.inc), when calculate glyph position.

Bart Broersma

2014-12-10 14:07

developer   ~0079738

Updated summary to better reflect the problem.

Bart Broersma

2014-12-10 14:08

developer   ~0079739

Unassigning since it's not a TEditButton issue.

Bart Broersma

2014-12-11 02:30

developer   ~0079745

I blew up the speedbutton in Paint to see individual pixels, and the glyph is perfectly centered (if glyph.width-speedbutton.width is an even number, otherwise it is off by 1 pixel since we don't have half pixels).
All this on Windows.

Bart Broersma

2019-09-09 19:46

developer   ~0118009

Can anybody reproduce this at all?

Issue History

Date Modified Username Field Change
2014-12-08 12:17 Janusz Tomczak New Issue
2014-12-08 12:17 Janusz Tomczak File Added: eb.png
2014-12-08 14:14 Bart Broersma Assigned To => Bart Broersma
2014-12-08 14:14 Bart Broersma Status new => assigned
2014-12-08 14:44 Bart Broersma Note Added: 0079701
2014-12-08 14:44 Bart Broersma File Added: editbtn-with-glyph.png
2014-12-08 15:03 Bart Broersma Note Added: 0079703
2014-12-08 15:03 Bart Broersma LazTarget => -
2014-12-08 15:03 Bart Broersma Status assigned => feedback
2014-12-08 15:18 Vojtech Cihak Note Added: 0079705
2014-12-08 15:19 Vojtech Cihak Note Edited: 0079705 View Revisions
2014-12-09 15:25 Janusz Tomczak Note Added: 0079717
2014-12-09 15:25 Janusz Tomczak Status feedback => assigned
2014-12-09 16:13 Bart Broersma Note Added: 0079719
2014-12-09 16:13 Bart Broersma Status assigned => feedback
2014-12-10 13:24 Janusz Tomczak Note Added: 0079735
2014-12-10 13:24 Janusz Tomczak Status feedback => assigned
2014-12-10 14:07 Bart Broersma Note Added: 0079738
2014-12-10 14:07 Bart Broersma Summary [TEditButton] Spacing property is missing => Glyph not properly centered in TSpeedButton
2014-12-10 14:08 Bart Broersma Note Added: 0079739
2014-12-10 14:08 Bart Broersma Assigned To Bart Broersma =>
2014-12-10 14:08 Bart Broersma Status assigned => acknowledged
2014-12-11 02:30 Bart Broersma Note Added: 0079745
2019-09-09 19:46 Bart Broersma Note Added: 0118009