forked from Shinonome/dots-hyprland
region selector: add selection padding to target regions
This commit is contained in:
@@ -377,6 +377,7 @@ Singleton {
|
||||
property bool showLabel: false
|
||||
property real opacity: 0.3
|
||||
property real contentRegionOpacity: 0.8
|
||||
property int selectionPadding: 5
|
||||
}
|
||||
property JsonObject rect: JsonObject {
|
||||
property bool showAimLines: true
|
||||
|
||||
@@ -121,10 +121,11 @@ PanelWindow {
|
||||
return (root.targetedRegionX >= 0 && root.targetedRegionY >= 0)
|
||||
}
|
||||
function setRegionToTargeted() {
|
||||
root.regionX = root.targetedRegionX;
|
||||
root.regionY = root.targetedRegionY;
|
||||
root.regionWidth = root.targetedRegionWidth;
|
||||
root.regionHeight = root.targetedRegionHeight;
|
||||
const padding = Config.options.regionSelector.targetRegions.selectionPadding; // Make borders not cut off n stuff
|
||||
root.regionX = root.targetedRegionX - padding;
|
||||
root.regionY = root.targetedRegionY - padding;
|
||||
root.regionWidth = root.targetedRegionWidth + padding * 2;
|
||||
root.regionHeight = root.targetedRegionHeight + padding * 2;
|
||||
}
|
||||
|
||||
function updateTargetedRegion(x, y) {
|
||||
|
||||
Reference in New Issue
Block a user