Skip to content

chore: sync alpha → alpha-backup (automated)#3882

Open
github-actions[bot] wants to merge 18 commits into
alpha-backupfrom
alpha
Open

chore: sync alpha → alpha-backup (automated)#3882
github-actions[bot] wants to merge 18 commits into
alpha-backupfrom
alpha

Conversation

@github-actions

Copy link
Copy Markdown

Automated PR: alpha has had commits in the last 24 hours. Merge to update alpha-backup.

Triggered by Alpha to Alpha-Backup Sync workflow.

PWagner1 and others added 18 commits June 29, 2026 15:08
Implements issue #3807: adds a new KryptonKnob rotary control (and enhanced KryptonKnobAlternate) with full palette State### integration, appearance/behavior/value objects, palette redirect/override types, drawing helpers, and input controllers. Includes event args, indicator/backplate presets, graduations/subdivisions, and designer-friendly properties. Adds test/demo forms (KryptonKnobDemo, KryptonKnobAlternateDemo) and designers, updates StartScreen and Changelog. Provides comprehensive UI and property-grid demos to exercise palette, interaction (mouse/keyboard/two‑click rotation), and visual presets.
# Fix tooltip placement to respect cursor hotspot (#3850)

Closes [#3850](#3850)

## Summary

- Tooltip placement in `VisualPopupToolTip` now uses the full cursor image bounds in screen space instead of misusing hotspot coordinates as width/height.
- Adds `CommonHelper.GetCursorScreenBounds` to resolve hotspot and bitmap size via `GetIconInfo`, with fallback to `Cursor.HotSpot` and `Cursor.Size`.
- Adds a TestForm demo and a changelog entry.

## Problem

`VisualPopupToolTip` treated the cursor hotspot as a rectangle size when positioning tooltips:

- `PlacementMode.Mouse` built a tiny placement rectangle from hotspot X/Y as width/height.
- Overlap checks used `new Rectangle(screenHotSpot, (Size)hotSpot)`, which does not represent the cursor bitmap.
- When a tooltip would cover the cursor, placement nudged by a hard-coded `+ 4` pixels.
- `ShowCalculatingSize` offset from the hotspot by `(hotSpot.X + 2, hotSpot.Y + 2)` rather than anchoring past the full cursor image.

This caused tooltips to overlap the cursor hotspot, especially with non-default cursors (I-beam, wait, size-all).

## Solution

1. **`CommonHelper.GetCursorScreenBounds`**
   - Takes the screen hotspot position (from `GetCursorPos` / `ToolTipEventArgs.ControlMousePosition`).
   - Reads hotspot and bitmap dimensions from the active cursor handle via `GetIconInfo`.
   - Returns the cursor image rectangle in screen coordinates.

2. **`VisualPopupToolTip`**
   - `PlacementMode.Mouse` and fallback placement use `cursorBounds`.
   - `RelativePoint` / `Center` overlap detection uses `cursorBounds`.
   - Overlap nudge uses `cursorBounds.Right + 2`.
   - `ShowCalculatingSize` anchors below-right of the cursor image.

No public API changes. Binary-compatible bug fix.

## Files changed

| File | Change |
|------|--------|
| `Source/Krypton Components/Krypton.Toolkit/General/CommonHelper.cs` | Add `GetCursorScreenBounds` |
| `Source/Krypton Components/Krypton.Toolkit/Controls Visuals/VisualPopupTooltip.cs` | Use cursor bounds for placement and overlap avoidance |
| `Source/Krypton Components/TestForm/Bug3850TooltipHotSpotDemo.cs` | New demo form |
| `Source/Krypton Components/TestForm/Bug3850TooltipHotSpotDemo.Designer.cs` | Designer for demo form |
| `Source/Krypton Components/TestForm/StartScreen.cs` | Register demo |
| `Documents/Changelog/Changelog.md` | Changelog entry |

## Test plan

- [ ] Build `Krypton.Toolkit` and `TestForm` (`net48` or solution Debug build).
- [ ] Run TestForm and open **Bug 3850 Tooltip HotSpot**.
- [ ] Hover each button (`Mouse`, `RelativePoint`, `Center`) with default arrow cursor — tooltip should not cover the hotspot.
- [ ] Switch cursor to I-beam, wait, and size-all in the demo panel; repeat hover tests.
- [ ] Enable **Use legacy cursor-anchored placement** and hover **KryptonToolTip (legacy path)** — tooltip should appear below-right of the cursor, not on the hotspot.
- [ ] Hover the cursor region label with `PlacementMode.Mouse` and a wide cursor (wait/size-all).
- [ ] Smoke-test built-in control tooltips on a `KryptonButton` with default `Bottom` placement (unchanged path).
# Fix tooltip placement to respect cursor hotspot (#3850)

Closes
[#3850](#3850)

## Summary

- Tooltip placement in `VisualPopupToolTip` now uses the full cursor
image bounds in screen space instead of misusing hotspot coordinates as
width/height.
- Adds `CommonHelper.GetCursorScreenBounds` to resolve hotspot and
bitmap size via `GetIconInfo`, with fallback to `Cursor.HotSpot` and
`Cursor.Size`.
- Adds a TestForm demo and a changelog entry.

## Problem

`VisualPopupToolTip` treated the cursor hotspot as a rectangle size when
positioning tooltips:

- `PlacementMode.Mouse` built a tiny placement rectangle from hotspot
X/Y as width/height.
- Overlap checks used `new Rectangle(screenHotSpot, (Size)hotSpot)`,
which does not represent the cursor bitmap.
- When a tooltip would cover the cursor, placement nudged by a
hard-coded `+ 4` pixels.
- `ShowCalculatingSize` offset from the hotspot by `(hotSpot.X + 2,
hotSpot.Y + 2)` rather than anchoring past the full cursor image.

This caused tooltips to overlap the cursor hotspot, especially with
non-default cursors (I-beam, wait, size-all).

## Solution

1. **`CommonHelper.GetCursorScreenBounds`**
- Takes the screen hotspot position (from `GetCursorPos` /
`ToolTipEventArgs.ControlMousePosition`).
- Reads hotspot and bitmap dimensions from the active cursor handle via
`GetIconInfo`.
   - Returns the cursor image rectangle in screen coordinates.

2. **`VisualPopupToolTip`**
   - `PlacementMode.Mouse` and fallback placement use `cursorBounds`.
   - `RelativePoint` / `Center` overlap detection uses `cursorBounds`.
   - Overlap nudge uses `cursorBounds.Right + 2`.
   - `ShowCalculatingSize` anchors below-right of the cursor image.

No public API changes. Binary-compatible bug fix.

## Files changed

| File | Change |
|------|--------|
| `Source/Krypton Components/Krypton.Toolkit/General/CommonHelper.cs` |
Add `GetCursorScreenBounds` | | `Source/Krypton
Components/Krypton.Toolkit/Controls Visuals/VisualPopupTooltip.cs` | Use
cursor bounds for placement and overlap avoidance | | `Source/Krypton
Components/TestForm/Bug3850TooltipHotSpotDemo.cs` | New demo form | |
`Source/Krypton
Components/TestForm/Bug3850TooltipHotSpotDemo.Designer.cs` | Designer
for demo form | | `Source/Krypton Components/TestForm/StartScreen.cs` |
Register demo | | `Documents/Changelog/Changelog.md` | Changelog entry |

## Test plan

- [ ] Build `Krypton.Toolkit` and `TestForm` (`net48` or solution Debug
build).
- [ ] Run TestForm and open **Bug 3850 Tooltip HotSpot**.
- [ ] Hover each button (`Mouse`, `RelativePoint`, `Center`) with
default arrow cursor — tooltip should not cover the hotspot.
- [ ] Switch cursor to I-beam, wait, and size-all in the demo panel;
repeat hover tests.
- [ ] Enable **Use legacy cursor-anchored placement** and hover
**KryptonToolTip (legacy path)** — tooltip should appear below-right of
the cursor, not on the hotspot.
- [ ] Hover the cursor region label with `PlacementMode.Mouse` and a
wide cursor (wait/size-all).
- [ ] Smoke-test built-in control tooltips on a `KryptonButton` with
default `Bottom` placement (unchanged path).
Implements issue #3807: adds a new KryptonKnob rotary control (and
enhanced KryptonKnobAlternate) with full palette State### integration,
appearance/behavior/value objects, palette redirect/override types,
drawing helpers, and input controllers. Includes event args,
indicator/backplate presets, graduations/subdivisions, and
designer-friendly properties. Adds test/demo forms (KryptonKnobDemo,
KryptonKnobAlternateDemo) and designers, updates StartScreen and
Changelog. Provides comprehensive UI and property-grid demos to exercise
palette, interaction (mouse/keyboard/two‑click rotation), and visual
presets.

<img width="1164" height="802" alt="image"
src="https://github.com/user-attachments/assets/e72e307c-2d9d-495a-94b1-5aed4ff43072"
/>

<img width="1234" height="870" alt="image"
src="https://github.com/user-attachments/assets/d5b5abff-a097-4865-996f-36679b7be310"
/>
@github-actions github-actions Bot requested a review from a team as a code owner July 10, 2026 02:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant