Skip to content
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

Remove false comment regarding ColorSettingsPage #9073

Merged
merged 2 commits into from Apr 15, 2021
Merged

Remove false comment regarding ColorSettingsPage #9073

merged 2 commits into from Apr 15, 2021

Conversation

NikolayXHD
Copy link
Member

@NikolayXHD NikolayXHD commented Apr 14, 2021

Some time ago the event handlers from ColorsSettingsPage.cs were lost by mistake.

Before knowing that, I misinterpreted what was going on, which lead me to writing this

Here I revert that unnecessary complication, as well as the factually incorrect comment I wrote to explain it.

Test

Tested manually and with unit tests


✒️ I contribute this code under The Developer Certificate of Origin.

@ghost ghost assigned NikolayXHD Apr 14, 2021
@NikolayXHD NikolayXHD requested a review from a user April 14, 2021 14:07
@pmiossec
Copy link
Member

Some time ago the event handlers from ColorsSettingsPage.cs were lost by mistake.

@NikolayXHD Really sorry for the mistake...

@NikolayXHD
Copy link
Member Author

NikolayXHD commented Apr 14, 2021

Some time ago the event handlers from ColorsSettingsPage.cs were lost by mistake.

@NikolayXHD Really sorry for the mistake...

No problem, I myself lost code in .designer.cs multiple times. Me putting events in .designer.cs file was poor design encouraged by WinForms editor.

Copy link
Member

@mstv mstv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just nits.

Comment on lines 25 to 28
public bool SettingsAreModified =>
_page.SelectedThemeId != ThemeModule.Settings.Theme.Id ||
_page.UseSystemVisualStyle != ThemeModule.Settings.UseSystemVisualStyle ||
!_page.SelectedThemeVariations.SequenceEqual(AppSettings.ThemeVariations);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Support left-reading, please:

Suggested change
public bool SettingsAreModified =>
_page.SelectedThemeId != ThemeModule.Settings.Theme.Id ||
_page.UseSystemVisualStyle != ThemeModule.Settings.UseSystemVisualStyle ||
!_page.SelectedThemeVariations.SequenceEqual(AppSettings.ThemeVariations);
public bool SettingsAreModified =>
_page.SelectedThemeId != ThemeModule.Settings.Theme.Id
|| _page.UseSystemVisualStyle != ThemeModule.Settings.UseSystemVisualStyle
|| !_page.SelectedThemeVariations.SequenceEqual(AppSettings.ThemeVariations);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -11,6 +11,8 @@ namespace GitUI.Theming
{
public static class ThemeModule
{
private static bool _suppressWin32Hooks;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd add documention like /// To be activated by the TestAccessor only.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed variable to indicate test-only scope

Copy link
Member

@gerhardol gerhardol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1
The changes in the actual code seem fine.
Have only briefly looked at the changed tests. Seem fine, no deeper investigation.
Have not run.

GitUI/Theming/ThemeModule.cs Outdated Show resolved Hide resolved
@NikolayXHD NikolayXHD merged commit 3b3341c into gitextensions:master Apr 15, 2021
@ghost ghost added this to the 3.6 milestone Apr 15, 2021
@NikolayXHD NikolayXHD deleted the color_settings_page branch April 15, 2021 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants