master #21

Merged
asmeron merged 5 commits from YanTheKaller/libublsettings-gtk3:master into master 1 year ago

@ -148,7 +148,7 @@ void yon_terminal_integrated_start_shell(GtkWidget *terminal, char* command, voi
// Window config section
#define check_window_config_setup if(__yon_window_config_target_window)
#define check_window_config_setup if(__yon_window_config_target_window&&__yon_window_config_path)
typedef struct {
char *parameter_name;
@ -180,6 +180,8 @@ void yon_terminal_integrated_start_shell(GtkWidget *terminal, char* command, voi
static char *__yon_window_config_path = NULL;
void yon_window_config_save(){
check_window_config_setup {
g_key_file_set_integer(__yon_window_config_file,"window","WindowPosX",__yon_main_window_config.x);
g_key_file_set_integer(__yon_window_config_file,"window","WindowPosY",__yon_main_window_config.y);
g_key_file_set_integer(__yon_window_config_file,"window","WindowWidth",__yon_main_window_config.width);
@ -229,6 +231,7 @@ void yon_terminal_integrated_start_shell(GtkWidget *terminal, char* command, voi
g_key_file_save_to_file(__yon_window_config_file,__yon_window_config_path,NULL);
}
}
void yon_get_is_fullscreen(){
gtk_window_is_maximized(__yon_window_config_target_window);
@ -282,6 +285,7 @@ void yon_terminal_integrated_start_shell(GtkWidget *terminal, char* command, voi
}
int yon_window_config_load(char *path){
check_window_config_setup{
if (!access(path,0)){
__yon_window_config_file = g_key_file_new();
__yon_window_config_path=yon_char_new(path);
@ -334,10 +338,10 @@ void yon_terminal_integrated_start_shell(GtkWidget *terminal, char* command, voi
pthread_t tid;
pthread_create(&tid,NULL,(void *)_yon_maximize,NULL);
return 1;
} else {
return 0;
}
}
return 0;
}
void yon_window_config_apply(){
dictionary *dict=NULL;
@ -377,6 +381,7 @@ void yon_terminal_integrated_start_shell(GtkWidget *terminal, char* command, voi
}
void yon_window_config_add_instant_parameter(char *param_name, char *section, void *tracked_value, enum YON_TYPE val_type){
check_window_config_setup {
switch (val_type){
case YON_TYPE_BOOLEAN: g_key_file_set_boolean(__yon_window_config_file,section,param_name,*((gboolean*)tracked_value));
break;
@ -386,6 +391,7 @@ void yon_terminal_integrated_start_shell(GtkWidget *terminal, char* command, voi
break;
}
}
}
void yon_window_config_erase_custom_parameter(char *param_name, char *section){
__yon_custom_parameter *param = NULL;
@ -401,6 +407,7 @@ void yon_terminal_integrated_start_shell(GtkWidget *terminal, char* command, voi
int yon_window_config_get_parameter(char *section, char *config_parameter, void *return_value, enum YON_TYPE type){
check_window_config_setup{
GError *err=NULL;
switch (type){
case YON_TYPE_BOOLEAN:
@ -424,6 +431,7 @@ void yon_terminal_integrated_start_shell(GtkWidget *terminal, char* command, voi
break;
}
}
}
void yon_on_window_config_custom_window_destroy(GtkWindow *window, GdkEvent* event, char *window_name){
if (!gtk_window_is_maximized(window)){
@ -680,6 +688,30 @@ int yon_gtk_list_store_find_text(GtkListStore *list, GtkTreeIter *iter, int seek
return 0;
}
void yon_gtk_toggle_button_set_inactive_from_toggle(GtkToggleButton *self, GtkToggleButton *target){
if (gtk_toggle_button_get_active(self)){
gtk_toggle_button_set_active(target,1);
} else {
gtk_toggle_button_set_active(target,0);
}
}
void yon_gtk_toggle_button_set_inactive_from_entry(GtkEntry *self, GtkToggleButton *target){
if (strlen(gtk_entry_get_text(self))>0){
gtk_toggle_button_set_active(target,1);
} else {
gtk_toggle_button_set_active(target,0);
}
}
void yon_gtk_toggle_button_set_inactive_from_combo_box(GtkComboBox *self, GtkToggleButton *target){
if (gtk_combo_box_get_active(self)>0){
gtk_toggle_button_set_active(target,1);
} else {
gtk_toggle_button_set_active(target,0);
}
}
void yon_gtk_widget_set_sensitive_from_toggle_button(GtkToggleButton *toggle, GtkWidget *target){
gtk_widget_set_sensitive(target,gtk_toggle_button_get_active(toggle));
}

@ -252,6 +252,12 @@ int yon_dictionary_gtk_pack_end_multiple_widgets(GtkBox *destination, gboolean e
int yon_gtk_list_store_find_text(GtkListStore *list, GtkTreeIter *iter, int seek_column, char *value);
void yon_gtk_toggle_button_set_inactive_from_toggle(GtkToggleButton *self, GtkToggleButton *target);
void yon_gtk_toggle_button_set_inactive_from_entry(GtkEntry *self, GtkToggleButton *target);
void yon_gtk_toggle_button_set_inactive_from_combo_box(GtkComboBox *self, GtkToggleButton *target);
/**yon_gtk_widget_set_sensitive_from_toggle_button(GtkToggleButton *toggle, GtkWidget *target)
* [EN]
*

Loading…
Cancel
Save