mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 20:39:23 +02:00
LCL: grids: fix use theme sort arrows if themed arrows are not available
git-svn-id: trunk@57753 -
This commit is contained in:
parent
7d5aaf4f75
commit
5646ae5bec
@ -852,7 +852,7 @@ type
|
|||||||
function GetBorderWidth: Integer;
|
function GetBorderWidth: Integer;
|
||||||
procedure GetTitleImageInfo(aColumnIndex:Integer; out ImgIndex: Integer; out ImgLayout: TButtonLayout);
|
procedure GetTitleImageInfo(aColumnIndex:Integer; out ImgIndex: Integer; out ImgLayout: TButtonLayout);
|
||||||
procedure GetSortTitleImageInfo(aColumnIndex:Integer; out ImgList: TCustomImageList;
|
procedure GetSortTitleImageInfo(aColumnIndex:Integer; out ImgList: TCustomImageList;
|
||||||
out ImgIndex, ImgListWidth: Integer);
|
out ImgIndex, ImgListWidth: Integer; out NativeSortGlyphs: Boolean);
|
||||||
function GetRowCount: Integer;
|
function GetRowCount: Integer;
|
||||||
function GetRowHeights(Arow: Integer): Integer;
|
function GetRowHeights(Arow: Integer): Integer;
|
||||||
function GetSelectedRange(AIndex: Integer): TGridRect;
|
function GetSelectedRange(AIndex: Integer): TGridRect;
|
||||||
@ -4131,11 +4131,12 @@ var
|
|||||||
ImgRes: TScaledImageListResolution;
|
ImgRes: TScaledImageListResolution;
|
||||||
s: TSize;
|
s: TSize;
|
||||||
Details: TThemedElementDetails;
|
Details: TThemedElementDetails;
|
||||||
|
NativeSortGlyphs: Boolean;
|
||||||
begin
|
begin
|
||||||
if FSortColumn = AColumnIndex then
|
if FSortColumn = AColumnIndex then
|
||||||
begin
|
begin
|
||||||
GetSortTitleImageInfo(AColumnIndex, ImgList, ImgIndex, ImgListWidth);
|
GetSortTitleImageInfo(AColumnIndex, ImgList, ImgIndex, ImgListWidth, NativeSortGlyphs);
|
||||||
if (ImgList=nil) or (ImgIndex<0) then // draw native sort buttons
|
if NativeSortGlyphs then// draw native sort buttons
|
||||||
begin
|
begin
|
||||||
case FSortOrder of
|
case FSortOrder of
|
||||||
soAscending: Details := ThemeServices.GetElementDetails(thHeaderSortArrowSortedUp);
|
soAscending: Details := ThemeServices.GetElementDetails(thHeaderSortArrowSortedUp);
|
||||||
@ -5398,10 +5399,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TCustomGrid.GetSortTitleImageInfo(aColumnIndex: Integer; out
|
procedure TCustomGrid.GetSortTitleImageInfo(aColumnIndex: Integer; out
|
||||||
ImgList: TCustomImageList; out ImgIndex, ImgListWidth: Integer);
|
ImgList: TCustomImageList; out ImgIndex, ImgListWidth: Integer; out
|
||||||
|
NativeSortGlyphs: Boolean);
|
||||||
var
|
var
|
||||||
ResName: string;
|
ResName: string;
|
||||||
begin
|
begin
|
||||||
|
NativeSortGlyphs := False;
|
||||||
ImgIndex := -1;
|
ImgIndex := -1;
|
||||||
ImgList := nil;
|
ImgList := nil;
|
||||||
ImgListWidth := 0;
|
ImgListWidth := 0;
|
||||||
@ -5421,7 +5424,6 @@ begin
|
|||||||
ImgListWidth := FTitleImageListWidth;
|
ImgListWidth := FTitleImageListWidth;
|
||||||
ImgIndex := FDescImgInd;
|
ImgIndex := FDescImgInd;
|
||||||
end else
|
end else
|
||||||
if (TitleStyle<>tsNative) then// draw native sort buttons
|
|
||||||
begin
|
begin
|
||||||
ImgList := LCLBtnGlyphs;
|
ImgList := LCLBtnGlyphs;
|
||||||
case FSortOrder of
|
case FSortOrder of
|
||||||
@ -5429,6 +5431,7 @@ begin
|
|||||||
soDescending: ResName := 'sortdesc';
|
soDescending: ResName := 'sortdesc';
|
||||||
end;
|
end;
|
||||||
ImgIndex := LCLBtnGlyphs.GetImageIndex(ResName);
|
ImgIndex := LCLBtnGlyphs.GetImageIndex(ResName);
|
||||||
|
NativeSortGlyphs := FTitleStyle = tsNative;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -11007,7 +11010,7 @@ var
|
|||||||
TmpCanvas: TCanvas;
|
TmpCanvas: TCanvas;
|
||||||
C: TGridColumn;
|
C: TGridColumn;
|
||||||
aRect: TRect;
|
aRect: TRect;
|
||||||
isMultiLine: Boolean;
|
isMultiLine, B: Boolean;
|
||||||
aText: string;
|
aText: string;
|
||||||
aLayout: TButtonLayout;
|
aLayout: TButtonLayout;
|
||||||
imgList: TCustomImageList;
|
imgList: TCustomImageList;
|
||||||
@ -11020,7 +11023,7 @@ begin
|
|||||||
imgWidth := FTitleImageList.WidthForPPI[FTitleImageListWidth, Font.PixelsPerInch] + 2*DEFIMAGEPADDING
|
imgWidth := FTitleImageList.WidthForPPI[FTitleImageListWidth, Font.PixelsPerInch] + 2*DEFIMAGEPADDING
|
||||||
else
|
else
|
||||||
imgWidth := 0;
|
imgWidth := 0;
|
||||||
GetSortTitleImageInfo(aCol, imgList, i, W);
|
GetSortTitleImageInfo(aCol, imgList, i, W, B);
|
||||||
if (imgList<>nil) and (i>=0) then
|
if (imgList<>nil) and (i>=0) then
|
||||||
Inc(imgWidth, imgList.WidthForPPI[W, Font.PixelsPerInch] + DEFIMAGEPADDING);
|
Inc(imgWidth, imgList.WidthForPPI[W, Font.PixelsPerInch] + DEFIMAGEPADDING);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user