2

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.

Ivan Akulov
  • 4,323
  • 5
  • 37
  • 64
  • do you mean the windows frame section? http://qt-project.org/doc/qt-4.8/qt.html#WindowFrameSection-enum – Rachel Gallen May 25 '13 at 15:46
  • @RachelGallen No. I've updated question, have a look at it again please. – Ivan Akulov May 25 '13 at 16:01
  • 1
    What you are looking to change is part of window manager decoration (i.e. the title bar). GTK+ doesn't have control over this (which you have pointed out to be the case in Qt as well). So most likely your solution will depend on the window manager which is being used in the running session. If you are on Gnome, most probably you might be running metacity or possibly compiz. In case you are running metacity you may want to check theme file with naming on the lines of `metacity-theme-*.xml` under `/usr/share/themes/*` (there is a possibilities of having multiple window manager themes.)... – another.anon.coward May 26 '13 at 18:33
  • ... Not sure about compiz. So AFAIK there is no one single solution which you can use to accomplish this. You will have to fix you requirement for particular window manager(s) and modify their theme accordingly. – another.anon.coward May 26 '13 at 18:34

2 Answers2

1

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);
}
0

It is defined in the shell theme's css file under

/usr/share/themes

What you are searching for is the

border-radius

property of the windows.

user897079
  • 2,915
  • 1
  • 15
  • 4
  • There are lots of `border-radius` values in theme's css files, but I can't find anyone related to window decoration. As an example, can you find corresponding line in [Adwaita theme](http://gnome-look.org/content/show.php/?content=144237) please? – Ivan Akulov Jun 03 '13 at 08:16