MCPcopy
hub / github.com/CopyTranslator/CopyTranslator / onEdge

Method onEdge

src/main/views/manager.ts:220–239  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

218 }
219
220 onEdge(): HideDirection {
221 const window = this.mainWindow;
222 if (!this.controller.get("autoHide")) {
223 return "None";
224 }
225 let bound = window.getBounds();
226 let { x, y, width } = bound;
227 const { x: xBound, width: screenWidth } = screen.getDisplayMatching(
228 bound
229 ).bounds;
230 x -= xBound;
231 let xEnd = x + width;
232
233 if (x <= 0) return "Left";
234 if (xEnd >= screenWidth) {
235 return "Right";
236 }
237 if (y <= 0) return "Up";
238 return "None";
239 }
240
241 showWindow() {
242 const window = this.mainWindow;

Callers 1

createMainMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected