(feat) move hotkey to editor

This commit is contained in:
cardosofede
2023-08-03 18:24:57 +02:00
parent 3bf274511a
commit 587cb2be14
2 changed files with 2 additions and 2 deletions

View File

@@ -208,7 +208,6 @@ with manage:
with elements("bot_config"):
with mui.Paper(elevation=3, style={"padding": "2rem"}, spacing=[2, 2], container=True):
mui.Typography("🗂Files Management", variant="h3", sx={"margin-bottom": "2rem"})
event.Hotkey("ctrl+s", sync(), bindInputs=True, overrideDefault=True)
with w.dashboard():
w.file_explorer()
w.editor()

View File

@@ -1,6 +1,6 @@
from functools import partial
import streamlit as st
from streamlit_elements import mui, editor, sync, lazy
from streamlit_elements import mui, editor, sync, lazy, event
from utils.os_utils import save_file
from .dashboard import Dashboard
@@ -87,4 +87,5 @@ class Editor(Dashboard.Item):
with mui.Stack(direction="row", spacing=2, alignItems="center", sx={"padding": "10px"}):
mui.Button("Apply", variant="contained", onClick=sync())
event.Hotkey("ctrl+s", sync(), bindInputs=True, overrideDefault=True)
mui.Typography("Or press ctrl+s", sx={"flex": 1})