linuxqtwindowcompizwindow-decoration

How to get window frame radius in Unity/Compiz?


Is there a way to get window frame radius in Unity (Compiz window manager)? Should I do such by parsing active window theme? If so, what files should I parse? Any other ways are accepted too. Plus, if you know a solution for any other WM, write it please.

I use Qt, and, as good as I know, it doesn't provide such functionality 'of the box'. But, if you know any Qt options, they are preferred.

Under window frame radius I mean the following area (bordered by red, red is not included):

For example, at the illustration, frame border radius is 6 px because the side of the square inside red border is 6px.


Solution

  • For Ubuntu 14.04.02 LTS/Unity, radius is controlled by CSS in /usr/share/themes/<theme name>/gtk-3.0/apps/unity.css

    Locate the line "border-radius:" as indicated in the text below. Change the values according to standard CSS radius rules. Default values are: 6px 6px 0 0;

    This changes ONLY the title bar across the top and applies to the 4 corners of the title bar.

    Logout/login for changes to take effect.

    The text displayed below is from the "Radiance" theme in /usr/share/themes/Radiance/gtk-3.0/apps/unity.css after modification.

    UnityDecoration.top {
        border: 1px solid rgba (85, 40, 0, 0.04); /* shade (@dark_bg_color) (shade (#edebe6, 1.06) */
        border-bottom-width: 0;
    --> border-radius: 3px 3px 0 0;
        padding: 1px 6px 0 6px;
    
        box-shadow: inset 0 0 transparent, inset 0 0 transparent,
                    inset 0 1px shade (#edebe6, 1.065), inset 0 0 transparent;
    
        background-color: transparent;
        background-clip: border-box;
        background-image: -gtk-gradient (linear, left top, left bottom,
                                         from (shade (#edebe6, 1.06)),
                                         to (@dark_bg_color));
    
        color: shade (@dark_bg_color, 0.4);
        text-shadow: 1px 0 shade (@dark_bg_color, 1.06), -1px 0 shade (@dark_bg_color, 1.06),
                     0 1px shade (@dark_bg_color, 1.06), 0 -1px shade (@dark_bg_color, 1.06);
    }