Panel

Panel — The file responsible for managing panels

Functions

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

 

parsePanelDef ()


parsePanelDef (string   def);

Parses a single panel definition, rejecting one that doesn't have three elements, or whose id or monitor index is negative or unparseable - such an index matches neither a monitor nor a panel id, so the panel would be registered nowhere and its definition never cleaned up. The position is not checked, getPanelLocFromName() maps anything it doesn't recognise to PanelLoc.bottom.

Parameters

def

a panel definition from settings, in the form ID:monitor:panelposition

 

Returns

[id, monitor index, panel position], or null if the definition is unusable


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