Jump to content

UniTreeview (background) color (old issue #1016)


Recommended Posts

Posted

Hi,

 

How to set the (background) color of the Treeview.

Set the property 'Color' to my color it changes only at designtime

but on runtime it's white.

 

ParentColor is False

 

It seems an old issue (#1016)

Posted

Hi,

 

For now, I think, you can like this:

uses ... UniGUIJSUtils;
procedure TMainForm.UniFormCreate(Sender: TObject);
begin

  // your logical conditions...
  UniSession.SetStyle(
    '#' + UniTreeView1.JSName + '_id .x-tree-view{'+
    '  background-color: ' + uniColor2Web(UniTreeView1.Color) + ';'+
    '}'+
    '#' + UniTreeView1.JSName + '_id .x-tree-view .x-grid-cell-inner-treecolumn{'+
    '  background-color: ' + uniColor2Web(UniTreeView1.Color) + ';'+
    '}'
  );
 
end;

Try..

 

Best regards.

  • 2 weeks later...
Posted

Hi,

 

Yes, you are right, I think this will be fixed in the next versions.

 

For now, try:

UniSession.SetStyle(
    '#' + UniTreeView1.JSName + '_id .x-tree-view{'+
    '  background-color: ' + uniColor2Web(UniTreeView1.Color) + ';'+
    '}'+
    '#' + UniTreeView1.JSName + '_id .x-tree-view .x-grid-cell-inner-treecolumn{'+
    '  background-color: ' + uniColor2Web(UniTreeView1.Color) + ';'+
    '  color: ' + uniColor2Web(UniTreeView1.Font.Color) +';'+
    '  font: ' + UniTreeView1.Font.ToString(False, False, False, False) +';'+
    '}'
  );

Best regards.

  • 2 months later...
  • 3 weeks later...
  • 3 years later...
  • 2 weeks later...
Posted

I said than i used you written as below but it dosent work.

 

UniSession.SetStyle(
    '#' + UniTreeView1.JSName + '_id .x-tree-view{'+
    '  background-color: ' + uniColor2Web(UniTreeView1.Color) + ';'+
    '}'+
    '#' + UniTreeView1.JSName + '_id .x-tree-view .x-grid-cell-inner-treecolumn{'+
    '  background-color: ' + uniColor2Web(UniTreeView1.Color) + ';'+
    '  color: ' + uniColor2Web(UniTreeView1.Font.Color) +';'+
    '  font: ' + UniTreeView1.Font.ToString(False, False, False, False) +';'+
    '}'
  );
Posted
30 minutes ago, Kamyar said:

dont we have any way to dblclick for UniColorPalette?

I think it's possible. But why do you want to use this event?

Posted

because user maybe select one color in the palette and then want to changed that color and select another one and finally want to finished the selection but not with ok button because that button is far from mouse current location and it is so easy to use dblclick for confirmation selected color.

Posted
23 minutes ago, Kamyar said:

because user maybe select one color in the palette and then want to changed that color and select another one and finally want to finished the selection but not with ok button because that button is far from mouse current location and it is so easy to use dblclick for confirmation selected color.

We have added a new property:

property UseDblClick;

Please wait for the next build.

  • 1 year later...
Posted

Has this issue been resolved?

I am still not able to set background colour from IDE.

I have tried the fixes here in the latest release and i cannot seem to get the JS script to make any difference!

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...