Browse Source

Instead of simplify UI, enable and disable effective names, and assign that to <tab>

main
familyfriendlymikey 2 years ago
parent
commit
faad49277c
  1. 8
      app/client.imba
  2. 22
      app/components/app-links.imba
  3. 1
      app/config.imba

8
app/client.imba

@ -249,10 +249,6 @@ tag app
bang ||= config.default_bang
handle_bang!
def handle_click_toggle_simplify_ui
config.enable_simplify_ui = not config.enable_simplify_ui
save_config!
def handle_click_copy s
try
await window.navigator.clipboard.writeText(s)
@ -270,9 +266,7 @@ tag app
def render
<self.disabled=state.loading>
css self
d:flex fld:column jc:flex-start ai:center
css d:flex fld:column jc:flex-start ai:center
w:80vw max-width:700px max-height:80vh
bxs:0px 0px 10px rgba(0,0,0,0.35)
box-sizing:border-box p:30px rd:10px mt:10vh

22
app/components/app-links.imba

@ -26,14 +26,13 @@ tag app-links
catch
no
def toggle_effective_names
config.enable_effective_names = !config.enable_effective_names
def render
<self>
css .links
d:flex fld:column jc:flex-start fl:1
w:100% ofy:auto pt:15px
css .link
d:flex fld:row jc:space-between ai:center
px:16px py:11px rd:5px cursor:pointer c:blue3
@ -100,17 +99,16 @@ tag app-links
<.header>
<.side.left
@click=handle_click_toggle_simplify_ui
>
if config.enable_simplify_ui
<svg src="../assets/eye-off.svg">
else
<.side.left@click=toggle_effective_names>
if config.enable_effective_names
<svg src="../assets/eye.svg">
else
<svg src="../assets/eye-off.svg">
<input$links-input
bind=state.query
@hotkey('return').capture.if(!state.loading)=handle_return
@hotkey('tab').capture.if(!state.loading)=toggle_effective_names
@hotkey('shift+return').capture.if(!state.loading)=handle_shift_return
@hotkey('esc').capture.if(!state.loading)=handle_esc
@hotkey('shift+backspace').capture.if(!state.loading)=handle_shift_backspace
@ -163,7 +161,9 @@ tag app-links
<.tip-hotkey> "Shift + Backspace"
<.tip-content> "Edit Link"
<.links>
<div>
css d:flex fld:column jc:flex-start fl:1 w:100% ofy:auto pt:15px
if not viewing_community_links and (bang or state.sorted_links.length < 1)
<a.link.selected
href=encoded_bang_query

1
app/config.imba

@ -10,7 +10,6 @@ let { data, save } = new class config
this.data.enable_search_on_paste ??= yes
this.data.enable_dark_theme ??= yes
this.data.enable_effective_names ??= yes
this.data.enable_simplify_ui ??= no
this.data.default_bang ??= {}
this.data.default_bang.name ??= "!google"

Loading…
Cancel
Save