Immediate-Mode-UI / Immediate-Mode-UI/Nuklear

Scrollbars Appear when content fills area that scrollbar would appear in

Open
#465 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
11.4k
Forks
686
Avg merge
4d 1h
Merged PRs (30d)
3

Description

When content fills and area (even partially) that a scrollbar would be drawn in, the scrollbars automatically appear, even if the content is not larger than the window/container.

Platform: Linux: x86_64
Rendering Info: GLFW, GLAD, OpenGL 3.3



Example 1 (Default scrollbar is 10px, scrollbar appears):

```
if (nk_begin(ctx, "Demo", nk_rect(0, 0, 800, 600), (nk_flags)NULL))
{
ctx->style.window.padding = {0,0};
ctx->style.window.spacing = {0,0};
ctx->style.button.padding = {0,0};
nk_layout_row_static(ctx, 591, 791, 1);
if (nk_button_label(ctx, "button"))
fprintf(stdout, "button pressed\n");
}
nk_end(ctx);
```



Example 2 (Settings scrollbar to 5px, scrollbar still appears):

```
if (nk_begin(ctx, "Demo", nk_rect(0, 0, 800, 600), (nk_flags)NULL))
{
ctx->style.window.padding = {0,0};
ctx->style.window.spacing = {0,0};
ctx->style.button.padding = {0,0};
ctx->style.window.scrollbar_size = {5,5};
nk_layout_row_static(ctx, 596, 796, 1);
if (nk_button_label(ctx, "button"))
fprintf(stdout, "button pressed\n");
}
nk_end(ctx);
```

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce both examples on Linux with the GLFW, GLAD, and OpenGL 3.3 setup described in the report, comparing the 10px and 5px scrollbar cases. Trace the scrollbar and layout behavior until the fit calculation is located; done means neither example shows a scrollbar when the content fits its window or container.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.