Ignore:
Timestamp:
May 13, 2024, 7:00:49 PM (7 months ago)
Author:
chronos
Message:
  • Fixed: Workaround for incorrectly styling TEdit controls under Gtk2.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/CevoComponents/ScreenTools.pas

    r565 r570  
    109109procedure UnshareBitmap(Bitmap: TBitmap);
    110110procedure Gtk2Fix;
     111procedure Gtk2DisableControlStyling(WinControl: TWinControl);
    111112procedure LoadConfig(Key: string);
    112113procedure SaveConfig(Key: string);
     
    214215uses
    215216  {$IFDEF DPI}Dpi.PixelPointer,{$ELSE}PixelPointer,{$ENDIF}
    216   Directories, Sound, Registry;
     217  Directories, Sound, Registry
     218  {$IFDEF LCLGTK2}, gtk2, WSProc{$ENDIF};
    217219
    218220var
     
    17701772end;
    17711773
     1774procedure Gtk2DisableControlStyling(WinControl: TWinControl);
     1775begin
     1776  // https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/38516
     1777  {$IFDEF LCLGTK2}
     1778  // parse gtkrc from string
     1779  gtk_rc_parse_string(PChar('style "noengine" {' + LineEnding +
     1780    'engine "" {}' + LineEnding +
     1781    '}' + LineEnding +
     1782    'widget "*.your-edit" style "noengine"'));
     1783
     1784  if WinControl.HandleAllocated then begin
     1785    // set gtk name to our component
     1786    gtk_widget_set_name({%H-}PGtkWidget(WinControl.Handle), 'your-edit');
     1787  end;
     1788  {$ENDIF}
     1789end;
     1790
    17721791procedure LoadConfig(Key: string);
    17731792var
Note: See TracChangeset for help on using the changeset viewer.