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

Add highlighted overlay for webview2, #99

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tofuandeve
Copy link
Collaborator

Adding works on Win32 sample app for both visual hosting and windowed hosting mode

Wv2Utils-FHL-overlay.mp4

…r both visual hosting and windowed hosting mode
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:wv2util"
mc:Ignorable="d"
Title="Overlay" Height="450" Width="800" WindowStyle="None" AllowsTransparency="True" Opacity="0.25" ResizeMode="NoResize" ShowInTaskbar="False" Topmost="False" Focusable="False" IsHitTestVisible="False" IsTabStop="False" Background="#FF84B9FF" MouseUp="Window_MouseUp">
Copy link
Owner

Choose a reason for hiding this comment

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

The blue color is maybe too nice looking and can be hard to tell its actually not part of the web content. How about changing the color to orange and is it practical to add a darker orange border around the edge?


private void UpdateOverlayToMatchTarget()
{
/*
Copy link
Owner

Choose a reason for hiding this comment

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

Is this commented out code still useful? We should either uncomment and fix the code or remove the comment.

{
PInvoke.User32.SetWindowPos(m_thisHwnd, prevTargetHwnd, 0, 0, 0, 0,
PInvoke.User32.SetWindowPosFlags.SWP_NOSIZE |
PInvoke.User32.SetWindowPosFlags.SWP_NOMOVE);
Copy link
Owner

Choose a reason for hiding this comment

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

In the video in the PR description the blue highlight window is in the correct location but its above the webview2utilities window. This code looks like it wants to change the z-order to be just above the webview2 window which I would think should be below the webview2utilities top level window?

UpdateOverlayToMatchTarget();
this.ShowActivated = false;

m_checkForUpdatesTimer = new Timer(500);
Copy link
Owner

Choose a reason for hiding this comment

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

In the PR video it looks like the highlight disappears quickly after clicking on the host app entry. We probably want to leave the overlay up as long as the host app entry is selected - or at least have it last a while longer before fading out.

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.

2 participants