forked from Shinonome/dots-hyprland
sidebar: corner triggers open only when reaching thru vertical edge
This commit is contained in:
@@ -425,10 +425,11 @@ Singleton {
|
|||||||
property bool bottom: false
|
property bool bottom: false
|
||||||
property bool valueScroll: true
|
property bool valueScroll: true
|
||||||
property bool clickless: false
|
property bool clickless: false
|
||||||
property real cornerRegionWidth: 250
|
property int cornerRegionWidth: 250
|
||||||
property real cornerRegionHeight: 2
|
property int cornerRegionHeight: 5
|
||||||
property bool visualize: false
|
property bool visualize: false
|
||||||
property bool clicklessCornerEnd: true
|
property bool clicklessCornerEnd: true
|
||||||
|
property int clicklessCornerVerticalOffset: 1
|
||||||
}
|
}
|
||||||
|
|
||||||
property JsonObject quickToggles: JsonObject {
|
property JsonObject quickToggles: JsonObject {
|
||||||
|
|||||||
@@ -79,10 +79,12 @@ Scope {
|
|||||||
implicitWidth: Config.options.sidebar.cornerOpen.cornerRegionWidth
|
implicitWidth: Config.options.sidebar.cornerOpen.cornerRegionWidth
|
||||||
implicitHeight: Config.options.sidebar.cornerOpen.cornerRegionHeight
|
implicitHeight: Config.options.sidebar.cornerOpen.cornerRegionHeight
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
onMouseXChanged: {
|
onPositionChanged: {
|
||||||
if (!Config.options.sidebar.cornerOpen.clicklessCornerEnd) return;
|
if (!Config.options.sidebar.cornerOpen.clicklessCornerEnd) return;
|
||||||
if ((cornerWidget.isRight && mouseArea.mouseX >= mouseArea.width - 2)
|
const verticalOffset = Config.options.sidebar.cornerOpen.clicklessCornerVerticalOffset;
|
||||||
|| (cornerWidget.isLeft && mouseArea.mouseX <= 2))
|
const correctX = (cornerWidget.isRight && mouseArea.mouseX >= mouseArea.width - 2) || (cornerWidget.isLeft && mouseArea.mouseX <= 2);
|
||||||
|
const correctY = (cornerWidget.isTop && mouseArea.mouseY > verticalOffset || cornerWidget.isBottom && mouseArea.mouseY < mouseArea.height - verticalOffset);
|
||||||
|
if (correctX && correctY)
|
||||||
screenCorners.actionForCorner[cornerPanelWindow.corner]();
|
screenCorners.actionForCorner[cornerPanelWindow.corner]();
|
||||||
}
|
}
|
||||||
onEntered: {
|
onEntered: {
|
||||||
|
|||||||
@@ -787,22 +787,22 @@ ContentPage {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ConfigSwitch {
|
||||||
|
buttonIcon: "highlight_mouse_cursor"
|
||||||
|
text: Translation.tr("Hover to trigger")
|
||||||
|
checked: Config.options.sidebar.cornerOpen.clickless
|
||||||
|
onCheckedChanged: {
|
||||||
|
Config.options.sidebar.cornerOpen.clickless = checked;
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledToolTip {
|
||||||
|
text: Translation.tr("When this is off you'll have to click")
|
||||||
|
}
|
||||||
|
}
|
||||||
Row {
|
Row {
|
||||||
ConfigSwitch {
|
|
||||||
buttonIcon: "highlight_mouse_cursor"
|
|
||||||
text: Translation.tr("Hover to trigger")
|
|
||||||
checked: Config.options.sidebar.cornerOpen.clickless
|
|
||||||
onCheckedChanged: {
|
|
||||||
Config.options.sidebar.cornerOpen.clickless = checked;
|
|
||||||
}
|
|
||||||
|
|
||||||
StyledToolTip {
|
|
||||||
text: Translation.tr("When this is off you'll have to click")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ConfigSwitch {
|
ConfigSwitch {
|
||||||
enabled: !Config.options.sidebar.cornerOpen.clickless
|
enabled: !Config.options.sidebar.cornerOpen.clickless
|
||||||
text: Translation.tr("but force at absolute corner")
|
text: Translation.tr("Force hover open at absolute corner")
|
||||||
checked: Config.options.sidebar.cornerOpen.clicklessCornerEnd
|
checked: Config.options.sidebar.cornerOpen.clicklessCornerEnd
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
Config.options.sidebar.cornerOpen.clicklessCornerEnd = checked;
|
Config.options.sidebar.cornerOpen.clicklessCornerEnd = checked;
|
||||||
@@ -812,7 +812,29 @@ ContentPage {
|
|||||||
text: Translation.tr("When the previous option is off and this is on,\nyou can still hover the corner's end to open sidebar,\nand the remaining area can be used for volume/brightness scroll")
|
text: Translation.tr("When the previous option is off and this is on,\nyou can still hover the corner's end to open sidebar,\nand the remaining area can be used for volume/brightness scroll")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ConfigSpinBox {
|
||||||
|
icon: "arrow_cool_down"
|
||||||
|
text: Translation.tr("with vertical offset")
|
||||||
|
value: Config.options.sidebar.cornerOpen.clicklessCornerVerticalOffset
|
||||||
|
from: 0
|
||||||
|
to: 20
|
||||||
|
stepSize: 1
|
||||||
|
onValueChanged: {
|
||||||
|
Config.options.sidebar.cornerOpen.clicklessCornerVerticalOffset = value;
|
||||||
|
}
|
||||||
|
MouseArea {
|
||||||
|
id: mouseArea
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
acceptedButtons: Qt.NoButton
|
||||||
|
StyledToolTip {
|
||||||
|
extraVisibleCondition: mouseArea.containsMouse
|
||||||
|
text: Translation.tr("Why this is cool:\nFor non-0 values, it won't trigger when you reach the\nscreen corner along the horizontal edge, but it will when\nyou do along the vertical edge")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ConfigRow {
|
ConfigRow {
|
||||||
uniform: true
|
uniform: true
|
||||||
ConfigSwitch {
|
ConfigSwitch {
|
||||||
|
|||||||
Reference in New Issue
Block a user