Top | ![]() |
![]() |
![]() |
![]() |
|
updatePosition () |
|
addContextMenuToPanel () |
|
addPanelStyleClass () |
|
destroy () |
|
highlight () |
|
isHideable () |
|
_getProperty () |
|
_updatePanelBarriers () |
|
_getScaledPanelHeight () |
|
_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 | |
boolean | scaleMode | |
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
_updatePanelBarriers ();
https://cgit.freedesktop.org/cgit/?url=xorg/proto/fixesproto/plain/fixesproto.txt
_getScaledPanelHeight ();
Function to calculate the desired panel height
returns : panelheight
_moveResizePanel ();
Function to update the panel position and size 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.
_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.
false = autohide, true = 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