Skip to content

feat(config): add dock configuration options and refactor border radius#549

Open
MiraiDevv wants to merge 2 commits into
pop-os:masterfrom
MiraiDevv:master
Open

feat(config): add dock configuration options and refactor border radius#549
MiraiDevv wants to merge 2 commits into
pop-os:masterfrom
MiraiDevv:master

Conversation

@MiraiDevv
Copy link
Copy Markdown

@MiraiDevv MiraiDevv commented Jan 20, 2026

This PR and these changes aim to make one of the most important components of the Cosmic Desktop Environment (DE) more flexible for users. I created a function to increase and decrease the dock size as desired, and also to allow it to increase in size as applications are opened.

In addition, several other changes were made to allow users more freedom, such as: changing the border radius as much as desired and positioning the dock anywhere at the bottom of the DE.

This functionality is linked to another one I needed to make in cosmic-settings, so the two will be mentioned together in the two PRs that will be opened.

The other PR in cosmic-settings that is directly linked to this one is this one: pop-os/cosmic-settings#1771

Any errors or criticism are welcome ; )

/// optional dock length override as percent of output (0 = auto)
pub dock_length_percent: Option<u16>,
/// optional dock position override as percent of available space (0-100)
pub dock_position_percent: Option<u16>,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Wouldn't it be better not to have the dock_ prefix?

Copy link
Copy Markdown
Author

@MiraiDevv MiraiDevv Jan 21, 2026

Choose a reason for hiding this comment

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

Wouldn't it be better not to have the dock_ prefix?

Keeping the dock_ prefix here is intentional to reduce ambiguity.

The reasoning is as follows:

  • These options reside within CosmicPanelConfig, which describes both panels and docks.

  • Generic names like length_percent or position_percent would suggest they apply to any instance, whereas the

  • prefix clarifies they are exclusive overrides for the Dock.

  • It prevents future naming collisions if equivalent fields are introduced for Panels.

  • It assists with configuration serialization and compatibility, as the config file currently mixes common and specific fields.

    But if you prefer, I can remove it.

/// optional dock icon size override
pub dock_icon_size: Option<u16>,
/// optional dock corner radius override
pub dock_corner_radius: Option<u16>,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

How does this differ from border_radius?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

dock_corner_radius acts as an optional override specifically for the Dock.

The logic is as follows:

Some: It overrides the value, ignoring border_radius for the background rendering and transition animations.

None: The default behavior is maintained, and the Dock continues to use border_radius.

It serves primarily for aesthetic customization, allowing the Dock to have a distinct shape from the global theme without affecting layout, padding, or input regions. For example, a user might want a floating dock with fully rounded corners (pill shape) while keeping a different border_radius for other panels.

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