mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-06 13:28:59 +01:00
Qt5,Qt6: Fixed ugly item sizes in TListView with ViewStyle vsIcon,vsSmallIcon. issue #23187
This commit is contained in:
parent
f6c415d958
commit
f9e932cb46
@ -739,6 +739,7 @@ begin
|
|||||||
QtListWidget.setWrapping(IconOptions.AutoArrange);
|
QtListWidget.setWrapping(IconOptions.AutoArrange);
|
||||||
QtListWidget.setViewFlow(IconArngToQListFlow[IconOptions.Arrangement]);
|
QtListWidget.setViewFlow(IconArngToQListFlow[IconOptions.Arrangement]);
|
||||||
QtListWidget.setWordWrap(IconOptions.WrapText);
|
QtListWidget.setWordWrap(IconOptions.WrapText);
|
||||||
|
QtListWidget.setUniformItemSizes(IconOptions.WrapText);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end else
|
end else
|
||||||
@ -841,7 +842,7 @@ begin
|
|||||||
Exit(-1);
|
Exit(-1);
|
||||||
|
|
||||||
// TODO: columns in vsIcon mode
|
// TODO: columns in vsIcon mode
|
||||||
if IsIconView(ALV) then
|
if IsIconView(ALV) or (csDestroyingHandle in ALV.ControlState) then
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
||||||
QtTreeWidget := TQtTreeWidget(ALV.Handle);
|
QtTreeWidget := TQtTreeWidget(ALV.Handle);
|
||||||
|
|||||||
@ -737,6 +737,7 @@ begin
|
|||||||
QtListWidget.setWrapping(IconOptions.AutoArrange);
|
QtListWidget.setWrapping(IconOptions.AutoArrange);
|
||||||
QtListWidget.setViewFlow(IconArngToQListFlow[IconOptions.Arrangement]);
|
QtListWidget.setViewFlow(IconArngToQListFlow[IconOptions.Arrangement]);
|
||||||
QtListWidget.setWordWrap(IconOptions.WrapText);
|
QtListWidget.setWordWrap(IconOptions.WrapText);
|
||||||
|
QtListWidget.setUniformItemSizes(IconOptions.WrapText);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
end else
|
end else
|
||||||
@ -839,7 +840,7 @@ begin
|
|||||||
Exit(-1);
|
Exit(-1);
|
||||||
|
|
||||||
// TODO: columns in vsIcon mode
|
// TODO: columns in vsIcon mode
|
||||||
if IsIconView(ALV) then
|
if IsIconView(ALV) or (csDestroyingHandle in ALV.ControlState) then
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
||||||
QtTreeWidget := TQtTreeWidget(ALV.Handle);
|
QtTreeWidget := TQtTreeWidget(ALV.Handle);
|
||||||
@ -849,7 +850,6 @@ begin
|
|||||||
unfortunatelly it''s hardcoded in listcolumn.inc.}
|
unfortunatelly it''s hardcoded in listcolumn.inc.}
|
||||||
if (csDesigning in ALV.ComponentState) and (QtTreeWidget.ColCount <> ALV.ColumnCount) then
|
if (csDesigning in ALV.ComponentState) and (QtTreeWidget.ColCount <> ALV.ColumnCount) then
|
||||||
exit(50);
|
exit(50);
|
||||||
|
|
||||||
Result := QtTreeWidget.ColWidth[AIndex];
|
Result := QtTreeWidget.ColWidth[AIndex];
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user