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

22
app/components/app-links.imba

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

Loading…
Cancel
Save