The new ListItem has drag-and-drop capability built-in. By default, though, dragged items have a transparent background, which looks awful. (Why would this be the default?)

The ListItem has a color property that I can use to set the background color of the list item. But I've been unable to find a way to programmatically match the color used as the background of the ListView. Neither the UbuntuColors object nor the Theme object seem to have this color defined. Is there someway I can get this color and use it for the background of the ListItems? Or, is there a better way to attack this problem?

share|improve this question
up vote 0 down vote accepted

You can colorise your ListItems the way you like even while dragging. UbuntuColors and Theme.Palette has colors the toolkit is using, if you need others you should use custom values. The background of the ListView is transparent, so the ListItem, so you should look for the colors your item is using hosting your ListView. If that's the Page/MainView, you'll see theme.palette.normal.background palette color in use.

share|improve this answer
    
That doesn't seem to be the case on my system (stable r2 in flo). Theme.palette.normal.background is white, while the background of the Page is closer to #f6f6f6. (It actually has some texture.) See imgur.com/xVSru9X. Is this a bug? – Robert Schroll Sep 22 '15 at 18:06
    
The page has no style defined, thus it is transparent. What you see is MainView's style, which in 1.2 uses a texture indeed. The color used is Theme.palette.normal.background but the image overrides it. The texture has been removed in 1.3 styles, but as 1.2 is frozen, we cannot apply visual changes there. However you can disable the image by defining your own style for the MainView, where you turn off the image and use only the background color, or you put the ListView on a Rectangle to hide the texture completely. – Zsombor Egri Sep 24 '15 at 4:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.