chore: sync alpha → alpha-backup (automated)#3882
Open
github-actions[bot] wants to merge 18 commits into
Open
Conversation
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" />
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated PR: alpha has had commits in the last 24 hours. Merge to update alpha-backup.
Triggered by Alpha to Alpha-Backup Sync workflow.