Ignore:
Timestamp:
Apr 24, 2021, 11:41:07 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Merged changes from trunk r377.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/highdpi/Packages/CevoComponents/ScreenTools.pas

    r361 r378  
    5454procedure EditFrame(ca: TDpiCanvas; p: TRect; T: TTexture);
    5555function HexStringToColor(S: string): integer;
     56function ExtractFileNameWithoutExt(const Filename: string): string;
    5657function LoadGraphicFile(Bmp: TDpiBitmap; FileName: string; Options: TLoadGraphicFileOptions = []): boolean;
    5758function LoadGraphicSet(const Name: string): TGraphicSet;
     
    124125procedure DarkenImage(Bitmap: TDpiBitmap; Change: Integer);
    125126procedure UnshareBitmap(Bitmap: TDpiBitmap);
     127procedure Gtk2Fix;
    126128
    127129const
     
    488490  if (not (gfNoGamma in Options)) and (Gamma <> 100) then
    489491    ApplyGammaToBitmap(Bmp);
     492end;
     493
     494function ExtractFileNameWithoutExt(const Filename: string): string;
     495var
     496  P: Integer;
     497begin
     498  Result := Filename;
     499  P := Length(Result);
     500  while P > 0 do begin
     501    case Result[P] of
     502      PathDelim: Exit;
     503      {$ifdef windows}
     504      '/': if ('/' in AllowDirectorySeparators) then Exit;
     505      {$endif}
     506      '.': Exit(Copy(Result, 1, P - 1));
     507    end;
     508    Dec(P);
     509  end;
    490510end;
    491511
     
    16511671end;
    16521672
     1673procedure Gtk2Fix;
     1674var
     1675  I: Integer;
     1676begin
     1677  {$IFDEF LINUX}
     1678  // Wait and process messages little bit to avoid crash or force repaint under Gtk2
     1679  for I := 0 to 10 do begin
     1680    Sleep(1);
     1681    DpiApplication.ProcessMessages;
     1682  end;
     1683  {$ENDIF}
     1684end;
     1685
    16531686procedure LoadFonts;
    16541687var
Note: See TracChangeset for help on using the changeset viewer.