Skip to content

Commit

Permalink
fix overwriting clipboard, weird LinkLabel style
Browse files Browse the repository at this point in the history
1. fix problem where running UI tests would not restore
    the clipboard's pre-test text
2. fix issue where going from dark to light theme
    would not restore LinkLabel colors to default
  • Loading branch information
molsonkiko committed Jan 14, 2024
1 parent 976a18f commit 5a47ef5
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 13 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,17 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### To Be Fixed

- Closing HTML/XML tags works inconsistently in Notepad++ v7.3.3.
- Make [TestRunner.cs](/NppCSharpPluginPack/Tests/TestRunner.cs) restore clipboard after tests.
- Fix styling of link labels. See DarkModeTestForm.

## [0.0.2] - (UNRELEASED) YYYY-MM-DD

### Changed

1. Fix docs to remove references to JsonTools.
1. Remove references and links to JsonTools (they now go to this project's GitHub repo).

### Fixed

1. [TestRunner.cs](/NppCSharpPluginPack/Tests/TestRunner.cs) now restores clipboard text after tests.
2. Link label text and background now correctly switches back to defaults when going from a dark theme to default styles.

## [0.0.1] - 2024-01-13

Expand Down
4 changes: 2 additions & 2 deletions NppCSharpPluginPack/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@
// Build Number
// Revision
//
[assembly: AssemblyVersion("0.0.1.1")]
[assembly: AssemblyFileVersion("0.0.1.1")]
[assembly: AssemblyVersion("0.0.1.2")]
[assembly: AssemblyFileVersion("0.0.1.2")]
2 changes: 2 additions & 0 deletions NppCSharpPluginPack/Tests/UserInterfaceTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ public static bool ExecuteFileManipulation(FileManipulation command, List<string
return true;
}
Main.selectionRememberingForm.CopySelectionsToStartEndsButton.PerformClick();
// need to do this, otherwise your clipboard will be overwritten
lastClipboardValue = Clipboard.GetText();
messages.Add("Copied selections to clipboard with selection remembering form");
break;
case FileManipulation.SaveSelectionsWithSelectionRememberingForm:
Expand Down
12 changes: 6 additions & 6 deletions NppCSharpPluginPack/Utils/FormStyle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ public static void ApplyStyle(Control ctrl, bool useNppStyle, bool darkMode = fa
child.BackColor = SystemColors.Window; // white background
child.ForeColor = SystemColors.WindowText;
}
else if (child is LinkLabel llbl)
{
llbl.LinkColor = Color.Blue;
llbl.ActiveLinkColor = Color.Red;
llbl.VisitedLinkColor = Color.Purple;
}
else if (child is DataGridView dgv)
{
dgv.EnableHeadersVisualStyles = true;
Expand All @@ -74,6 +68,12 @@ public static void ApplyStyle(Control ctrl, bool useNppStyle, bool darkMode = fa
// buttons should be a bit darker but everything else is the same color as the background
child.BackColor = (child is Button) ? SlightlyDarkControl : SystemColors.Control;
child.ForeColor = SystemColors.ControlText;
if (child is LinkLabel llbl)
{
llbl.LinkColor = Color.Blue;
llbl.ActiveLinkColor = Color.Red;
llbl.VisitedLinkColor = Color.Purple;
}
}
}
return;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Alternatively, you can follow these [installation instructions](https://npp-user

## System Requirements ##

This plugin is verified to work on versions of Notepad++ as old as [v7.3.3](https://notepad-plus-plus.org/downloads/v7.3.3/), but it has some bugs, mainly with HTML/XML tag matching.
This plugin is verified to work on versions of Notepad++ as old as [v7.3.3](https://notepad-plus-plus.org/downloads/v7.3.3/), but it may have some bugs ([see the CHANGELOG](/CHANGELOG.md) to see the what bugs may still exist).

It has also been tested and verified to work normally on the newest versions of Notepad++, [v8.6.1](https://notepad-plus-plus.org/downloads/v8.6.1/) and [v8.6.2 RC](https://community.notepad-plus-plus.org/topic/25341/notepad-v8-6-2-release-candidate/19).

Expand Down
2 changes: 1 addition & 1 deletion most recent errors.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Test results for CSharpPluginPack v0.0.1.1 on Notepad++ 8.5.8 64bit
Test results for CSharpPluginPack v0.0.1.2 on Notepad++ 8.5.8 64bit
NOTE: Ctrl-F (regular expressions *on*) for "Failed [1-9]\d*" to find all failed tests
No tests failed
=========================
Expand Down

0 comments on commit 5a47ef5

Please sign in to comment.