Skip to content

WPF - Allow ToolTip timer configuration#4389

Open
amaitland wants to merge 1 commit into
masterfrom
wpf/configuretooltiptimer
Open

WPF - Allow ToolTip timer configuration#4389
amaitland wants to merge 1 commit into
masterfrom
wpf/configuretooltiptimer

Conversation

@amaitland

@amaitland amaitland commented Feb 9, 2023

Copy link
Copy Markdown
Member

Related to issue #4048

Summary:
Allow programmatic configuration of ToolTip timer delay.

Changes:

  • Can set initial show delay in xaml via existing ToolTipService e.g. ToolTipService.InitialShowDelay="100"
  • If InitialShowDelay = 0 then no timer is used and ToolTip is immediately shown
  • Previous delay was 500ms, new delay is the .Net default (typically 1000ms)
  • ToolTipService.GetInitialShowDelay is currently only called in OnLoaded, setting the delay dynamically is not currently supported. Simplest option is to set the delay in xaml

How Has This Been Tested?

  • Manually via CefSharp.Wpf.Example

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Updated documentation

Checklist:

  • Tested the code(if applicable)
  • Commented my code
  • Changed the documentation(if applicable)
  • New files have a license disclaimer
  • The formatting is consistent with the project (project supports .editorconfig)

Summary by CodeRabbit

  • Bug Fixes
    • Improved tooltip behavior for the ChromiumWebBrowser control so tooltips open and close more reliably when content changes.
    • Tooltip show delay now respects system/user settings (initial show delay), giving a more consistent and expected experience.
@amaitland amaitland self-assigned this Feb 9, 2023
@amaitland

Copy link
Copy Markdown
Member Author

If InitialShowDelay = 0 then no timer is used and ToolTip is immediately shown

Related discussion at #4048 (comment)

There's still a few other cases that should be tested.

@AppVeyorBot

Copy link
Copy Markdown
@coderabbitai

coderabbitai Bot commented Aug 2, 2025

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1486ab36-710d-453d-a4ca-8704404b7cd4

📥 Commits

Reviewing files that changed from the base of the PR and between e34ce46 and af32f7e.

📒 Files selected for processing (1)
  • CefSharp.Wpf/ChromiumWebBrowser.cs
🚧 Files skipped from review as they are similar to previous changes (1)
  • CefSharp.Wpf/ChromiumWebBrowser.cs

📝 Walkthrough

Walkthrough

Refactors ChromiumWebBrowser tooltip handling: early-returns on empty tooltip text, opens/closes immediately when no timer, otherwise starts/stops an existing timer; OnLoaded now creates the DispatcherTimer only when ToolTipService.GetInitialShowDelay(this) > 0 and uses that delay as the interval.

Changes

Tooltip Handling Cohort

Layer / File(s) Summary
Tooltip text change handler
CefSharp.Wpf/ChromiumWebBrowser.cs
Reorders early-return when both old/new tooltip are empty, moves timer retrieval after that check, opens/closes tooltip immediately if no timer, otherwise starts/stops the timer based on new tooltip text.
Tooltip timer initialization on load
CefSharp.Wpf/ChromiumWebBrowser.cs
Uses ToolTipService.GetInitialShowDelay(this) to determine timer creation and interval (milliseconds); only creates DispatcherTimer when delay > 0 and keeps it initially disabled with the existing tick handler and priority.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A rabbit taps keys with a twitch and a wink,
Timers now heed the delay they should think.
Empty tips vanish, others wait their cue,
Small hops, tidy code — a browser made new. 🐇

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: allowing ToolTip timer configuration in WPF, which directly relates to the core modification in ChromiumWebBrowser.cs.
Description check ✅ Passed The description includes most required sections: summary, changes, testing details, and types/checklist. All critical information is present and complete, though inline code comments were not added (marked unchecked).
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch wpf/configuretooltiptimer

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@amaitland

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 2, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

1 similar comment
@coderabbitai

coderabbitai Bot commented Aug 2, 2025

Copy link
Copy Markdown
Contributor
✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@AppVeyorBot

Copy link
Copy Markdown
@amaitland amaitland marked this pull request as ready for review June 6, 2026 22:40
- Can set initial show delay in xaml via existing ToolTipService e.g. ToolTipService.InitialShowDelay="100"
- If InitialShowDelay = 0 then no timer is used and ToolTip is immediately shown
- Previous delay was 500ms, new delay is the .Net default (typically 1000ms)

Related to issue #4048
@amaitland amaitland force-pushed the wpf/configuretooltiptimer branch from e34ce46 to af32f7e Compare June 6, 2026 22:41
@amaitland

amaitland commented Jun 6, 2026

Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor
✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@AppVeyorBot

Copy link
Copy Markdown
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants