sideleft: booru: fix annoying scroll on tag hover

This commit is contained in:
end-4 2024-05-07 23:12:24 +07:00
parent 51f37f696f
commit 3bfb2dce67

View file

@ -19,31 +19,12 @@ const USER_CACHE_DIR = GLib.get_user_cache_dir();
Utils.exec(`bash -c 'mkdir -p ${USER_CACHE_DIR}/ags/media/waifus'`);
Utils.exec(`bash -c 'rm ${USER_CACHE_DIR}/ags/media/waifus/*'`);
const TagButton = (command) => {
const plusSign = Revealer({
transition: 'slide_right',
revealChild: false,
className: 'margin-right-5',
child: Label({
label: '+',
})
});
return Button({
className: 'sidebar-chat-chip sidebar-chat-chip-action txt txt-small',
onClicked: () => { chatEntry.buffer.text += `${command} ` },
onHover: () => plusSign.revealChild = true,
onHoverLost: () => plusSign.revealChild = false,
setup: setupCursorHover,
child: Box({
children: [
plusSign,
Label({
label: command,
}),
]
})
});
}
const TagButton = (command) => Button({
className: 'sidebar-chat-chip sidebar-chat-chip-action txt txt-small',
onClicked: () => { chatEntry.buffer.text += `${command} ` },
setup: setupCursorHover,
label: command,
});
const CommandButton = (command, displayName = command) => Button({
className: 'sidebar-chat-chip sidebar-chat-chip-action txt txt-small',