VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/src/Main/Forms/MainFrame.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Main/Forms/MainFrame.h')
-rw-r--r--src/Main/Forms/MainFrame.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/Main/Forms/MainFrame.h b/src/Main/Forms/MainFrame.h
index 39c411ad..b8991b73 100644
--- a/src/Main/Forms/MainFrame.h
+++ b/src/Main/Forms/MainFrame.h
@@ -15,6 +15,7 @@
#include "Forms.h"
#include "ChangePasswordDialog.h"
+#include <wx/display.h>
namespace VeraCrypt
{
@@ -161,6 +162,26 @@ namespace VeraCrypt
void UpdateVolumeList ();
void UpdateWipeCacheButton ();
void WipeCache ();
+
+ void EnsureVisible()
+ {
+ wxDisplay display (this);
+ wxRect displayRect = display.GetClientArea();
+
+ bool bMove = false;
+ wxPoint p = GetScreenPosition();
+ wxRect r = GetRect ();
+ if (p.x < displayRect.x)
+ p.x = 0, bMove = true;
+ if (p.y < displayRect.y)
+ p.y = displayRect.y, bMove = true;
+ if (p.x + r.width > displayRect.x + displayRect.width)
+ p.x = displayRect.x + displayRect.width - r.width, bMove = true;
+ if (p.y + r.height > displayRect.y + displayRect.height)
+ p.y = displayRect.y + displayRect.height - r.height, bMove = true;
+ if (bMove)
+ Move (p);
+ }
struct VolumeActivityMapEntry
{