mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 09:36:42 +02:00
Qt: fixed getting displaysize of TListView.Item drIcon. part of issue #27509
git-svn-id: trunk@47923 -
This commit is contained in:
parent
842dc80fd5
commit
eaf152e0d7
@ -1607,16 +1607,33 @@ begin
|
|||||||
if ACode in [drIcon] then
|
if ACode in [drIcon] then
|
||||||
begin
|
begin
|
||||||
AIcon := QIcon_create();
|
AIcon := QIcon_create();
|
||||||
QTreeWidgetItem_icon(TWI, AIcon, 0);
|
try
|
||||||
if not QIcon_isNull(AIcon) then
|
QTreeWidgetItem_icon(TWI, AIcon, 0);
|
||||||
begin
|
if not QIcon_isNull(AIcon) then
|
||||||
Size.cx := 0;
|
begin
|
||||||
Size.cy := 0;
|
Size.cx := 0;
|
||||||
QIcon_actualSize(AIcon, @Size, @Size);
|
Size.cy := 0;
|
||||||
Result.Right := Result.Left + Size.cx;
|
QIcon_actualSize(AIcon, @Size, @Size);
|
||||||
Result.Bottom := Result.Top + Size.cy;
|
if (Size.cx = 0) or (Size.cy = 0) then
|
||||||
|
begin
|
||||||
|
if Assigned(TCustomListViewHack(ALV).SmallImages) then
|
||||||
|
Result.Right := Result.Left + TCustomListViewHack(ALV).SmallImages.Width;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
Result.Right := Result.Left + Size.cx;
|
||||||
|
Result.Bottom := Result.Top + Size.cy;
|
||||||
|
end;
|
||||||
|
end else
|
||||||
|
begin
|
||||||
|
if QtTreeWidget.OwnerData then
|
||||||
|
begin
|
||||||
|
if Assigned(TCustomListViewHack(ALV).SmallImages) then
|
||||||
|
Result.Right := Result.Left + TCustomListViewHack(ALV).SmallImages.Width;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
finally
|
||||||
|
QIcon_destroy(AIcon);
|
||||||
end;
|
end;
|
||||||
QIcon_destroy(AIcon);
|
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user