Skip to content

Border should support ViewportSettings.Transparent & ViewportSettings.TransparentMouse #4834

@tig

Description

@tig

Summary

Border (an Adornment) does not currently honor ViewportSettingsFlags.Transparent or ViewportSettingsFlags.TransparentMouse. When these flags are set on a Border, the expected behavior is:

  • Transparent: Areas of the Border that are not occupied by drawn border lines or title text should be visually transparent, allowing underlying views to show through.
  • TransparentMouse: Mouse events in transparent areas of the Border should pass through to underlying views, while clicks on drawn border lines/title text are still handled by the Border.

Expected Behavior

When Border.ViewportSettings includes ViewportSettingsFlags.Transparent:

  • Only the actual border lines and title text are drawn; empty areas within the Border's bounds are transparent.
  • Underlying views are visible through the transparent areas.

When Border.ViewportSettings includes ViewportSettingsFlags.TransparentMouse:

  • Mouse events in transparent (non-drawn) areas pass through to views underneath.
  • Mouse events on border lines and title text are still captured by the Border.

Motivation

This is a prerequisite for the Border-based TabView redesign (#4183). In the new design, each Tab is a View whose Border renders a small tab header rectangle. The Border area outside the header must be transparent (both visually and for mouse events) so that:

  1. The content of the selected tab is visible through the non-header portion of unselected tabs' Borders.
  2. Clicks outside a tab header pass through to the content area below.

Current Behavior

Setting ViewportSettingsFlags.Transparent and/or ViewportSettingsFlags.TransparentMouse on a Border has no effect — the Border still fills its entire area and captures all mouse events within its bounds.

Acceptance Criteria

  • Border with ViewportSettingsFlags.Transparent renders only border lines and title text; empty areas are transparent
  • Border with ViewportSettingsFlags.TransparentMouse passes mouse events through transparent areas
  • Unit tests covering both flags on Border
  • Existing Border tests continue to pass

Metadata

Metadata

Assignees

No one assigned

    Projects

    Status

    No status

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions