How to set color for margin?
-
wrote on 18 Apr 2013, 21:01 last edited by
How I can setup color for margin?
In my class (that inherited from QScrollArea) I set up margin on the following manner:
setViewportMargins(0,3,0,0); //ONLY top margin
I want use it for show to user the "active" ScrollArea.
I know about the "border: " but it's not suitable.Thanks.
-
There's no "margin-color" sort of property in CSS. Margin is just the space between the parent border and child border so it lies inside the parent but outside of the child. As such what you would call the color of margin is nothing else than a color of the parent widget.
So to have what you want just set the background-color of the QScrollArea to one color, and the background-color of the content widget to another. -
wrote on 19 Apr 2013, 11:40 last edited by
Thanks, I tried to do that but it's look very ugly :-(
!ftp://RSDN:RSDN@nen777w.no-ip.org/Qt/margin_color.jpg(margin_color)! -
Sorry, can't see the image from this ftp address. Can you post it on something like imageshack?
-
wrote on 19 Apr 2013, 12:03 last edited by
Sorry.
Here:
!http://img221.imageshack.us/img221/1777/margincolor.jpg(margin color)! -
I'm not sure I understand, but instead of giving the background one solid green color you can set a background-image like so:
@
background-image: url(green_image_1px_by_3px.png);
background-position: left top;
background-repeat: repeat-x;
@ -
wrote on 19 Apr 2013, 14:10 last edited by
Hi Chris Kawa,
I just want to say thanks for the idea.
2/7