Top |
|
updatePosition () |
|
addContextMenuToPanel () |
|
addPanelStyleClass () |
|
destroy () |
|
highlight () |
|
isHideable () |
|
_getProperty () |
|
_getJSONProperty () |
|
_updatePanelBarriers () |
|
_getScaledPanelHeight () |
|
_setClipRegion () |
|
_moveResizePanel () |
|
_calcBoxSizes () |
|
_updatePanelVisibility () |
|
_queueShowHidePanel () |
|
disable () |
|
enable () |
|
_showPanel () |
|
_hidePanel () |
int | panelId | |
int | monitorIndex | |
int | toppanelHeight | |
int | bottompanelHeight | |
array | drawcorner | |
Meta.Rectangle | monitor | |
integer | panelPosition | |
Cinnamon.GenericContainer | actor | |
St.BoxLayout | _leftBox | |
St.BoxLayout | _centerBox | |
St.BoxLayout | _rightBox | |
boolean | _hidden | |
boolean | _disabled | |
boolean | _panelEditMode | |
Panel.PanelContextMenu | _context_menu |
updatePosition (monitorIndex
);
Moves the panel to the monitor monitorIndex
and position panelPosition
addContextMenuToPanel ();
panelPosition
, integer
Adds a context menu to the panel
addPanelStyleClass ();
panelPosition
, integer
Adds the panel style class. NB the original panel
style class is kept
_getProperty (string key
,string type
);
Gets the desired property of the panel from gsettings
_getJSONProperty (string key
);
Gets the desired JSON encoded property of the panel from gsettings
_updatePanelBarriers ();
https://cgit.freedesktop.org/cgit/?url=xorg/proto/fixesproto/plain/fixesproto.txt
_getScaledPanelHeight ();
Function to calculate the desired panel height
returns : panelheight
_setClipRegion (hidden
,offset
);
If 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.
_moveResizePanel ();
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 (real allocWidth
,real allocHeight
,boolean vertical
);
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 [leftBoundary
, rightBoundary
]
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.
_updatePanelVisibility ();
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.
true = autohide, false = always show, intel = Intelligent
_queueShowHidePanel ();
Makes the panel show or hide after a delay specified by panels-show-delay and panels-hide-delay.
disable ();
Disables the panel by settings the opacity to 0 and hides if autohide is enable. The actor is then hidden after the animation.
_showPanel ();
A function to force the panel to show. This has no effect if the panel is disabled.
“toppanelHeight”
property “toppanelHeight” int
the height already taken on the screen by a top panel
“bottompanelHeight”
property “bottompanelHeight” int
the height already taken on the screen by a bottom panel
“drawcorner”
property “drawcorner” array
[left, right] whether to draw corners alongside the panel
“_leftBox”
property “_leftBox” St.BoxLayout
the box containing all the applets in the left region
“_centerBox”
property “_centerBox” St.BoxLayout
the box containing all the applets in the center region
“_rightBox”
property “_rightBox” St.BoxLayout
the box containing all the applets in the right region