From dae38fab19bc6aed3430829e84519e7ea36b65b2 Mon Sep 17 00:00:00 2001 From: Ivan Yarcev Date: Wed, 12 Nov 2025 15:33:17 +0600 Subject: [PATCH] Fixed default layouts setting --- source/ubl-settings-keyboard-save.c | 18 ++++++++++++++---- source/ubl-settings-keyboard.h | 3 ++- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/source/ubl-settings-keyboard-save.c b/source/ubl-settings-keyboard-save.c index 5112e4c..e339eda 100644 --- a/source/ubl-settings-keyboard-save.c +++ b/source/ubl-settings-keyboard-save.c @@ -21,24 +21,34 @@ void on_save_done(main_window *, config_str output, int size){ } -void on_config_global_local_save(GtkWidget *, main_window *){ +void yon_interface_save(main_window *widgets){ + if (gtk_switch_get_active(GTK_SWITCH(widgets->DefaultLayoutsSwitch))){ + yon_config_remove_by_key(keyboard_layout_parameter); + } +} + +void on_config_global_local_save(GtkWidget *, main_window *widgets){ + yon_interface_save(widgets); main_config.save_config=YON_CONFIG_BOTH; yon_save_proceed(NULL,YON_CONFIG_BOTH,config_get_global_command,NULL); } -void on_config_local_save(GtkWidget *, main_window *){ +void on_config_local_save(GtkWidget *, main_window *widgets){ + yon_interface_save(widgets); main_config.save_config=YON_CONFIG_LOCAL; yon_save_proceed("system",YON_CONFIG_LOCAL,config_get_local_command,NULL); } -void on_config_global_save(GtkWidget *, main_window *){ +void on_config_global_save(GtkWidget *, main_window *widgets){ + yon_interface_save(widgets); main_config.save_config=YON_CONFIG_GLOBAL; yon_save_proceed("global",YON_CONFIG_GLOBAL,config_get_global_command,NULL); } -void on_config_custom_save(GtkWidget *, main_window *){ +void on_config_custom_save(GtkWidget *, main_window *widgets){ + yon_interface_save(widgets); main_config.save_config=YON_CONFIG_LOCAL; template_saving_window *window = yon_save_proceed(NULL,YON_CONFIG_CUSTOM,yon_config_get_custom_command("system"),NULL); if (window){}; diff --git a/source/ubl-settings-keyboard.h b/source/ubl-settings-keyboard.h index b6e16e3..a1778c6 100644 --- a/source/ubl-settings-keyboard.h +++ b/source/ubl-settings-keyboard.h @@ -275,4 +275,5 @@ layouts_window *yon_font_window_new(); void yon_font_open(GtkWidget *,main_window *widgets); void on_keymaps_selection_changed(GtkWidget *,layouts_window *window); void on_font_accept(GtkWidget *, layouts_window *window); -void on_font_selection_changed(GtkWidget *,layouts_window *window); \ No newline at end of file +void on_font_selection_changed(GtkWidget *,layouts_window *window); +void yon_interface_save(main_window *widgets); \ No newline at end of file