Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize the workspace scrollbar margin #8587

Open
1 task done
FranciscoCaetano88 opened this issue Sep 24, 2024 · 1 comment
Open
1 task done

Customize the workspace scrollbar margin #8587

FranciscoCaetano88 opened this issue Sep 24, 2024 · 1 comment
Labels
issue: feature request Describes a new feature and why it should be added
Milestone

Comments

@FranciscoCaetano88
Copy link

FranciscoCaetano88 commented Sep 24, 2024

Check for duplicates

  • I have searched for similar issues before opening a new one.

Problem

No response

Request

I want to add a margin to the workspaces scrollbar to create some space between it and the edges of the viewport.

After examining the Blockly code, I discovered that the ScrollbarPair and Scrollbar constructors can accept an optional margin parameter. The issue is that this optional margin isn't being passed to the new ScrollbarPair in the core/inject module.

ScrollbarPair class:
constructor(
private workspace: WorkspaceSvg,
addHorizontal?: boolean,
addVertical?: boolean,
opt_class?: string,
opt_margin?: number,
) {
...
}

core/inject
mainWorkspace.scrollbar = new ScrollbarPair(
mainWorkspace,
horizontalScroll,
verticalScroll,
'blocklyMainWorkspaceScrollbar',
// missing margin
);

A quick fix would be to add this property coming from the scrollbar blockly options.

Alternatives considered

Register a new vertical/horizontal Scrollbar using the registry to override the Scrollbar characteristics or behaviours.
Remove the read only keyword from the static property DEFAULT_SCROLLBAR_MARGIN.

Additional context

No response

@FranciscoCaetano88 FranciscoCaetano88 added issue: feature request Describes a new feature and why it should be added issue: triage Issues awaiting triage by a Blockly team member labels Sep 24, 2024
@FranciscoCaetano88 FranciscoCaetano88 changed the title Customize the scrollbar margin Customize the workspace scrollbar margin Sep 24, 2024
@cpcallen cpcallen added this to the Upcoming milestone Sep 30, 2024
@cpcallen cpcallen removed the issue: triage Issues awaiting triage by a Blockly team member label Sep 30, 2024
@cpcallen
Copy link
Contributor

This seems like a useful feature request, but we want to do a bit more investigation of alternative approaches before implementing the proposed change, as we're generally trying to move away from configuration options and use CSS for appearance-related configuration wherever possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: feature request Describes a new feature and why it should be added
Projects
None yet
Development

No branches or pull requests

2 participants