Ejemplo n.º 1
0
static GUI_WINDOW_REC *gui_window_init(WINDOW_REC *window,
				       MAIN_WINDOW_REC *parent)
{
	GUI_WINDOW_REC *gui;

	window->width = parent->width;
        window->height = MAIN_WINDOW_TEXT_HEIGHT(parent);

	gui = g_new0(GUI_WINDOW_REC, 1);
	gui->parent = parent;
	gui->view = textbuffer_view_create(textbuffer_create(),
					   window->width, window->height,
					   settings_get_bool("scroll"),
					   term_type == TERM_TYPE_UTF8);
	textbuffer_view_set_default_indent(gui->view,
					   settings_get_int("indent"),
					   !settings_get_bool("indent_always"),
					   get_default_indent_func());
	textbuffer_view_set_break_wide(gui->view, settings_get_bool("break_wide"));
	wcwidth_impl = settings_get_choice("wcwidth_implementation");
	textbuffer_view_set_hidden_level(gui->view, settings_get_level("window_default_hidelevel"));
	if (parent->active == window)
		textbuffer_view_set_window(gui->view, parent->screen_win);
	return gui;
}
Ejemplo n.º 2
0
void gui_windows_reset_settings(void)
{
	GSList *tmp;
	int old_wcwidth_impl = wcwidth_impl;

	wcwidth_impl = settings_get_choice("wcwidth_implementation");

	for (tmp = windows; tmp != NULL; tmp = tmp->next) {
		WINDOW_REC *rec = tmp->data;
		GUI_WINDOW_REC *gui = WINDOW_GUI(rec);

		if (old_wcwidth_impl != wcwidth_impl) {
			textbuffer_view_reset_cache(gui->view);
		}

		textbuffer_view_set_break_wide(gui->view, settings_get_bool("break_wide"));

		textbuffer_view_set_default_indent(gui->view,
						   settings_get_int("indent"),
						   !settings_get_bool("indent_always"),
						   get_default_indent_func());

		textbuffer_view_set_scroll(gui->view,
					   gui->use_scroll ? gui->scroll :
					   settings_get_bool("scroll"));

		if (old_wcwidth_impl != wcwidth_impl) {
			textbuffer_view_redraw(gui->view);
		}
	}
}
Ejemplo n.º 3
0
void gui_windows_reset_settings(void)
{
	GSList *tmp;

	for (tmp = windows; tmp != NULL; tmp = tmp->next) {
		WINDOW_REC *rec = tmp->data;
		GUI_WINDOW_REC *gui = WINDOW_GUI(rec);

		textbuffer_view_set_break_wide(gui->view, settings_get_bool("break_wide"));

		textbuffer_view_set_default_indent(gui->view,
						   settings_get_int("indent"),
						   !settings_get_bool("indent_always"),
						   get_default_indent_func());

		textbuffer_view_set_scroll(gui->view,
					   gui->use_scroll ? gui->scroll :
					   settings_get_bool("scroll"));
	}
}