Panel: Cinnamon Javascript Reference Manual

## Panel Panel — The file responsible for managing panels |

## Functions

| checkPanelUpgrade ()
| heightsUsedMonitor ()
| getPanelLocFromName ()
| toStandardIconSize ()
| PanelCorner ()

## Description

This file is where everything about panels happens. `Main` will create a `PanelManager` object, which is responsible for creating and moving panels. There is also a `checkPanelUpgrade` function used as a transition between the old panel settings and the new panel settings.

## Functions

### checkPanelUpgrade ()

    checkPanelUpgrade ();

Run from main, prior to PanelManager being initialized this handles the one-time transition between panel implementations to make this transition invisible to the user. We will evaluate the desktop-layout key, and pre-set applets-enabled and panels-enabled appropriately.

### heightsUsedMonitor ()

    heightsUsedMonitor (integer   monitorIndex,
                        array     listofpanels);

Retrieves the heights used in horizontal panels on the monitor to that vertical panels can be sized and positioned not to overlap them

#### Parameters

monitorIndex | index of monitor |
listofpanels | array of panels |

#### Returns

a two element array

### getPanelLocFromName ()

    getPanelLocFromName (char   pname);

get the panel numeric type from its name in settings

returns - panel type (integer)

#### Parameters

pname | panel type |

### toStandardIconSize ()

    toStandardIconSize (integer   maxSize);

Calculates the nearest standard icon size up to a maximum.

#### Parameters

maxSize | the maximum size of the icon |

#### Returns

an integer, the icon size

### PanelCorner ()

    PanelCorner (box,
                 side,
                 cornertype);

Sets up a panel corner

The panel corners are there for a non-obvious reason. They are used as the positioning points for small drawing areas that use some optional css to draw small filled arcs (in the repaint function). This allows windows with rounded corners to be blended into the panels in some distros, gnome shell in particular. In mint tiling and full screen removes any rounded window corners anyway, so this optional css is not there in the main mint themes, and the corner/cairo functionality is unused in this case. Where the corners are used they will be positioned so as to fill in the tiny gap at the corners of full screen windows, and if themed right they will be invisible to the user, other than the window will appear to go right up to the corner when full screen

#### Parameters

box | the box in a panel the corner is associated with |
side | the side of the box a text or icon/text applet starts from (RTL or LTR driven) |
cornertype | top left, bottom right etc. |