focus entry on opening sideleft

This commit is contained in:
end-4
2024-03-24 09:09:19 +07:00
parent 29a067a492
commit 3e7fe73543
3 changed files with 6 additions and 2 deletions
+1 -1
View File
@@ -348,7 +348,7 @@ export const booruView = Scrollable({
// Always scroll to bottom with new content // Always scroll to bottom with new content
const adjustment = scrolledWindow.get_vadjustment(); const adjustment = scrolledWindow.get_vadjustment();
adjustment.connect("changed", () => { adjustment.connect("changed", () => {
if(!chatEntry.hasFocus) return; if (!chatEntry.hasFocus) return;
adjustment.set_value(adjustment.get_upper() - adjustment.get_page_size()); adjustment.set_value(adjustment.get_upper() - adjustment.get_page_size());
}) })
} }
@@ -75,6 +75,11 @@ export const chatEntry = TextView({
acceptsTab: false, acceptsTab: false,
className: 'sidebar-chat-entry txt txt-smallie', className: 'sidebar-chat-entry txt txt-smallie',
setup: (self) => self setup: (self) => self
.hook(App, (self, currentName, visible) => {
if (visible && currentName === 'sideleft') {
self.grab_focus();
}
})
.hook(GPTService, (self) => { .hook(GPTService, (self) => {
if (APIS[currentApiId].name != 'Assistant (GPTs)') return; if (APIS[currentApiId].name != 'Assistant (GPTs)') return;
self.placeholderText = (GPTService.key.length > 0 ? 'Message the model...' : 'Enter API Key...'); self.placeholderText = (GPTService.key.length > 0 ? 'Message the model...' : 'Enter API Key...');
-1
View File
@@ -26,4 +26,3 @@ else
wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$(slurp)" & disown wf-recorder --pixel-format yuv420p -f './recording_'"$(getdate)"'.mp4' -t --geometry "$(slurp)" & disown
fi fi
fi fi