Skip to content

Conversation

mojoro
Copy link

@mojoro mojoro commented Apr 25, 2025

Description

I added a feature to customize the dock margin size when panel mode is enabled. This feature introduces a slider in the settings, allowing users to adjust the margin from the edge of the screen (default: 0px) up to 300px.

This is particularly useful for setups with differently sized monitors, where getting a consistent amount of space from the edge of the screen can be difficult without access to dynamic units (e.g. vw, %, etc.)
dock-margin-demonstration

Implementation Details

Added a new GSettings key (dock-margin-size) to store the margin value.
Updated the settings UI (Settings.ui) to include a slider for margin adjustment.
Modified the dock positioning logic in docking.js to respect the margin value.
Bound the slider to the GSettings key in prefs.js.

Testing

Tested on GNOME Shell 46 with a dual-monitor setup. (1920x1080 and 3440x1440)
Verified that the margin applies correctly in panel mode, both vertically and horizontally.
Confirmed that the default behavior (0px margin) remains unchanged.

Sidenote

This is my first contribution to anything open-source, so feedback is very welcome. If you'd like me to change anything, please let me know.

Copy link
Collaborator

@3v1n0 3v1n0 left a comment

Choose a reason for hiding this comment

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

Thanks looks good and code changes are small enough not to be a problem to maintain, but... Shouldn't the dock borders also be rounded in such case?

I feel the squared borders don't fit well with this case... So I guess we need some new style classes

settings,
"changed::dock-margin-size",
this._resetPosition.bind(this)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Stray newline

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