Commit 3d778ae8 authored by ROOL's avatar ROOL 🤖
Browse files

Brush pane tweaks

Detail:
  Hide the scrollbar under the brushes if the pane is narrow enough to show all.
  Remove excess space after interactive help token.
parent 562bab11
No preview for this file type
......@@ -1063,6 +1063,8 @@ static void make_brush_pane (void)
{ char *brush_name;
int num_sys_brushes = 0;
main_sprite *sprite_ptr;
int panewidth, max_brush_index;
wimp_box last_bbox;
ftracef0 ("make_brush_pane\n");
......@@ -1085,6 +1087,7 @@ static void make_brush_pane (void)
if (sprite_ptr == NULL)
break;
}
max_brush_index = num_brushpane_icons;
/* Add the last user brush, if any. Mustn't have duplicates *
* or invalid characters! */
......@@ -1102,6 +1105,16 @@ static void make_brush_pane (void)
if (tools_brushpane_handle != 0)
destroy_brush_pane ();
/* As the number of brushes is fixed when there's a user brush, we don't
want a scroll bar if they all fit on the screen */
get_brush_pane_icon_bbox (max_brush_index, &last_bbox);
panewidth = tools_brushpane_template.t.box.x1 - tools_brushpane_template.t.box.x0;
if (last_bbox.x0 >= 0 && last_bbox.x0 < panewidth &&
last_bbox.x1 > 0 && last_bbox.x1 <= panewidth)
tools_brushpane_template.t.flags &= ~wimp_WHSCR;
else
tools_brushpane_template.t.flags |= wimp_WHSCR;
ftracef0 ("Create brushes window pane\n");
if (main_create_window (&tools_brushpane_template.t, &tools_brushpane_handle,
&brush_pane_event_handler, NULL) == 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment