-
Notifications
You must be signed in to change notification settings - Fork 779
Adds 'Link' View providing OSC 8 Hyperlink Support
#4741
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
Closed
Closed
Changes from 2 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
a753d0c
links with tests
ccoulioufr 5e30891
Merge branch 'v2_develop' into v2_develop
tig 26f56b1
Merge branch 'v2_develop' into v2_develop
tig 474573a
Merge branch 'v2_develop' into v2_develop
tig 0e0df72
Merge branch 'v2_develop' into v2_develop
tig ba9bca5
Merge branch 'v2_develop' into v2_develop
ccoulioufr fac8853
Update Terminal.Gui/Views/Link.cs
ccoulioufr 7888860
Update Terminal.Gui/Views/Link.cs
ccoulioufr 7986d8b
explicit type declarations in tests
ccoulioufr e5c065c
Merge branch 'v2_develop' of https://github.com/ccoulioufr/Terminal.G…
ccoulioufr 9977b43
using Cancellable Work Pattern recommandations
ccoulioufr 7deb8ae
events testing
ccoulioufr 4852380
Merge branch 'v2_develop' into v2_develop
tig 34224c2
uicatalog url indicator + no crash Uri
ccoulioufr e887832
Merge branch 'v2_develop' of https://github.com/ccoulioufr/Terminal.G…
ccoulioufr d45b0a6
fix scenario test
ccoulioufr 2b074bd
Link Osc8 test
ccoulioufr 0ecfcdd
bad url is now has no effect and is o
ccoulioufr 5481454
Url validation in Link class
ccoulioufr ba38682
Merge branch 'v2_develop' into v2_develop
tig b8db53e
fix link test scheme color
ccoulioufr d436c0e
Merge branch 'v2_develop' into v2_develop
tig 6a66717
Merge branch 'v2_develop' into v2_develop
tig 52463a6
no url in cell + SetNeedsDraw on url change + empty default url + up…
ccoulioufr cb4b3a2
Merge branch 'v2_develop' of https://github.com/ccoulioufr/Terminal.G…
ccoulioufr 30f0348
Merge branch 'v2_develop' into v2_develop
ccoulioufr 50f627f
Merge branch 'gui-cs:v2_develop' into v2_develop
ccoulioufr 1e55338
Merge branch 'v2_develop' into v2_develop
tig db81f44
Refactor Link control: API, UI, and platform integration
tig f42e548
Refactor Link: decouple Text/Title/Url, expand tests
tig abdb993
Improve Link API documentation
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,102 @@ | ||
| #nullable enable | ||
|
|
||
| namespace UICatalog.Scenarios; | ||
|
|
||
| [ScenarioMetadata ("Links", "Demonstrates how Links work.")] | ||
| [ScenarioCategory ("Controls")] | ||
| [ScenarioCategory ("Mouse and Keyboard")] | ||
| public class Links : Scenario | ||
| { | ||
| public override void Main () | ||
| { | ||
| ConfigurationManager.Enable (ConfigLocations.All); | ||
| using IApplication app = Application.Create (); | ||
| app.Init (); | ||
|
|
||
| using Window mainWindow = new () | ||
| { | ||
| Title = GetQuitKeyAndName () | ||
| }; | ||
|
|
||
| Label textLabel = new () | ||
| { | ||
| Text = "_Text:", | ||
| X = 1, | ||
| Y = 1 | ||
| }; | ||
| mainWindow.Add (textLabel); | ||
|
|
||
| TextField textField = new () | ||
| { | ||
| X = Pos.Right (textLabel) + 2, | ||
| Y = 1, | ||
| Width = 20 | ||
| }; | ||
| mainWindow.Add (textField); | ||
|
|
||
| Label urlLabel = new () | ||
| { | ||
| Text = "_Url:", | ||
| X = 1, | ||
| Y = Pos.Bottom (textField) + 1 | ||
| }; | ||
| mainWindow.Add (urlLabel); | ||
|
|
||
| TextField urlField = new () | ||
| { | ||
| X = Pos.Right (urlLabel) + 2, | ||
| Y = Pos.Bottom (textField) + 1, | ||
| Width = 64 | ||
| }; | ||
| mainWindow.Add (urlField); | ||
|
|
||
| Label simpleUrlLabel = new () | ||
| { | ||
| X = 1, | ||
| Y = Pos.Bottom (urlField) + 2 | ||
| }; | ||
| mainWindow.Add (simpleUrlLabel); | ||
|
|
||
| FrameView linkFrame = new () | ||
| { | ||
| Title = "_Link rendering", | ||
| X = 0, | ||
| Y = Pos.Bottom (simpleUrlLabel) + 2, | ||
| Width = 64, | ||
| Height = 8, | ||
| AssignHotKeys = true | ||
| }; | ||
|
|
||
| Link link = new () | ||
| { | ||
| X = 1, | ||
| Y = 1, | ||
| Height = 1, | ||
| Width = 64 | ||
| }; | ||
|
|
||
| link.UrlChanged += (s, e) => simpleUrlLabel.Text = link.Url; | ||
| textField.ValueChanged += (s, e) => link.Text = e.NewValue ?? link.Url; | ||
| urlField.ValueChanged += (s, e) => link.Url = e.NewValue ?? Link.DEFAULT_URL; | ||
| linkFrame.Add (link); | ||
|
|
||
| textField.Text = "GitHub repo"; | ||
| urlField.Text = "https://github.com/gui-cs/Terminal.Gui"; | ||
|
|
||
| Button copyButton = new () | ||
| { | ||
| Title = "_Copy", | ||
| X = Pos.Center (), | ||
| Y = Pos.Bottom (link) + 2, | ||
|
|
||
| }; | ||
| copyButton.Accepting += (s, e) => link.Copy (); | ||
|
|
||
| linkFrame.Add (copyButton); | ||
|
|
||
| mainWindow.Add (linkFrame); | ||
|
|
||
| app.Run (mainWindow); | ||
| } | ||
|
|
||
| } |
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
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
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.