Skip to content

Commit f85469f

Browse files
committed
[frontend] add tooltips and fix auxclick bug
1 parent 96bce79 commit f85469f

File tree

3 files changed

+11
-0
lines changed

3 files changed

+11
-0
lines changed

frontend/src/components/IconButton.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ export const IconButton: Component<{
66
icon: IconifyIcon;
77
click?: (e: MouseEvent) => void;
88
active?: boolean;
9+
tooltip?: string;
910
}> = function (cx) {
1011
this.active ??= true;
1112
return (
1213
<button
1314
disabled={use(this.active).map((x) => (x ? undefined : true))}
1415
class:active={use(this.active)}
1516
on:click={(e) => this.click?.(e)}
17+
title={this.tooltip}
1618
>
1719
<Icon icon={this.icon} />
1820
</button>

frontend/src/components/Omnibox.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,19 @@ export const Omnibox: Component<{
3737
return (
3838
<div>
3939
<IconButton
40+
tooltip="Go back one page (Alt+Left Arrow)"
4041
active={use(this.tab.canGoBack)}
4142
click={() => this.tab.back()}
4243
icon={iconBack}
4344
></IconButton>
4445
<IconButton
46+
tooltip="Go forward one page (Alt+Right Arrow)"
4547
active={use(this.tab.canGoForward)}
4648
click={() => this.tab.forward()}
4749
icon={iconForwards}
4850
></IconButton>
4951
<IconButton
52+
tooltip="Refresh current page (Ctrl+R)"
5053
click={() => this.tab.reload()}
5154
icon={iconRefresh}
5255
></IconButton>
@@ -58,6 +61,7 @@ export const Omnibox: Component<{
5861
<Spacer></Spacer>
5962
<IconButton active={false} icon={iconExtension}></IconButton>
6063
<IconButton
64+
tooltip="More Options"
6165
icon={iconMore}
6266
click={(e: MouseEvent) => {
6367
createMenu(e.x, cx.root.clientTop + cx.root.clientHeight * 2, [

frontend/src/components/UrlInput.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ export const UrlInput: Component<
139139
browser.unfocusframes = false;
140140
e.stopPropagation();
141141
});
142+
document.body.addEventListener("auxclick", (e) => {
143+
this.active = false;
144+
browser.unfocusframes = false;
145+
e.stopPropagation();
146+
});
142147
if (this.tabUrl.href == "puter://newtab") {
143148
this.value = "";
144149
} else {

0 commit comments

Comments
 (0)