mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-04 19:40:20 +02:00
Qt5: fixed infinite loop in QtThemes.GetDetailSize
This commit is contained in:
parent
3d0419bb74
commit
8d29480359
@ -916,6 +916,12 @@ begin
|
||||
end;
|
||||
|
||||
function TQtThemeServices.GetDetailSize(Details: TThemedElementDetails): TSize;
|
||||
begin
|
||||
Result := inherited;
|
||||
end;
|
||||
|
||||
function TQtThemeServices.GetDetailSizeForPPI(Details: TThemedElementDetails;
|
||||
PPI: Integer): TSize;
|
||||
begin
|
||||
case Details.Element of
|
||||
teButton:
|
||||
@ -924,11 +930,19 @@ begin
|
||||
begin
|
||||
Result.cy := QStyle_pixelMetric(Style, QStylePM_IndicatorHeight, nil, nil);
|
||||
Result.cx := QStyle_pixelMetric(Style, QStylePM_IndicatorWidth, nil, nil);
|
||||
if (Result.cx>0) then
|
||||
Result.cx := MulDiv(Result.cx, PPI, 96);
|
||||
if (Result.cy>0) then
|
||||
Result.cy := MulDiv(Result.cy, PPI, 96);
|
||||
end else
|
||||
if Details.Part = BP_RADIOBUTTON then
|
||||
begin
|
||||
Result.cy := QStyle_pixelMetric(Style, QStylePM_ExclusiveIndicatorHeight, nil, nil);
|
||||
Result.cx := QStyle_pixelMetric(Style, QStylePM_ExclusiveIndicatorWidth, nil, nil);
|
||||
if (Result.cx>0) then
|
||||
Result.cx := MulDiv(Result.cx, PPI, 96);
|
||||
if (Result.cy>0) then
|
||||
Result.cy := MulDiv(Result.cy, PPI, 96);
|
||||
end else
|
||||
Result := inherited;
|
||||
end;
|
||||
@ -951,28 +965,15 @@ begin
|
||||
begin
|
||||
Result.cy := -1;
|
||||
Result.cx := QStyle_pixelMetric(Style, QStylePM_MenuButtonIndicator, nil, nil);
|
||||
if (Result.cx>0) then
|
||||
Result.cx := MulDiv(Result.cx, PPI, 96);
|
||||
end else
|
||||
Result := inherited;
|
||||
teHeader:
|
||||
if Details.Part = HP_HEADERSORTARROW then
|
||||
Result := Size(-1, -1) // not yet supported
|
||||
else
|
||||
Result := inherited;
|
||||
else
|
||||
Result := inherited;
|
||||
end;
|
||||
end;
|
||||
|
||||
function TQtThemeServices.GetDetailSizeForPPI(Details: TThemedElementDetails;
|
||||
PPI: Integer): TSize;
|
||||
begin
|
||||
Result := GetDetailSize(Details);
|
||||
if (Result.cx>0) then
|
||||
Result.cx := MulDiv(Result.cx, PPI, 96);
|
||||
if (Result.cy>0) then
|
||||
Result.cy := MulDiv(Result.cy, PPI, 96);
|
||||
end;
|
||||
|
||||
function TQtThemeServices.GetStockImage(StockID: LongInt; out Image,
|
||||
Mask: HBitmap): Boolean;
|
||||
var
|
||||
|
Loading…
Reference in New Issue
Block a user