<p style="padding:0 0 0 0; margin:0 0 0 0;">Hi,</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">@Is that expected, or it must be considered a bug?</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">That depends. Bugreport title is "ToolBar separator can't change width."</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Now all dividers and separators on TToolBar can have different width.</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Therefore, saying "when created in code both Separator and <br />
divider are 23 pixels,..." is meaningless, because now, what you set is what you get:</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">procedure TForm1.Button2Click(Sender: TObject);<br />
var aTBtn: TToolButton;<br />
begin<br />
aTBtn:=TToolButton.Create(self);<br />
aTBtn.Style:=tbsSeparator;<br />
aTBtn.Width:=10;<br />
aTBtn.Parent:=ToolBar1;<br />
end;<br />
<br />
procedure TForm1.Button3Click(Sender: TObject);<br />
var aTBtn: TToolButton;<br />
begin<br />
aTBtn:=TToolButton.Create(self);<br />
aTBtn.Style:=tbsDivider;<br />
aTBtn.Width:=5;<br />
aTBtn.Parent:=ToolBar1;<br />
end;</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Currently, there's probably nothing like default width of separator or divider.</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">I can look on it, maybe adding code to Style setter would solve it:</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">procedure TToolButton.SetStyle(Value: TToolButtonStyle);<br />
begin<br />
if FStyle = Value then exit;<br />
FStyle := Value;<br />
if Value = tbsSeparator then Width := 10;<br />
if Value = tbsDivider then Width := 5;<br />
InvalidatePreferredSize;<br />
if IsControlVisible then<br />
UpdateVisibleToolbar;<br />
end; </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">I'll test it. </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"> </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">Vojtěch </p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">______________________________________________________________</p>
<p style="padding:0 0 0 0; margin:0 0 0 0;"><br />
> Od: Giuliano Colla <giuliano.colla@fastwebnet.it><br />
> Komu: Lazarus mailing list <lazarus@lists.lazarus.freepascal.org><br />
> Datum: 09.11.2014 11:57<br />
> Předmět: [Lazarus] Toolbar divider issues<br />
></p>
<p style="padding:0 0 0 0; margin:0 0 0 0;">With rev 46741 (patch from bug 25291) the default width of Toolbar <br />
Divider and Separator has become inconsistent.<br />
<br />
Before the patch, both from IDE designer and from component created in <br />
code, Separator width was 10 pixels, and Divider width 5 pixels.<br />
<br />
After the patch, from IDE designer Separator width has become 23 pixels, <br />
and Divider width 3 pixels; when created in code both Separator and <br />
divider are 23 pixels, as it can be seen in Editortoolbar.<br />
<br />
Giuliano<br />
_______________________________________________<br />
Lazarus mailing list<br />
Lazarus@lists.lazarus.freepascal.org<br />
<a href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a></p>