Skip to content

CommandLink buttons on TTaskDialog do not scale correctly if per-monitor-v2 is enabled #319

Description

@jdorlon-Quest

Hello,

I am using Delphi 12.2, with per-monitor-v2 enabled. My app is running on a display scaled to 200% (there is no problem on 100% scaled displays)

Using this code:

  with TTaskDialog.Create(self) do
  try
    Title := 'test';
    Caption := 'test test';
    Text := 'Are you sure you want to click a button?';
    CommonButtons := [];
    with TTaskDialogButtonItem(Buttons.Add) do
    begin
      Caption := 'Button 1';
      CommandLinkHint := 'This is the first button.';
      ModalResult := mrYes;
    end;
    with TTaskDialogButtonItem(Buttons.Add) do
    begin
      Caption := 'Button 2';
      CommandLinkHint := 'This is the second button.';
      ModalResult := mrNo;
    end;
    Flags := [tfUseCommandLinks];
    Execute;
  finally
    Free;
  end

The dialog is shown like this:
Image

The problem code is in unit Vcl.Styles.UxTheme.

There are several lines like:

plf.lfHeight := 13;

If I can determine which display the task dialog is being displayed on, I can MulDiv the lfHeight to the correct value, but so far I haven't been able to determine which display I'm on.

Thank you.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions