Jump to content

Remove Grey Area Around Disabled UniImage


mos

Recommended Posts

In the screenshot below there are two TUniImages the one on the left has Enabled set to True while the one on the right has Enabled set to False.

When the image is disabled a grey area appears surrounding the image as the image does not fully occupy the whole area of the TUniImage.

Is it possible to remove this grey area so that the white background appears but still show the green tick as disabled (it will look like the image on the left but only the green tick will show as disabled).

image.png.4732c93ae3da6be7187b190fcc2b7d2f.png

 

Link to comment
Share on other sites

5 hours ago, mos said:

In the screenshot below there are two TUniImages the one on the left has Enabled set to True while the one on the right has Enabled set to False.

When the image is disabled a grey area appears surrounding the image as the image does not fully occupy the whole area of the TUniImage.

Is it possible to remove this grey area so that the white background appears but still show the green tick as disabled (it will look like the image on the left but only the green tick will show as disabled).

Hello,

One possible solution is to use a CSS rule I think.

procedure TMainForm.UniButton1Click(Sender: TObject);
begin
  UniImage1.JSInterface.JSCall('setStyle', ['opacity', 0.5]); // instead of Enabled=False
  UniImage1.JSInterface.JSCall('setStyle', ['opacity', 1]);   // instead of Enabled=True
end;

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...