-
Notifications
You must be signed in to change notification settings - Fork 782
Fixes #4850 - Show URL of Link in Tooltip (+ StatusBar in UICatalog) #4850
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 9 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
d40e3bb
Show URL on enter link
ccoulioufr 5dbab39
tooltip used by link
ccoulioufr 96a40a3
Refactor About dialog and update Link activation logic
tig 37b4fd3
Upgrade About box to use Link and gradient box-drawing logo
tig bfb24ad
tooltip system
ccoulioufr 0d7424c
merge tig fixes
ccoulioufr 488f315
fix UseToolTip case
ccoulioufr bf17542
refactor with provider
ccoulioufr bd8c3c8
Merge branch 'v2_develop' into fix/show-link-url-on-enter
tig 20fc680
Code cleanup & review.
tig 6d9d6ec
Update Terminal.Gui/Views/Link.cs
tig e4e842a
Merge branch 'v2_develop' into fix/show-link-url-on-enter
tig c4a7117
Merge branch 'v2_develop' into fix/show-link-url-on-enter
tig 7814520
Merge branch 'v2_develop' into fix/show-link-url-on-enter
tig 5862ce8
RemoveTooltip case
ccoulioufr 4963bf1
MakeVisible multi event
ccoulioufr 5b133f4
fix ToolTipExtensions name
ccoulioufr 5de6af6
fix ToolTipManager name
ccoulioufr 72c81ad
fix tooltip case
ccoulioufr 4563bd1
unregister Disposing
ccoulioufr 9c80674
empty tooltip removes tooltip
ccoulioufr ede92d2
link comment
ccoulioufr 87a04cb
threadsafe manager
ccoulioufr 76d0f80
internal fields for tests
ccoulioufr 47dff31
Merge branch 'fix/show-link-url-on-enter' of https://github.com/ccoul…
tig b2a066c
tooltip tests
ccoulioufr 3229bd9
ShowsHidesToolTip with runnable
ccoulioufr e333fbe
ApplicationToolTip
ccoulioufr 108975a
Merge branch 'v2_develop' into fix/show-link-url-on-enter
tig 3beee2d
Merge branch 'fix/show-link-url-on-enter' of https://github.com/ccoul…
tig 069f001
Improve link handling and UI consistency in scenarios
tig 448f707
more code cleanup.
tig bc6c94c
Enhance Link design mode with tooltip on initialization
tig 0d8b7c5
Fixed double OpenUrl on mouse.
tig 56cb119
Merge branch 'v2_develop' into fix/show-link-url-on-enter
tig File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
|
|
||
| namespace Terminal.Gui.App; | ||
|
|
||
| /// <summary> | ||
| /// Provides extension methods for associating tooltips with views in a Terminal.Gui application. | ||
| /// </summary> | ||
| /// <remarks>These extension methods enable developers to attach or remove tooltips from any View instance. | ||
| /// Tooltips can be specified as static text, dynamically generated text, or as a custom View for advanced scenarios. | ||
| /// Tooltips enhance user experience by providing contextual information when users interact with UI elements.</remarks> | ||
| public static class ToolTipExtensions | ||
| { | ||
| /// <summary> | ||
| /// Associates a tooltip with the specified view, displaying the provided text when the user hovers over or focuses | ||
| /// on the view. | ||
| /// </summary> | ||
| /// <remarks>If a tooltip is already set for the view, this method replaces it with the new text. Tooltips | ||
| /// provide additional context or guidance to users interacting with the UI element.</remarks> | ||
| /// <param name="view">The view to which the tooltip will be attached. Cannot be null.</param> | ||
| /// <param name="text">The text to display in the tooltip. If null or empty, no tooltip will be shown.</param> | ||
| public static void SetToolTip (this View view, string text) | ||
| { | ||
| ArgumentNullException.ThrowIfNull (view); | ||
|
ccoulioufr marked this conversation as resolved.
Outdated
|
||
| TooltipManager.Instance.SetToolTip (view, new ToolTipProvider (text)); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Associates a dynamic tooltip with the specified view using a factory function to generate the tooltip text. | ||
| /// </summary> | ||
| /// <remarks>Use this method to provide tooltips that can change dynamically based on application state or | ||
| /// user interaction. The tooltip text is evaluated at the time the tooltip is displayed, allowing for | ||
| /// context-sensitive information.</remarks> | ||
| /// <param name="view">The view to which the tooltip will be attached. Cannot be null.</param> | ||
| /// <param name="textFactory">A function that returns the tooltip text to display. This function is invoked each time the tooltip is shown. | ||
| /// Cannot be null.</param> | ||
| public static void SetToolTip (this View view, Func<string> textFactory) | ||
| { | ||
| ArgumentNullException.ThrowIfNull (view); | ||
| ArgumentNullException.ThrowIfNull (textFactory); | ||
| TooltipManager.Instance.SetToolTip (view, new ToolTipProvider (textFactory)); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Associates a dynamic tooltip with the specified view using a factory function to generate the tooltip content. | ||
| /// </summary> | ||
| /// <remarks>The tooltip content is generated each time the tooltip is shown by invoking the provided | ||
| /// factory function. This allows the tooltip to reflect dynamic or context-sensitive information.</remarks> | ||
| /// <param name="view">The view to which the tooltip will be attached. Cannot be null.</param> | ||
| /// <param name="contentFactory">A function that returns the content view to display as the tooltip. Cannot be null.</param> | ||
| public static void SetToolTip (this View view, Func<View> contentFactory) | ||
| { | ||
| ArgumentNullException.ThrowIfNull (view); | ||
| ArgumentNullException.ThrowIfNull (contentFactory); | ||
| TooltipManager.Instance.SetToolTip (view, new ToolTipProvider (contentFactory)); | ||
| } | ||
|
|
||
| /// <summary> | ||
| /// Removes the tooltip associated with the specified view, if one exists. | ||
| /// </summary> | ||
| /// <remarks>If the specified view does not have an associated tooltip, this method has no | ||
| /// effect.</remarks> | ||
| /// <param name="view">The view from which to remove the tooltip. Cannot be null.</param> | ||
| public static void RemoveToolTip (this View view) | ||
| { | ||
| ArgumentNullException.ThrowIfNull (view); | ||
| TooltipManager.Instance.RemoveTooltip (view); | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.