Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When NCButton is disabled, moving mouse effects have to be desactivated #279

Open
Delphichem opened this issue Sep 11, 2020 · 0 comments
Open

Comments

@Delphichem
Copy link

When the control is disabled and mouse hover it, the control is draw like it is enabled.
in TNCButton.DrawControl
.
.
if FStyle = nsAlpha then
.
Change
if (AMouseInControl) and (FAlphaHotColor <> clNone) then
With
if (AMouseInControl) and (FAlphaHotColor <> clNone) and Enabled then

In
else if FStyle = nsGradient then
.
Change

     if AMouseInControl then
        GradientFillCanvas(ACanvas, FEndColor, FStartColor, DrawRect, FDirection)
      else
        GradientFillCanvas(ACanvas, FStartColor, FEndColor, DrawRect, FDirection);

      if AMouseInControl then
        ACanvas.Pen.Color := FEndColor
      else
        ACanvas.Pen.Color := FStartColor;

With

     if AMouseInControl and Enabled then 
        GradientFillCanvas(ACanvas, FEndColor, FStartColor, DrawRect, FDirection)
      else
        GradientFillCanvas(ACanvas, FStartColor, FEndColor, DrawRect, FDirection);

      if AMouseInControl and Enabled then
        ACanvas.Pen.Color := FEndColor
      else
        ACanvas.Pen.Color := FStartColor;

In
if (FStyle in [nsSplitButton, nsSplitTrans]) then
.
Change

    if AMouseInControl then
      ThemeTextColor := FHotFontColor
    else
      ThemeTextColor := FFontColor;

With

    if not Enabled then
      ThemeTextColor := clGrayText
    else if AMouseInControl then
      ThemeTextColor := FHotFontColor
    else
      ThemeTextColor := FFontColor;

Change

    if FUseFontAwesome and (FImageIndex >= 0) then
    begin
      if AMouseInControl then
        ThemeTextColor := FAwesomeHotFontColor

With

    if FUseFontAwesome and (FImageIndex >= 0) then
    begin
      if AMouseInControl and Enabled then
        ThemeTextColor := FAwesomeHotFontColor

Change

      // draw arrow

      if (FStyle = nsSplitTrans) and (not AMouseInControl) then
        Pen.Color := FFontColor
      else
        Pen.Color := FHotFontColor;

With

      // draw arrow

      if FStyle = nsSplitTrans then
      begin
        if (not AMouseInControl) or (not Enabled) then
          Pen.Color := FFontColor
        else
          Pen.Color := FHotFontColor;
      end;

Change

  end
  else
  begin
    if AMouseInControl then
      ThemeTextColor := FHotFontColor
    else
      ThemeTextColor := FFontColor;

    // ButtonRect := DrawRect;
    // if not StyleServices.HasElementFixedPosition(Details) then
    // CorrectLeftButtonRect(ButtonRect);
    // DrawRect := ButtonRect;

    if (FCaptionAligmentFlags and DT_CENTER) <> DT_CENTER then
      DrawRect.Left := DrawRect.Left + 5;

    DrawControlText(ACanvas, Details, BCaption, DrawRect, FCaptionAligmentFlags, ThemeTextColor);

    if FUseFontAwesome and (FImageIndex >= 0) then
    begin
      if AMouseInControl then
        ThemeTextColor := FAwesomeHotFontColor

With

  end
  else
  begin
    if not Enabled then
      ThemeTextColor := clGrayText
    else if AMouseInControl then
      ThemeTextColor := FHotFontColor
    else
      ThemeTextColor := FFontColor;


    // ButtonRect := DrawRect;
    // if not StyleServices.HasElementFixedPosition(Details) then
    // CorrectLeftButtonRect(ButtonRect);
    // DrawRect := ButtonRect;

    if (FCaptionAligmentFlags and DT_CENTER) <> DT_CENTER then
      DrawRect.Left := DrawRect.Left + 5;

    DrawControlText(ACanvas, Details, BCaption, DrawRect, FCaptionAligmentFlags,
      ThemeTextColor);

    if FUseFontAwesome and (FImageIndex >= 0) then
    begin
      if AMouseInControl and Enabled then 
        ThemeTextColor := FAwesomeHotFontColor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant