|
18 | 18 |
|
19 | 19 | namespace FlashpointSecurePlayer { |
20 | 20 | public partial class WebBrowserMode : Form { |
21 | | - private bool canShowToolbar = true; |
22 | | - |
23 | | - private bool CanShowToolbar { |
24 | | - get { |
25 | | - return canShowToolbar; |
26 | | - } |
27 | | - |
28 | | - set { |
29 | | - canShowToolbar = value; |
30 | | - |
31 | | - if (canShowToolbar) { |
32 | | - ShowToolbar(); |
33 | | - } else { |
34 | | - toolBarToolStrip.Visible = !Fullscreen; |
35 | | - } |
36 | | - } |
37 | | - } |
38 | | - |
39 | 21 | private readonly HookProc lowLevelMouseProc; |
40 | 22 | private IntPtr mouseHook = IntPtr.Zero; |
41 | 23 |
|
@@ -473,7 +455,7 @@ private void ShowToolbar() { |
473 | 455 | // mouse in toolbar rectangle |
474 | 456 | // if in fullscreen, show toolbar if we can |
475 | 457 | // if not in fullscreen, ensure toolbar is visible |
476 | | - toolBarToolStrip.Visible = CanShowToolbar || !Fullscreen; |
| 458 | + toolBarToolStrip.Visible = CanFocus || !Fullscreen; |
477 | 459 | } |
478 | 460 | } |
479 | 461 | } |
@@ -718,21 +700,19 @@ private void WebBrowserMode_FormClosing(object sender, FormClosingEventArgs e) { |
718 | 700 | // I was spending too much time trying to fix it for a non-essential feature of the program |
719 | 701 | // so I've gotten rid of it for the default behaviour instead |
720 | 702 | private void WebBrowserMode_Activated(object sender, EventArgs e) { |
721 | | - CanShowToolbar = true; |
722 | | - |
723 | | - if (messageFilter != null) { |
724 | | - Application.AddMessageFilter(messageFilter); |
| 703 | + if (messageFilter == null) { |
| 704 | + return; |
725 | 705 | } |
| 706 | + |
| 707 | + Application.AddMessageFilter(messageFilter); |
726 | 708 | } |
727 | 709 |
|
728 | 710 | private void WebBrowserMode_Deactivate(object sender, EventArgs e) { |
729 | | - if (messageFilter != null) { |
730 | | - Application.RemoveMessageFilter(messageFilter); |
| 711 | + if (messageFilter == null) { |
| 712 | + return; |
731 | 713 | } |
732 | 714 |
|
733 | | - if (!CanFocus) { |
734 | | - CanShowToolbar = false; |
735 | | - } |
| 715 | + Application.RemoveMessageFilter(messageFilter); |
736 | 716 | } |
737 | 717 |
|
738 | 718 | private void closableWebBrowser_Navigated(object sender, WebBrowserNavigatedEventArgs e) { |
|
0 commit comments