LCL: toolbar: High-DPI: drop-down width

git-svn-id: trunk@54230 -
This commit is contained in:
ondrej 2017-02-21 18:18:12 +00:00
parent 57d740ca4a
commit c49da67b40

View File

@ -351,8 +351,6 @@ begin
BeginUpdate; BeginUpdate;
try try
SetButtonSize(Round(ButtonWidth * AXProportion), Round(ButtonHeight * AYProportion)); SetButtonSize(Round(ButtonWidth * AXProportion), Round(ButtonHeight * AYProportion));
FThemeButtonDropWidth := Round(FThemeButtonDropWidth * AXProportion);
FThemeDropDownWidth := Round(FThemeDropDownWidth * AXProportion);
if DropDownWidth<>cDropDownWidth then if DropDownWidth<>cDropDownWidth then
DropDownWidth := Round(DropDownWidth * AXProportion); DropDownWidth := Round(DropDownWidth * AXProportion);
FToolBarFlags := FToolBarFlags + [tbfUpdateVisibleBarNeeded]; FToolBarFlags := FToolBarFlags + [tbfUpdateVisibleBarNeeded];
@ -451,7 +449,7 @@ end;
function TToolBar.GetRealDropDownWidth: Integer; function TToolBar.GetRealDropDownWidth: Integer;
begin begin
if FDropDownWidth < 0 then if FDropDownWidth < 0 then
Result := FThemeDropDownWidth Result := MulDiv(FThemeDropDownWidth, Font.PixelsPerInch, Screen.PixelsPerInch)
else else
Result := FDropDownWidth; Result := FDropDownWidth;
end; end;
@ -459,7 +457,7 @@ end;
function TToolBar.GetRealButtonDropWidth: Integer; function TToolBar.GetRealButtonDropWidth: Integer;
begin begin
if FDropDownWidth < 0 then if FDropDownWidth < 0 then
Result := FThemeButtonDropWidth Result := MulDiv(FThemeButtonDropWidth, Font.PixelsPerInch, Screen.PixelsPerInch)
else else
Result := FDropDownWidth+FThemeButtonDropWidth-FThemeDropDownWidth; Result := FDropDownWidth+FThemeButtonDropWidth-FThemeDropDownWidth;
end; end;