diff options
Diffstat (limited to 'src/Main/Forms/MainFrame.h')
-rw-r--r-- | src/Main/Forms/MainFrame.h | 21 |
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 @@ | |||
15 | 15 | ||
16 | #include "Forms.h" | 16 | #include "Forms.h" |
17 | #include "ChangePasswordDialog.h" | 17 | #include "ChangePasswordDialog.h" |
18 | #include <wx/display.h> | ||
18 | 19 | ||
19 | namespace VeraCrypt | 20 | namespace VeraCrypt |
20 | { | 21 | { |
@@ -161,6 +162,26 @@ namespace VeraCrypt | |||
161 | void UpdateVolumeList (); | 162 | void UpdateVolumeList (); |
162 | void UpdateWipeCacheButton (); | 163 | void UpdateWipeCacheButton (); |
163 | void WipeCache (); | 164 | void WipeCache (); |
165 | |||
166 | void EnsureVisible() | ||
167 | { | ||
168 | wxDisplay display (this); | ||
169 | wxRect displayRect = display.GetClientArea(); | ||
170 | |||
171 | bool bMove = false; | ||
172 | wxPoint p = GetScreenPosition(); | ||
173 | wxRect r = GetRect (); | ||
174 | if (p.x < displayRect.x) | ||
175 | p.x = 0, bMove = true; | ||
176 | if (p.y < displayRect.y) | ||
177 | p.y = displayRect.y, bMove = true; | ||
178 | if (p.x + r.width > displayRect.x + displayRect.width) | ||
179 | p.x = displayRect.x + displayRect.width - r.width, bMove = true; | ||
180 | if (p.y + r.height > displayRect.y + displayRect.height) | ||
181 | p.y = displayRect.y + displayRect.height - r.height, bMove = true; | ||
182 | if (bMove) | ||
183 | Move (p); | ||
184 | } | ||
164 | 185 | ||
165 | struct VolumeActivityMapEntry | 186 | struct VolumeActivityMapEntry |
166 | { | 187 | { |