Moves the panel to the monitor
monitorIndex and position
Adds a context menu to the panel
Adds the panel style class. NB the original
panel style class is kept
Turns on/off the highlight of the panel
Gets the desired property of the panel from gsettings
name of gsettings key
(optional) type of data requested. "b" for boolean, "i" for integer. Default value is string
Function to calculate the desired panel height
returns : panelheight
hidden is true the clip region is set to the one exposed strip of pixels adjacent to the monitor edge. Otherwise, the clip region is set to the panel size plus the shadow on the side of the panel opposite the monitor edge.
offset is only used during tweens. If provided, it is used to offset the current position in order to calculate the exposed size.
Function to update the panel position, size, and clip region according to settings values. Note that this is also called when the style changes.
array _calcBoxSizes (
Given the minimum and natural width requested by each box, this function calculates how much width should actually allocated to each box. The function returns two variables [
The expected outcome of the code is as follows:
Horizontal panels: Assuming that the centerBox is filled, the primary objective is to center the centerBox whenever possible. This will be done all the time unless doing so requires some box's width to go under its minimum width.
If we are centering the centerBox, there are two possible scenarios. Firstly, if the centerBox can be perfectly centered while everything takes their natural size, then everything will be allocated at least their natural size such that the centerBox is centered, leftBox is left aligned, rightBox is right aligned.
Otherwise, we first allocate the minWidth to every box, and then distribute the remaining space proportional to how much more space each box wants. This is done in a way that ensures the leftWidth and rightWidth are equal.
If it is not possible to center the centerBox, but there is enough space to just allocate the boxes, the centerBox will be made as centered as possible without making things go under their minWidth. This is achieved by making the shorter box go to their min width, and distributing the remaining space among the two other boxes.
Finally, if there isn't even enough space to just put the things, the width allocated is just proportional to the minimum width.
In the cases where the centerBox is not occupied, a similar mechanism is employed. If there is enough space for everything to get their natural width, this will happen. Otherwise, we first allocate the minimum width and then distribute the remaining space proportional to how much more space each box wants. In the scenario where the isn't enough space to just allocate the minimum width, we just allocate proportional to the minimum width.
FIXME: consider replacing all of this with clutter constraints. Fundamentally we have three boxes constrained to be butted up against each other and to stretch over the whole panel. If the centre box is populated then it needs to be centred. Any field has to be given a minimum size in edit mode to allow drag and drop.
allocated total width
allocated total height
if on vertical panel
Checks whether the panel should show based on the autohide settings and position of mouse/active window. It then calls the _queueShowHidePanel function to show or hide the panel as necessary.
false = autohide, true = always show, intel = Intelligent
Makes the panel show or hide after a delay specified by panels-show-delay and panels-hide-delay.
Disables the panel by settings the opacity to 0 and hides if autohide is enable. The actor is then hidden after the animation.
A function to force the panel to show. This has no effect if the panel is disabled.
This hides the panel unless this._shouldShow is false. This behaviour is overridden if the
force argument is set to true. However, the panel will always not be hidden if a menu is open, regardless of the value of
the height already taken on the screen by a top panel
the height already taken on the screen by a bottom panel
[left, right] whether to draw corners alongside the panel
the box containing all the applets in the left region
the box containing all the applets in the center region
the box containing all the applets in the right region