~ubuntu-branches/ubuntu/vivid/lazarus/vivid-proposed

« back to all changes in this revision

Viewing changes to lcl/interfaces/qt/qtthemes.pas

  • Committer: Package Import Robot
  • Author(s): Abou Al Montacir
  • Date: 2014-05-15 23:17:51 UTC
  • mfrom: (1.1.13)
  • Revision ID: package-import@ubuntu.com-20140515231751-gumj9a01g0ghm7ac
Tags: 1.2.2+dfsg-1
* New upstream release with few fixes and official support of FPC 2.6.4.
  - The detailed list of changes can be found here:
  http://wiki.lazarus.freepascal.org/Lazarus_1.2_fixes_branch#Fixes_for_1.2.2_.28Merged.29

Show diffs side-by-side

added added

removed removed

Lines of Context:
422
422
  AQColor, AOldColor: TQColor;
423
423
  B: Boolean;
424
424
  OldCanvasFontColor: TColor;
 
425
  APalette: QPaletteH;
425
426
begin
426
427
  B := False;
427
428
 
431
432
    B := True;
432
433
    AOldColor := TQtDeviceContext(TCanvas(ACanvas).Handle).pen.getColor;
433
434
    OldCanvasFontColor := TCanvas(ACanvas).Font.Color;
434
 
    if TCanvas(ACanvas).Font.Color = clDefault then
435
 
      TCanvas(ACanvas).Font.Color := clBtnText;
436
 
    ColorRefToTQColor(ColorToRGB(TCanvas(ACanvas).Font.Color), AQColor);
437
 
    TQtDeviceContext(TCanvas(ACanvas).Handle).pen.setColor(AQColor);
 
435
 
 
436
    // issue #25922
 
437
    if IsDisabled(Details) then
 
438
    begin
 
439
      APalette := QPalette_create;
 
440
      try
 
441
        QApplication_palette(APalette,'QPushButton');
 
442
        AQColor := QPalette_color(APalette, QPaletteDisabled, QPaletteButtonText)^;
 
443
        TQtDeviceContext(TCanvas(ACanvas).Handle).pen.setColor(AQColor);
 
444
      finally
 
445
        QPalette_destroy(APalette);
 
446
      end;
 
447
    end else
 
448
    begin
 
449
      if TCanvas(ACanvas).Font.Color = clDefault then
 
450
        TCanvas(ACanvas).Font.Color := clBtnText;
 
451
      ColorRefToTQColor(ColorToRGB(TCanvas(ACanvas).Font.Color), AQColor);
 
452
      TQtDeviceContext(TCanvas(ACanvas).Handle).pen.setColor(AQColor);
 
453
    end;
438
454
  end;
439
455
 
440
456
  DrawText(TCanvas(ACanvas).Handle, Details, S, R, Flags, Flags2);