diff options
author | Gordon Norman Squash <[email protected]> | 2022-08-12 22:36:03 -0400 |
---|---|---|
committer | Luke from DC <[email protected]> | 2022-08-20 16:44:17 +0000 |
commit | 7b1b00d5ddffc349ca117843bd0d015e9fb08a89 (patch) | |
tree | 5953760e730afe1eb25aadf22bcb5d96cff54856 /applets/clock/set-timezone.h | |
parent | 36be054255ff728061c056899c052c790ed43ae1 (diff) | |
download | mate-panel-7b1b00d5ddffc349ca117843bd0d015e9fb08a89.tar.bz2 mate-panel-7b1b00d5ddffc349ca117843bd0d015e9fb08a89.tar.xz |
Fix center- and right-sticking of expanding applets
In a prior commit (38e00280e9d17282717595a05411736a308804c0), I added
support to stick applets to the center of the panel, so that no matter the
width of the applet or the panel, the applet would always stay at the
center of the panel. That commit also added an "end-relative" mode, which
is similar to the panel's old "right-stick" feature, except end-relative
mode positions the applet's right edge relative to the panel's right edge,
whereas right-sticking positioned the applet's left edge relative to the
right edge of the panel. The advantage of end-relative positioning is
that the applet can resize without moving itself even further to the right
than the user intended, whereas if positioned so that there is empty space
between the applet and the edge of the panel, right-stuck applets would
change the size of that gap (or close it entirely) when the applet
resized.
Unfortunately, I have since discovered that my original implementation of
the center-stick and end-relative positioning of applets was inadequate.
Some applets can accept any amount of space between a minimum and their
"preferred" size -- if such an applet cannot be allocated its preferred
size (perhaps because panel space is scarce), then the applet will be
allocated as much space as is available, and the applet will "flex" itself
to compensate. Some examples of these "expanding" applets include the
Window List (a component of the wncklet included in this package) and the
MATE Dock Applet (a third-party panel applet from the Ubuntu MATE
project). When writing my original center-stick code, I did not properly
take expanding applets into account, and with my original commit, such
applets were off-center -- usually way off-center since the code seemed to
position such applets based on their minimum size, rather than their
actual allocated size.
This commit adds center-sticking support for expanding applets. It also
works with end-relative expanding applets -- such applets will expand
towards the left, thus keeping their right-relative position intact.
Diffstat (limited to 'applets/clock/set-timezone.h')
0 files changed, 0 insertions, 0 deletions