Skip to content

Panel cleanup 2#13613

Open
JosephMcc wants to merge 13 commits intolinuxmint:masterfrom
JosephMcc:panel-cleanup-2
Open

Panel cleanup 2#13613
JosephMcc wants to merge 13 commits intolinuxmint:masterfrom
JosephMcc:panel-cleanup-2

Conversation

@JosephMcc
Copy link
Contributor

This ports a few more things over to classes and GObject. It removes two more uses of CinnamonGenericContainer in the PanelDummy and Panel objects. This could be taken further but doing the best I can to minimize any possible breakage.

The entire file is a bit of a mess in styling. Cleaned up a bit but it could use some more work.

Tested this quite a bit but it's possible there are a few lingering issues.

This isn't used anywhere in Cinnamon or any Xlets.
Clean up uses of Lang.bind() and clean up a few variable names and some code
styling
This removes a use of CinnamonGenericContainer
We only have one unmaintained applet using this currently. For the use case
of a spinner, we can add a dedicated object for that purpose. We have other
uses for that.
Remove usage of Lang.bind() as well
Remove old commented out options. These have been disabled for a long time.
They can be re-added if we want to bring them back.
This removes another major use of CinnamonGenericContainer. This could be
taken even further, but trying to break as little as possible with this
change.
This is only a partial cleanup. This file is a mess of different styles
but hopefully it's at least a bit better.
// so we don't need to pass it to the constructor anymore, but would
// require a compatibility clean-up effort.
applet = extension.module.main(extension.meta, orientation, panel.height, applet_id);
applet = extension.module.main(extension.meta, orientation, panel.heightForZone, applet_id);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be Zones not Zone?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. Fixed now.

@mtwebster
Copy link
Member

mtwebster commented Mar 3, 2026

Quite a few spices check panel.height - they'll probably be ok except in hidpi, or does it even matter?

I wonder if I should flag it in our PR scanner..

edit: It looks like panel.height was the 'real' height already, though I guess vertical panels would break this... so we probably need to flag them in the scanner...

Missed this when converting the panel to an St.Widget
@JosephMcc
Copy link
Contributor Author

JosephMcc commented Mar 4, 2026

It probably does need to be flagged. I almost left that commit out to do in a separate PR because I knew it might cause issues. Previously, panel.height() returned either the panels height or width based on the orientation. Using a variable name that shadowed an objects actual property wasn't a good choice to begin with. Now that it's an actual object, panel.height will return the panels real height regardless of orientation. That's probably not what's wanted in most cases.

In summary, it had to be renamed to something that wasn't already one of the widgets actual properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants