forked from Shinonome/dots-hyprland
sidebar: add option for hover open at end of hover region
This commit is contained in:
@@ -388,9 +388,10 @@ Singleton {
|
||||
property bool bottom: false
|
||||
property bool valueScroll: true
|
||||
property bool clickless: false
|
||||
property real cornerRegionWidth: 60
|
||||
property real cornerRegionWidth: 250
|
||||
property real cornerRegionHeight: 2
|
||||
property bool visualize: false
|
||||
property bool clicklessCornerEnd: true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,9 +76,16 @@ Scope {
|
||||
}
|
||||
|
||||
sourceComponent: FocusedScrollMouseArea {
|
||||
id: mouseArea
|
||||
implicitWidth: Config.options.sidebar.cornerOpen.cornerRegionWidth
|
||||
implicitHeight: Config.options.sidebar.cornerOpen.cornerRegionHeight
|
||||
hoverEnabled: true
|
||||
onMouseXChanged: {
|
||||
if (!Config.options.sidebar.cornerOpen.clicklessCornerEnd) return;
|
||||
if ((cornerWidget.isRight && mouseArea.mouseX >= mouseArea.width - 2)
|
||||
|| (cornerWidget.isLeft && mouseArea.mouseX <= 2))
|
||||
screenCorners.actionForCorner[cornerPanelWindow.corner]();
|
||||
}
|
||||
onEntered: {
|
||||
if (Config.options.sidebar.cornerOpen.clickless)
|
||||
screenCorners.actionForCorner[cornerPanelWindow.corner]();
|
||||
|
||||
@@ -612,6 +612,8 @@ ContentPage {
|
||||
Config.options.sidebar.cornerOpen.enable = checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
Row {
|
||||
ConfigSwitch {
|
||||
buttonIcon: "highlight_mouse_cursor"
|
||||
text: Translation.tr("Hover to trigger")
|
||||
@@ -624,6 +626,18 @@ ContentPage {
|
||||
text: Translation.tr("When this is off you'll have to click")
|
||||
}
|
||||
}
|
||||
ConfigSwitch {
|
||||
enabled: !Config.options.sidebar.cornerOpen.clickless
|
||||
text: Translation.tr("but force at absolute corner")
|
||||
checked: Config.options.sidebar.cornerOpen.clicklessCornerEnd
|
||||
onCheckedChanged: {
|
||||
Config.options.sidebar.cornerOpen.clicklessCornerEnd = checked;
|
||||
}
|
||||
|
||||
StyledToolTip {
|
||||
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")
|
||||
}
|
||||
}
|
||||
}
|
||||
ConfigRow {
|
||||
uniform: true
|
||||
|
||||
Reference in New Issue
Block a user