×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Registered User
    Join Date
    Sep 2008
    Location
    Vancouver, Canada
    Posts
    588

    how to change the listbox item text color on change of theme?

    Hi,

    I have a listbox containing few items. By default i have made the text color as white and highlighted text color as black with the following lines of code:

    Code:
    	iListBox->View()->ItemDrawer()->SetTextColor(KRgbWhite);
    	iListBox->ItemDrawer()->SetHighlightedTextColor(KRgbBlack);
    Everything else is fine except that when i change the theme to "Dark" in E71 in particular, the item text does not appear. It appear as a whole black box because
    the text color is black. I cannot even make it white or other color because i might face the same problem if there is again the same colored theme.

    One more thing. If i change the theme while the app is running, the item text color changes correctly as per theme but if a theme is already set and then i start the app,
    the theme does not apply to the text color. The listbox item appears as per the lines of code above.

    Is there any way to change the listbox item text color as per the theme?

    Thanks

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: how to change the listbox item text color on change of theme?

    Basically you should not change the colors, and instead simply use the default ones that comes from the theme.

    Anyway, if you are interested to get notification for theme change events, then have a look into the API plug-in APIs, at least 3rd ed packed used to have the API for this use case.

  3. #3
    Registered User
    Join Date
    Sep 2008
    Location
    Vancouver, Canada
    Posts
    588

    Re: how to change the listbox item text color on change of theme?

    Thanks Yucca,

    I would be interested in the first suggestion. Do you mean to say that i should comment out those two lines and system manager will take care of color changes on its own?

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: how to change the listbox item text color on change of theme?

    if you are using CAkn... listboxes, they should be using the theme colors automatically, thus you should not try setting any.

  5. #5
    Nokia Developer Champion
    Join Date
    Jun 2008
    Location
    Noida,India
    Posts
    4,025

    Re: how to change the listbox item text color on change of theme?

    Also BaseConstructL() of AppUi should have the parameter as : BaseConstructL(EAknEnableSkin); , if not already there.

Similar Threads

  1. Change background as well as foreground color of selected item in listbox
    By nishantanindya in forum Symbian User Interface
    Replies: 5
    Last Post: 2012-04-21, 11:54
  2. Can i change the text color of a listbox
    By nital_shah in forum Symbian
    Replies: 6
    Last Post: 2009-10-09, 08:33
  3. Can I change listbox item text?
    By aluzi in forum Symbian
    Replies: 6
    Last Post: 2008-03-25, 06:31
  4. how to change the color of the Highlight item in the listbox
    By RaveendraB in forum Symbian User Interface
    Replies: 8
    Last Post: 2008-02-28, 17:49
  5. Change color of listbox item
    By anoopd in forum Symbian User Interface
    Replies: 2
    Last Post: 2005-03-09, 08:33

Posting Permissions

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