Skip to content

Commit 062c686

Browse files
committed
remove CanShowToolbar, that doesn't work either
1 parent c488575 commit 062c686

1 file changed

Lines changed: 8 additions & 28 deletions

File tree

FlashpointSecurePlayer/WebBrowserMode.cs

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,6 @@
1818

1919
namespace FlashpointSecurePlayer {
2020
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-
3921
private readonly HookProc lowLevelMouseProc;
4022
private IntPtr mouseHook = IntPtr.Zero;
4123

@@ -473,7 +455,7 @@ private void ShowToolbar() {
473455
// mouse in toolbar rectangle
474456
// if in fullscreen, show toolbar if we can
475457
// if not in fullscreen, ensure toolbar is visible
476-
toolBarToolStrip.Visible = CanShowToolbar || !Fullscreen;
458+
toolBarToolStrip.Visible = CanFocus || !Fullscreen;
477459
}
478460
}
479461
}
@@ -718,21 +700,19 @@ private void WebBrowserMode_FormClosing(object sender, FormClosingEventArgs e) {
718700
// I was spending too much time trying to fix it for a non-essential feature of the program
719701
// so I've gotten rid of it for the default behaviour instead
720702
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;
725705
}
706+
707+
Application.AddMessageFilter(messageFilter);
726708
}
727709

728710
private void WebBrowserMode_Deactivate(object sender, EventArgs e) {
729-
if (messageFilter != null) {
730-
Application.RemoveMessageFilter(messageFilter);
711+
if (messageFilter == null) {
712+
return;
731713
}
732714

733-
if (!CanFocus) {
734-
CanShowToolbar = false;
735-
}
715+
Application.RemoveMessageFilter(messageFilter);
736716
}
737717

738718
private void closableWebBrowser_Navigated(object sender, WebBrowserNavigatedEventArgs e) {

0 commit comments

Comments
 (0)