Results 1 to 5 of 5

Thread: Customizing CL_TabHeader

  1. #1
    Lesser Knight
    Join Date
    Sep 2006
    Location
    Barcelona, Catalonia
    Posts
    30

    Default Customizing CL_TabHeader

    Hi, I'm using CL_Tab with a customized theme, and I'm having troubles due to the fact that I can get the CL_TabHeader in order to change its class name according to the names I'm using in my css. For instance:

    Code:
    tabheader page:hot
    {
    	bg-image:Console/Buttons/Tab;
    	preferred-width:137;
    	preferred-height:25;
    }
    It works, but if I have two different tab I'm not allowed to customize the different headers:


    Code:
    tabheader.tab1 page:hot
    {
    	bg-image:Console/Buttons/Tab;
    	preferred-width:137;
    	preferred-height:25;
    }
    tabheader.tab2 page:hot
    {
    	bg-image:Console/Buttons/Tab2;
    	preferred-width:50;
    	preferred-height:50;
    }
    It doesnt work, as all of them will share the same bg-image and preferred size.

    Is there any problem to create a getter for CL_TabHeader inside CL_Tab that lets people customize its look and feel? If you agree I can make the patch and send it to you.

    Cheers,

    Xavi

  2. #2
    ClanLib Developer
    Join Date
    Sep 2006
    Location
    Denmark
    Posts
    554

    Default

    tab.tab1 tabheader page:hot
    {
    ..
    }

    This rule should only match the CL_Tab with the class name tab1.

  3. #3
    Lesser Knight
    Join Date
    Sep 2006
    Location
    Barcelona, Catalonia
    Posts
    30

    Default

    Hi Magnus, thanks for the tip but it is not working...if I put "tab" before tabheader it works nice, but once I write the name of the class "tab.foo" it doesn't use the parameters specified in the .css, like:
    Code:
    tab.foo tabheader page:normal
    {
    	bg-image:Buttons/Tab;
    	preferred-width:50;
    	preferred-height:25;
    }
    Xavi

  4. #4

    Default

    I committed a small fix that I didn't test as I lack a test app, but I think the problem might be that when you do tab.set_class_name("foo") it doesn't invalidate the various caches in GUI, and thus doesn't reload the graphics for CL_TabHeader. Either that or then the CSS selector is buggy.

    What I suspect happens is that when you call tab.set_class_name("foo") the css name for CL_Tab becomes:

    Code:
    tab.foo tabheader ...
    But the cached CL_TabHeader css name isn't updated and stays:
    Code:
    tab tabheader ...

    Quote Originally Posted by xrubio View Post
    Is there any problem to create a getter for CL_TabHeader inside CL_Tab that lets people customize its look and feel?
    Xavi
    It might be that this bug affects a lot more than just CL_TabHeader.

    If the caches of child components need to be cleared when set_class_name, set_id_name or set_type_name are called on a parent, then this needs to be fixed in CL_GUIComponent.

    If it's now fixed for CL_TabHeader in SVN, then I suppose that is the case.

  5. #5
    Lesser Knight
    Join Date
    Sep 2006
    Location
    Barcelona, Catalonia
    Posts
    30

    Default

    Hi Harry, I think that you are right, because now it is working for "tab.foo tabheader page:hot", etc...although "tab.foo tabheader" still doesn't work.

    If you want I can make a little test app to check this problem.

    Xavi

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •