forked from Shinonome/dots-hyprland
overview: fix clipboard and emoji keybinds
This commit is contained in:
@@ -16,9 +16,9 @@ Scope {
|
|||||||
property bool dontAutoCancelSearch: false
|
property bool dontAutoCancelSearch: false
|
||||||
|
|
||||||
PanelWindow {
|
PanelWindow {
|
||||||
id: root
|
id: panelWindow
|
||||||
property string searchingText: ""
|
property string searchingText: ""
|
||||||
readonly property HyprlandMonitor monitor: Hyprland.monitorFor(root.screen)
|
readonly property HyprlandMonitor monitor: Hyprland.monitorFor(panelWindow.screen)
|
||||||
property bool monitorIsFocused: (Hyprland.focusedMonitor?.id == monitor?.id)
|
property bool monitorIsFocused: (Hyprland.focusedMonitor?.id == monitor?.id)
|
||||||
visible: GlobalStates.overviewOpen
|
visible: GlobalStates.overviewOpen
|
||||||
|
|
||||||
@@ -40,8 +40,8 @@ Scope {
|
|||||||
|
|
||||||
HyprlandFocusGrab {
|
HyprlandFocusGrab {
|
||||||
id: grab
|
id: grab
|
||||||
windows: [root]
|
windows: [panelWindow]
|
||||||
property bool canBeActive: root.monitorIsFocused
|
property bool canBeActive: panelWindow.monitorIsFocused
|
||||||
active: false
|
active: false
|
||||||
onCleared: () => {
|
onCleared: () => {
|
||||||
if (!active)
|
if (!active)
|
||||||
@@ -96,10 +96,10 @@ Scope {
|
|||||||
if (event.key === Qt.Key_Escape) {
|
if (event.key === Qt.Key_Escape) {
|
||||||
GlobalStates.overviewOpen = false;
|
GlobalStates.overviewOpen = false;
|
||||||
} else if (event.key === Qt.Key_Left) {
|
} else if (event.key === Qt.Key_Left) {
|
||||||
if (!root.searchingText)
|
if (!panelWindow.searchingText)
|
||||||
Hyprland.dispatch("workspace r-1");
|
Hyprland.dispatch("workspace r-1");
|
||||||
} else if (event.key === Qt.Key_Right) {
|
} else if (event.key === Qt.Key_Right) {
|
||||||
if (!root.searchingText)
|
if (!panelWindow.searchingText)
|
||||||
Hyprland.dispatch("workspace r+1");
|
Hyprland.dispatch("workspace r+1");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -108,7 +108,7 @@ Scope {
|
|||||||
id: searchWidget
|
id: searchWidget
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
Synchronizer on searchingText {
|
Synchronizer on searchingText {
|
||||||
property alias source: root.searchingText
|
property alias source: panelWindow.searchingText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,8 +117,8 @@ Scope {
|
|||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
active: GlobalStates.overviewOpen && (Config?.options.overview.enable ?? true)
|
active: GlobalStates.overviewOpen && (Config?.options.overview.enable ?? true)
|
||||||
sourceComponent: OverviewWidget {
|
sourceComponent: OverviewWidget {
|
||||||
screen: root.screen
|
screen: panelWindow.screen
|
||||||
visible: (root.searchingText == "")
|
visible: (panelWindow.searchingText == "")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -129,15 +129,9 @@ Scope {
|
|||||||
GlobalStates.overviewOpen = false;
|
GlobalStates.overviewOpen = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (let i = 0; i < overviewVariants.instances.length; i++) {
|
overviewScope.dontAutoCancelSearch = true;
|
||||||
let panelWindow = overviewVariants.instances[i];
|
panelWindow.setSearchingText(Config.options.search.prefix.clipboard);
|
||||||
if (panelWindow.modelData.name == Hyprland.focusedMonitor.name) {
|
GlobalStates.overviewOpen = true;
|
||||||
overviewScope.dontAutoCancelSearch = true;
|
|
||||||
panelWindow.setSearchingText(Config.options.search.prefix.clipboard);
|
|
||||||
GlobalStates.overviewOpen = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleEmojis() {
|
function toggleEmojis() {
|
||||||
@@ -145,15 +139,9 @@ Scope {
|
|||||||
GlobalStates.overviewOpen = false;
|
GlobalStates.overviewOpen = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (let i = 0; i < overviewVariants.instances.length; i++) {
|
overviewScope.dontAutoCancelSearch = true;
|
||||||
let panelWindow = overviewVariants.instances[i];
|
panelWindow.setSearchingText(Config.options.search.prefix.emojis);
|
||||||
if (panelWindow.modelData.name == Hyprland.focusedMonitor.name) {
|
GlobalStates.overviewOpen = true;
|
||||||
overviewScope.dontAutoCancelSearch = true;
|
|
||||||
panelWindow.setSearchingText(Config.options.search.prefix.emojis);
|
|
||||||
GlobalStates.overviewOpen = true;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IpcHandler {
|
IpcHandler {
|
||||||
|
|||||||
Reference in New Issue
Block a user