From 953343cced1cd480df990cae0d67621ff7f7ce66 Mon Sep 17 00:00:00 2001 From: oobabooga <112222186+oobabooga@users.noreply.github.com> Date: Tue, 9 Jan 2024 06:33:47 -0800 Subject: [PATCH] Improve the file saving/deletion menus --- css/main.css | 4 ++-- modules/ui_file_saving.py | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/css/main.css b/css/main.css index 43ad82b2..bfc81b0f 100644 --- a/css/main.css +++ b/css/main.css @@ -193,11 +193,11 @@ button { max-width: 500px; background-color: var(--input-background-fill); border: var(--input-border-width) solid var(--input-border-color) !important; - padding: 10px; } -.file-saver > :first-child > :nth-child(2) { +.file-saver > :first-child > :last-child { background: var(--block-background-fill); + justify-content: flex-end; } .checkboxgroup-table label { diff --git a/modules/ui_file_saving.py b/modules/ui_file_saving.py index 9e034495..71471217 100644 --- a/modules/ui_file_saving.py +++ b/modules/ui_file_saving.py @@ -13,23 +13,23 @@ def create_ui(): shared.gradio['save_root'] = gr.Textbox(lines=1, label='File folder', info='For reference. Unchangeable.', interactive=False) shared.gradio['save_contents'] = gr.Textbox(lines=10, label='File contents') with gr.Row(): - shared.gradio['save_confirm'] = gr.Button('Save', elem_classes="small-button", variant='primary', interactive=not mu) shared.gradio['save_cancel'] = gr.Button('Cancel', elem_classes="small-button") + shared.gradio['save_confirm'] = gr.Button('Save', elem_classes="small-button", variant='primary', interactive=not mu) # Text file deleter with gr.Group(visible=False, elem_classes='file-saver') as shared.gradio['file_deleter']: shared.gradio['delete_filename'] = gr.Textbox(lines=1, label='File name') shared.gradio['delete_root'] = gr.Textbox(lines=1, label='File folder', info='For reference. Unchangeable.', interactive=False) with gr.Row(): - shared.gradio['delete_confirm'] = gr.Button('Delete', elem_classes="small-button", variant='stop', interactive=not mu) shared.gradio['delete_cancel'] = gr.Button('Cancel', elem_classes="small-button") + shared.gradio['delete_confirm'] = gr.Button('Delete', elem_classes="small-button", variant='stop', interactive=not mu) # Character saver/deleter with gr.Group(visible=False, elem_classes='file-saver') as shared.gradio['character_saver']: shared.gradio['save_character_filename'] = gr.Textbox(lines=1, label='File name', info='The character will be saved to your characters/ folder with this base filename.') with gr.Row(): - shared.gradio['save_character_confirm'] = gr.Button('Save', elem_classes="small-button", variant='primary', interactive=not mu) shared.gradio['save_character_cancel'] = gr.Button('Cancel', elem_classes="small-button") + shared.gradio['save_character_confirm'] = gr.Button('Save', elem_classes="small-button", variant='primary', interactive=not mu) with gr.Group(visible=False, elem_classes='file-saver') as shared.gradio['character_deleter']: gr.Markdown('Confirm the character deletion?') @@ -42,8 +42,8 @@ def create_ui(): shared.gradio['save_preset_filename'] = gr.Textbox(lines=1, label='File name', info='The preset will be saved to your presets/ folder with this base filename.') shared.gradio['save_preset_contents'] = gr.Textbox(lines=10, label='File contents') with gr.Row(): - shared.gradio['save_preset_confirm'] = gr.Button('Save', elem_classes="small-button", variant='primary', interactive=not mu) shared.gradio['save_preset_cancel'] = gr.Button('Cancel', elem_classes="small-button") + shared.gradio['save_preset_confirm'] = gr.Button('Save', elem_classes="small-button", variant='primary', interactive=not mu) def create_event_handlers():