void CodeTextEditor::_notification(int p_what) { if (p_what==EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) _load_theme_settings(); if (p_what==NOTIFICATION_ENTER_TREE) { _update_font(); } }
void CodeTextEditor::_notification(int p_what) { if (p_what == EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) { _load_theme_settings(); emit_signal("load_theme_settings"); } if (p_what == NOTIFICATION_THEME_CHANGED) { _update_font(); } }
void CodeTextEditor::_on_settings_change() { _update_font(); // AUTO BRACE COMPLETION text_editor->set_auto_brace_completion( EDITOR_DEF("text_editor/completion/auto_brace_complete", true)); code_complete_timer->set_wait_time( EDITOR_DEF("text_editor/completion/code_complete_delay", .3f)); enable_complete_timer = EDITOR_DEF("text_editor/completion/enable_code_completion_delay", true); // call hint settings text_editor->set_callhint_settings( EDITOR_DEF("text_editor/completion/put_callhint_tooltip_below_current_line", true), EDITOR_DEF("text_editor/completion/callhint_tooltip_offset", Vector2())); }
/* Callback for the bar operations */ static gint item_event_ok(GooCanvasItem *item, GooCanvasItem *target, GdkEventButton *event, gchar *data) { GcomprisProperties *properties = gc_prop_get(); if(data==NULL) return FALSE; if(!strcmp((char *)data, "ok")) { /* Set the new locale in the properties */ if (properties->locale != current_locale) { g_free(properties->locale); properties->locale = strdup(current_locale); } if(current_locale[0] == '\0') { /* Set the locale to the default user's locale */ gc_locale_set(gc_locale_get_user_default()); } else { gc_locale_set(current_locale); } // Font Face g_free(properties->fontface); properties->fontface = g_strdup((char *)g_list_nth_data(fontlist, font_index)); gc_skin_update_font(); if(properties->music || properties->fx) gc_sound_init(); if(!properties->music && !properties->fx) gc_sound_close(); else { if(!properties->music) gc_sound_bg_close(); if(!properties->fx) gc_sound_fx_close(); } gc_prop_save(properties); gc_config_stop(); } else if(!strcmp((char *)data, "rememberlevel")) { properties->rememberlevel = (properties->rememberlevel ? 0 : 1); g_object_set(item, "svg-id", (properties->rememberlevel ? pixmap_checked : pixmap_unchecked), NULL); gc_item_focus_init(item, NULL); } else if(!strcmp((char *)data, "fullscreen")) { properties->fullscreen = (properties->fullscreen ? 0 : 1); gc_fullscreen_set(properties->fullscreen); g_object_set (item, "svg-id", (properties->fullscreen ? pixmap_checked : pixmap_unchecked), NULL); gc_item_focus_init(item, NULL); } else if(!strcmp((char *)data, "music")) { properties->music = (properties->music ? 0 : 1); g_object_set (item, "svg-id", (properties->music ? pixmap_checked : pixmap_unchecked), NULL); if(!properties->music) { gc_sound_bg_close(); } else { gc_sound_init(); gc_sound_bg_reopen(); } gc_item_focus_init(item, NULL); } else if(!strcmp((char *)data, "effect")) { properties->fx = (properties->fx ? 0 : 1); if (properties->fx) gc_sound_init(); g_object_set (item, "svg-id", (properties->fx ? pixmap_checked : pixmap_unchecked), NULL); gc_item_focus_init(item, NULL); } else if(!strcmp((char *)data, "zoom")) { properties->zoom = (properties->zoom ? 0 : 1); gc_update_canvas_zoom(); g_object_set (item, "svg-id", (properties->zoom ? pixmap_checked : pixmap_unchecked), NULL); gc_item_focus_init(item, NULL); } else if(!strcmp((char *)data, "locale_previous")) { current_locale = get_previous_locale(current_locale); g_object_set (item_locale_text, "text", gc_locale_get_name(current_locale), NULL); set_locale_flag(current_locale); } else if(!strcmp((char *)data, "locale_next")) { current_locale = get_next_locale(current_locale); g_object_set (G_OBJECT(item_locale_text), "text", gc_locale_get_name(current_locale), NULL); set_locale_flag(current_locale); } else if(!strcmp((char *)data, "locale_reset")) { current_locale = linguas[0]; g_object_set (G_OBJECT(item_locale_text), "text", gc_locale_get_name(current_locale), NULL); set_locale_flag(current_locale); } else if(!strcmp((char *)data, "timer_previous")) { if(properties->timer>0) properties->timer--; g_object_set (G_OBJECT(item_timer_text), "text", gettext(timername[properties->timer]), NULL); } else if(!strcmp((char *)data, "timer_next")) { if(properties->timer<MAX_TIMER_VALUE) properties->timer++; g_object_set (G_OBJECT(item_timer_text), "text", gettext(timername[properties->timer]), NULL); } else if(!strcmp((char *)data, "font_previous")) { if(font_index-- < 1) font_index = g_list_length(fontlist)-1; _update_font(); } else if(!strcmp((char *)data, "font_next")) { if(font_index++ >= g_list_length(fontlist)-1) font_index = 0; _update_font(); } else if(!strcmp((char *)data, "fontface_reset")) { font_index = current_font_index; _update_font(); } return TRUE; }