Skip to content

[Controls] Extract RectangleSelectionMarquee control with per-theme colours - #607

Merged
Xavier Fortin (xfortin-devolutions) merged 2 commits into
masterfrom
create-MarqueeSelectionRectangle-control
Jul 29, 2026
Merged

[Controls] Extract RectangleSelectionMarquee control with per-theme colours#607
Xavier Fortin (xfortin-devolutions) merged 2 commits into
masterfrom
create-MarqueeSelectionRectangle-control

Conversation

@xfortin-devolutions

@xfortin-devolutions Xavier Fortin (xfortin-devolutions) commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Extracts the GroupedTileListBox drag-to-select rubber-band into a dedicated, reusable RectangleSelectionMarquee templated control, and gives each theme control over the marquee's fill and border colours.

Previously the marquee was an inline Border in the GroupedTileListBox template, tinted with SystemAccentColor via brushes defined locally in GroupedTileListBox.axaml. This meant the marquee looked identical across all themes and couldn't be restyled independently. This PR:

  • Adds RectangleSelectionMarquee (TemplatedControl) with its own ControlTheme in Devolutions.AvaloniaControls, registered through DefaultControlTemplates.axaml.
  • Replaces the inline Border in GroupedTileListBox with the new control (template part type updated accordingly).
  • Introduces RectangleSelectionMarqueeFill / RectangleSelectionMarqueeBorderBrush resources per theme:
    • DevExpress and Linux (Yaru): accent-tinted (SystemAccentColor), matching the previous Explorer-style rubber-band.
    • macOS: neutral black/white tint (light/dark) for a more native AppKit-style selection rectangle.

Builds on the drag-to-select marquee introduced in #602.

Changes

  • RectangleSelectionMarquee.axaml / .axaml.cs — new control + default template
  • GroupedTileListBox.axaml / .axaml.cs — use the new control; drop local brush definitions
  • DefaultControlTemplates.axaml — register the new control theme
  • ThemeResources.axaml (DevExpress, Linux, macOS) — per-theme marquee brushes

Copilot AI review requested due to automatic review settings July 29, 2026 15:16

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Extracts the drag-selection marquee into a reusable themed control.

Changes:

  • Adds RectangleSelectionMarquee and its default template.
  • Adds DevExpress, Linux, and macOS theme brushes.
  • Updates GroupedTileListBox to use the new control.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
MacOS ThemeResources.axaml Adds light/dark neutral brushes.
Linux ThemeResources.axaml Adds accent-based brushes.
DevExpress ThemeResources.axaml Adds accent-based brushes.
DefaultControlTemplates.axaml Registers the control theme.
RectangleSelectionMarquee.axaml.cs Defines the control type.
RectangleSelectionMarquee.axaml Defines its visual template.
GroupedTileListBox.axaml.cs Updates the template-part type.
GroupedTileListBox.axaml Replaces the inline border.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings July 29, 2026 15:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/Devolutions.AvaloniaControls/Controls/RectangleSelectionMarquee.axaml:9

  • These two keys are only defined by the custom theme packages, but DefaultControlTemplates.axaml is also loaded directly by SampleApp's Fluent and Simple themes (samples/SampleApp/App.axaml:33-45). In those supported configurations both dynamic lookups are unresolved, so the marquee has neither fill nor border and drag selection becomes visually invisible. Please provide fallback brushes in Devolutions.AvaloniaControls while allowing each custom theme to override them.
    <Setter Property="Background" Value="{DynamicResource RectangleSelectionMarqueeFill}" />
    <Setter Property="BorderBrush" Value="{DynamicResource RectangleSelectionMarqueeBorderBrush}" />

@randy-but-a-ro randy-but-a-ro Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🤖 Pull request was approved automatically: the AI review is complete and all its review threads are resolved. 🎉

Integration Details
{
	"deliveryId": "73a41680-8b64-11f1-917a-506cc72d4ac6",
	"headSha": "6f743ce80f563460899e8f5e4fff41556ec64137",
	"reviewer": "copilot-pull-request-reviewer[bot]"
}

@xfortin-devolutions
Xavier Fortin (xfortin-devolutions) merged commit a2b58be into master Jul 29, 2026
1 check passed
@xfortin-devolutions
Xavier Fortin (xfortin-devolutions) deleted the create-MarqueeSelectionRectangle-control branch July 29, 2026 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants