oc-tweaks 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -552,13 +552,13 @@ function calculatePosition(slotIndex, config) {
|
|
|
552
552
|
const height = config.height;
|
|
553
553
|
const gap = config.gap ?? 12;
|
|
554
554
|
const margin = config.screenMargin ?? 20;
|
|
555
|
-
const screenLeftExpr = typeof config.screenLeft === "number" ? `${config.screenLeft}` : "(
|
|
556
|
-
const screenTopExpr = typeof config.screenTop === "number" ? `${config.screenTop}` : "(
|
|
557
|
-
const
|
|
558
|
-
const
|
|
559
|
-
const leftExpr = `(${
|
|
555
|
+
const screenLeftExpr = typeof config.screenLeft === "number" ? `${config.screenLeft}` : "($targetScreen.Left)";
|
|
556
|
+
const screenTopExpr = typeof config.screenTop === "number" ? `${config.screenTop}` : "($targetScreen.Top)";
|
|
557
|
+
const screenRightExpr = typeof config.screenWidth === "number" ? `(${screenLeftExpr} + ${config.screenWidth})` : "($targetScreen.Right)";
|
|
558
|
+
const screenBottomExpr = typeof config.screenHeight === "number" ? `(${screenTopExpr} + ${config.screenHeight})` : "($targetScreen.Bottom)";
|
|
559
|
+
const leftExpr = `(${screenRightExpr} - ${width} - ${margin})`;
|
|
560
560
|
if (position === "bottom-right") {
|
|
561
|
-
const topExpr2 = `(${
|
|
561
|
+
const topExpr2 = `(${screenBottomExpr} - ${margin} - ((${slotIndex} + 1) * (${height} + ${gap})))`;
|
|
562
562
|
return {
|
|
563
563
|
startupLocation: "Manual",
|
|
564
564
|
leftExpr,
|
|
@@ -716,6 +716,7 @@ async function runWpfNotification($, shellCommand, title, message, tag, style, p
|
|
|
716
716
|
"Add-Type -AssemblyName PresentationCore",
|
|
717
717
|
"Add-Type -AssemblyName WindowsBase",
|
|
718
718
|
"Add-Type -AssemblyName System.Windows.Forms",
|
|
719
|
+
"$targetScreen = [System.Windows.Forms.Screen]::FromPoint([System.Windows.Forms.Cursor]::Position).WorkingArea",
|
|
719
720
|
"",
|
|
720
721
|
"Add-Type -TypeDefinition @'",
|
|
721
722
|
"using System;",
|