Changeset 717 for branches/zoom/Packages/CevoComponents
- Timestamp:
- Jan 10, 2026, 12:15:35 PM (4 weeks ago)
- Location:
- branches/zoom
- Files:
-
- 4 edited
-
. (modified) (1 prop)
-
Packages/CevoComponents/Directories.pas (modified) (4 diffs)
-
Packages/CevoComponents/ScreenTools.pas (modified) (9 diffs)
-
Packages/CevoComponents/Texture.pas (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/zoom
-
branches/zoom/Packages/CevoComponents/Directories.pas
r664 r717 22 22 23 23 uses 24 FileUtil, LCLIntf, LCLType, LCLProc, LazUTF8, SysUtils, LazFileUtils, Forms; 24 FileUtil, LCLIntf, LCLType, LCLProc, LazUTF8, SysUtils, LazFileUtils, Forms, 25 Translations; 25 26 26 27 function GetAppSharePath(Path: string): string; … … 33 34 {$IFDEF UNIX} 34 35 // If installed in Linux system then try to use different installation directory 36 NewPath := ExtractFileDir(Application.ExeName) + DirectorySeparator + '..' + 37 DirectorySeparator + 'share' + DirectorySeparator + 38 ExtractFileNameOnly(Application.ExeName) + DirectorySeparator + Path; 39 35 40 if not DirectoryExists(Result) then begin 36 NewPath := ExtractFileDir(Application.ExeName) + DirectorySeparator + '..' +37 DirectorySeparator + 'share' + DirectorySeparator +38 ExtractFileNameOnly(Application.ExeName) + DirectorySeparator + Path;39 41 if DirectoryExists(NewPath) then begin 40 42 Result := NewPath; … … 42 44 end; 43 45 end; 46 44 47 if not FileExists(Result) then begin 45 NewPath := ExtractFileDir(Application.ExeName) + DirectorySeparator + '..' +46 DirectorySeparator + 'share' + DirectorySeparator +47 ExtractFileNameOnly(Application.ExeName) + DirectorySeparator + Path;48 48 if FileExists(NewPath) then begin 49 49 Result := NewPath; … … 56 56 function GetLocale: string; 57 57 var 58 Lang: string;59 58 I: Integer; 60 T: string;59 LanguageID: TLanguageID; 61 60 begin 62 61 // Win32 user may decide to override locale with LANG variable. 63 Lang:= Copy(GetEnvironmentVariableUTF8('LANG'), 1, 2);62 Result := Copy(GetEnvironmentVariableUTF8('LANG'), 1, 2); 64 63 65 if Lang= '' then begin66 for I := 1 to Param count - 1 do64 if Result = '' then begin 65 for I := 1 to ParamCount - 1 do 67 66 if (ParamStrUTF8(I) = '--LANG') or (ParamStrUTF8(I) = '-l') or 68 67 (ParamStrUTF8(I) = '--lang') then 69 Lang:= ParamStrUTF8(I + 1);68 Result := ParamStrUTF8(I + 1); 70 69 end; 71 if Lang = '' then begin 72 T := ''; 73 LazGetLanguageIDs(Lang, T); 74 Lang := Copy(Lang, 1, 2); 70 if Result = '' then begin 71 LanguageID := GetLanguageID; 72 Result := Copy(LanguageID.LanguageID, 1, 2); 75 73 end; 76 77 Result := Lang;78 74 end; 79 75 -
branches/zoom/Packages/CevoComponents/ScreenTools.pas
r684 r717 116 116 117 117 const 118 BmpExt = '.bmp'; 119 PngExt = '.png'; 120 JpgExt = '.jpg'; 121 118 122 TransparentColor1 = $FF00FF; 119 123 TransparentColor2 = $7F007F; … … 434 438 Result := False; 435 439 if ExtractFileExt(FileName) = '' then 436 FileName := FileName + '.png';440 FileName := FileName + PngExt; 437 441 438 442 if FileExists(FileName) then begin 439 if ExtractFileExt(FileName) = '.jpg'then begin443 if ExtractFileExt(FileName) = JpgExt then begin 440 444 Jpeg := TJpegImage.Create; 441 445 try … … 451 455 FreeAndNil(Jpeg); 452 456 end else 453 if ExtractFileExt(FileName) = '.png'then begin457 if ExtractFileExt(FileName) = PngExt then begin 454 458 Png := TPortableNetworkGraphic.Create; 455 459 try … … 473 477 FreeAndNil(Png); 474 478 end else 475 if ExtractFileExt(FileName) = '.bmp'then begin479 if ExtractFileExt(FileName) = BmpExt then begin 476 480 try 477 481 Bmp.LoadFromFile(FileName); … … 1799 1803 1800 1804 procedure Gtk2DisableControlStyling(WinControl: TWinControl); 1801 begin 1805 {$IFDEF LCLGTK2} 1806 var 1807 GtkWhite: string; 1808 GtkBlue: string; 1809 GtkBlack: string; 1810 GtkOrange: string; 1811 {$ENDIF} 1812 begin 1813 {$IFDEF LCLGTK2} 1802 1814 // https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/38516 1803 {$IFDEF LCLGTK2} 1815 GtkBlue := '{ 0.373, 0.467, 0.796 }'; 1816 GtkWhite := '{ 1.0, 1.0, 1.0 }'; 1817 GtkBlack := '{ 0, 0, 0 }'; 1818 GtkOrange := '{ 0.373, 0.465, 0.793 }'; 1819 1804 1820 // parse gtkrc from string 1805 1821 gtk_rc_parse_string(PChar('style "noengine" {' + LineEnding + 1806 'engine "" {}' + LineEnding + 1822 'engine "" { }' + LineEnding + 1823 1824 'base[INSENSITIVE] = ' + GtkBlack + LineEnding + 1825 'base[PRELIGHT] = ' + GtkBlack + LineEnding + 1826 'base[NORMAL] = ' + GtkBlack + LineEnding + 1827 'base[SELECTED] = ' + GtkBlue + LineEnding + 1828 'base[ACTIVE] = ' + GtkBlack + LineEnding + 1829 1830 'text[INSENSITIVE] = ' + GtkOrange + LineEnding + 1831 'text[NORMAL] = ' + GtkOrange + LineEnding + 1832 'text[PRELIGHT] = ' + GtkOrange + LineEnding + 1833 'text[SELECTED] = ' + GtkWhite + LineEnding + 1834 'text[ACTIVE] = ' + GtkOrange + LineEnding + 1835 1807 1836 '}' + LineEnding + 1808 1837 'widget "*.your-edit" style "noengine"')); … … 1857 1886 LoadPhrases; 1858 1887 LoadFonts; 1859 Templates := LoadGraphicSet('Templates .png', False);1888 Templates := LoadGraphicSet('Templates' + PngExt, False); 1860 1889 with Templates do begin 1861 1890 Logo := GetItem('Logo'); … … 1873 1902 end; 1874 1903 1875 LoadGraphicFile(Colors, GetGraphicsDir + DirectorySeparator + 'Colors .png');1876 LoadGraphicFile(Paper, GetGraphicsDir + DirectorySeparator + 'Paper .jpg');1877 LoadGraphicFile(BigImp, GetGraphicsDir + DirectorySeparator + 'Icons .png');1904 LoadGraphicFile(Colors, GetGraphicsDir + DirectorySeparator + 'Colors' + PngExt); 1905 LoadGraphicFile(Paper, GetGraphicsDir + DirectorySeparator + 'Paper' + JpgExt); 1906 LoadGraphicFile(BigImp, GetGraphicsDir + DirectorySeparator + 'Icons' + PngExt); 1878 1907 end; 1879 1908 … … 1898 1927 GrExt := TGraphicSets.Create; 1899 1928 1900 HGrSystem := LoadGraphicSet('System .png');1929 HGrSystem := LoadGraphicSet('System' + PngExt); 1901 1930 with HGrSystem do begin 1902 1931 CityMark1 := GetItem('CityMark1'); … … 1904 1933 end; 1905 1934 1906 HGrSystem2 := LoadGraphicSet('System2 .png');1935 HGrSystem2 := LoadGraphicSet('System2' + PngExt); 1907 1936 with HGrSystem2 do begin 1908 1937 Ornament := GetItem('Ornament'); -
branches/zoom/Packages/CevoComponents/Texture.pas
r471 r717 47 47 FAge := AValue; 48 48 LoadGraphicFile(Image, GetGraphicsDir + DirectorySeparator + 49 'Texture' + IntToStr(Age + 1) + '.jpg');49 'Texture' + IntToStr(Age + 1) + JpgExt); 50 50 ColorBevelLight := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelLight]; 51 51 ColorBevelShade := Colors.Canvas.Pixels[clkAge0 + Age, cliBevelShade];
Note:
See TracChangeset
for help on using the changeset viewer.
