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

Selected text in the Sharpen Results view is unreadable when the view loses focus #28

Closed
afrlan opened this issue Oct 11, 2019 · 4 comments

Comments

@afrlan
Copy link
Collaborator

afrlan commented Oct 11, 2019

"On my machine" double clicking an item goes to the referenced line in the code and makes selected text in Sharpen Results window unreadable. I haven't modified any display settings in Visual Studio.

Suggestion: verify that the contrast between background and text is sufficient and tweak accordingly.

image

@ironcev ironcev changed the title Double click on item in results window makes text unreadable Selected text in the Sharpen Results view is unreadable when the view loses focus Oct 12, 2019
@ironcev
Copy link
Member

ironcev commented Oct 12, 2019

The issue does not appear only on double click but in general when the Sharpen Results view loses focus with an item selected. Therefore I've renamed the issue.

@ironcev
Copy link
Member

ironcev commented Oct 12, 2019

@kurtanr's comment in Croatian:

Pogledao sam što zapravo koristi VisualStudio kao tree kontrolu u npr. SolutionExploreru.
Koriste Microsoft.Internal.VisualStudio.PlatformUI.PivotTreeView iz Microsoft.VisualStudio.Shell.15.0.dll.
U DLL-u je to javna klasa koja nasljeđuje Microsoft.Internal.VisualStudio.PlatformUI.VirtualizingTreeView javnu klasu.
No na netu je jako teško naći neke informacije o tim klasama i primjer njihova korištenja.
Zapravo, nisam uspio naći ni kreirati sample koji radi - uspješno sam bindao kolekciju itema na tree, no nodovi tree-a nisu vidljivi.
Dodatno, klik na nevidljivi node rezultira sa exceptionom u Microsoft.Internal.VisualStudio.PlatformUI.PivotTreeViewItem.SetupEnteringRenameMode (a nisam uspio pronaći kako reći nodeu da isključi rename).
U VS je DataContext PivotTreeViewItem klase Microsoft.Internal.VisualStudio.PlatformUI.VirtualizingTreeView+TreeNode, no TreeNode je interna klasa unutar VirtualizingTreeView, tako da je nije moguće izvana instancirati.
Uglavnom, bila je zgodna ideja, no mislim da odustajem od nje.

I also wouldn't go for PivotTreeView. It will just turn the theming/coloring issue we have now with other more serious.

When I was adding the tree view I struggled to get the styles/colors well and finally gave up with this issue. The regular WPF TreeView uses styles and colors defined by Visual Studio so that it automatically fits to the VS theme and also that it get changed when the VS theme changes.

Another possible approach would be not to use VS colors and themes but a similar one and get the whole control over tree view styles and to switch between a dark and white theme on our own. @tom-englert uses this approach in his excellent ResXResourceManager. I would like to stick to VS theming but I am also fine with Tom's approach.

@ironcev ironcev added the bug label Oct 12, 2019
@tom-englert
Copy link
Contributor

@ironcev The regular WPF controls do not follow the VS theme colors, except for foreground and background, which is introduced by these two lines in the root controls xaml file:

<UserControl
   ...
   Background="{DynamicResource {x:Static vsshell:VsBrushes.WindowKey}}"
   Foreground="{DynamicResource {x:Static vsshell:VsBrushes.WindowTextKey}}"

For simple controls this may be fine, but as soon as some control uses custom colors for e.g. highlighting, these are still the colors matching the system colors, not the VS colors. That's why you get this conflict here - foreground matches the VS dark theme, because its inherited, but the custom background is designed for the systems regular (light) them.
So to solve this, either give up theming by removing the two lines in the root control, or use custom themable styles for all your controls.

@tom-englert
Copy link
Contributor

Just realized that you already have explicitly styled the tree view, just these colors seem to be wrong. I'll have a look...

tom-englert added a commit to tom-englert/Sharpen that referenced this issue Oct 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants