Index: src/lxterminal.c
===================================================================
--- src/lxterminal.c	(revisione 838)
+++ src/lxterminal.c	(copia locale)
@@ -34,8 +34,8 @@
 #include "preferences.h"
 #include "unixsocket.h"
 
-const GdkColor background = { 0 };
-const GdkColor foreground = { 0, 0xaaaa, 0xaaaa, 0xaaaa};
+GdkColor background = { 0 };
+GdkColor foreground = { 0, 0xaaaa, 0xaaaa, 0xaaaa};
 
 /* Linux color for palette */
 const GdkColor linux_color[16] =
@@ -525,7 +525,17 @@
 	/* setting terminal */
 	vte_terminal_set_font_from_string(term->vte, terminal->setting->fontname);
 	vte_terminal_set_word_chars(term->vte, terminal->setting->selchars);
+	vte_terminal_set_scrollback_lines(term->vte, terminal->setting->scrollback);
 	vte_terminal_set_emulation(term->vte, "xterm");
+	
+	
+	/* terminal colors */
+	background.red = terminal->setting->bgcolor_red;
+	background.green = terminal->setting->bgcolor_green;
+	background.blue = terminal->setting->bgcolor_blue;
+	foreground.red = terminal->setting->fgcolor_red;
+	foreground.green = terminal->setting->fgcolor_green;
+	foreground.blue = terminal->setting->fgcolor_blue;
 	vte_terminal_set_colors(term->vte, &foreground, &background, &linux_color, 16);
 
 	/* create label for tab */
Index: src/preferences.c
===================================================================
--- src/preferences.c	(revisione 838)
+++ src/preferences.c	(copia locale)
@@ -42,32 +42,61 @@
 void lxterminal_preferences_general_constructor(Prefer *prefer, TabWidget *tab)
 {
 	PreferGeneral *pg;
-
+	
+	GdkColor bgcolor;
+	GdkColor fgcolor;
+	
 	/* create general data structure */
 	pg = g_new0(PreferGeneral, 1);
 	tab->childs = pg;
 
-	pg->box = gtk_vbox_new(FALSE, 4);
+	pg->box = gtk_table_new(5,2, FALSE);
+	gtk_table_set_row_spacings(pg->box, 3);
+	gtk_table_set_col_spacings(pg->box, 6);
 
 	/* terminal font */
-	pg->font_box = gtk_hbox_new(FALSE, 4);
 	pg->font_label = gtk_label_new(_("Terminal Font:"));
+	gtk_misc_set_alignment(pg->font_label, 1, 0.5);
 	pg->font_button = gtk_font_button_new_with_font(prefer->terminal->setting->fontname);
-	gtk_box_pack_start(GTK_BOX(pg->font_box), pg->font_label, FALSE, FALSE, 0);
-	gtk_box_pack_start(GTK_BOX(pg->font_box), pg->font_button, FALSE, FALSE, 0);
-	/* adding to box */
-	gtk_box_pack_start(GTK_BOX(pg->box), pg->font_box, FALSE, FALSE, 0);
+	gtk_table_attach_defaults(GTK_BOX(pg->box), pg->font_label, 0,1, 0,1);
+	gtk_table_attach_defaults(GTK_BOX(pg->box), pg->font_button, 1,2, 0,1);
 
 	/* Select-by-word */
-	pg->selchars_box = gtk_hbox_new(FALSE, 4);
 	pg->selchars_label = gtk_label_new(_("Select-by-word characters:"));
+	gtk_misc_set_alignment(pg->selchars_label, 1, 0.5);
 	pg->selchars_entry = gtk_entry_new();
-	gtk_entry_set_text(pg->selchars_entry, prefer->terminal->setting->selchars);
-	gtk_box_pack_start(GTK_BOX(pg->selchars_box), pg->selchars_label, FALSE, FALSE, 0);
-	gtk_box_pack_start(GTK_BOX(pg->selchars_box), pg->selchars_entry, FALSE, FALSE, 0);
-	/* adding to box */
-	gtk_box_pack_start(GTK_BOX(pg->box), pg->selchars_box, FALSE, FALSE, 0);
+	gtk_entry_set_text((GtkEntry *)pg->selchars_entry, prefer->terminal->setting->selchars);
+	gtk_table_attach_defaults(GTK_BOX(pg->box), pg->selchars_label, 0,1, 1,2);
+	gtk_table_attach_defaults(GTK_BOX(pg->box), pg->selchars_entry, 1,2, 1,2);
 
+	/* Scrollback buffer */
+	pg->scrollback_label = gtk_label_new(_("Scrollback lines:"));
+	gtk_misc_set_alignment(pg->scrollback_label, 1, 0.5);
+	pg->scrollback_entry = gtk_spin_button_new_with_range(100, 100000, 10);
+	gtk_spin_button_set_value((GtkSpinButton *)pg->scrollback_entry, prefer->terminal->setting->scrollback);
+	gtk_table_attach_defaults(GTK_BOX(pg->box), pg->scrollback_label, 0,1, 2,3);
+	gtk_table_attach_defaults(GTK_BOX(pg->box), pg->scrollback_entry, 1,2, 2,3);
+
+	/* Background color */
+	pg->bgcolor_label = gtk_label_new(_("Background:"));
+	gtk_misc_set_alignment(pg->bgcolor_label, 1, 0.5);
+	bgcolor.red = prefer->terminal->setting->bgcolor_red;
+	bgcolor.green = prefer->terminal->setting->bgcolor_green;
+	bgcolor.blue = prefer->terminal->setting->bgcolor_blue;
+	pg->bgcolor_entry = gtk_color_button_new_with_color(&bgcolor);
+	gtk_table_attach_defaults(GTK_BOX(pg->box), pg->bgcolor_label, 0,1, 3,4);
+	gtk_table_attach_defaults(GTK_BOX(pg->box), pg->bgcolor_entry, 1,2, 3,4);
+
+	/* Background color */
+	pg->fgcolor_label = gtk_label_new(_("Foreground:"));
+	gtk_misc_set_alignment(pg->fgcolor_label, 1, 0.5);
+	fgcolor.red = prefer->terminal->setting->fgcolor_red;
+	fgcolor.green = prefer->terminal->setting->fgcolor_green;
+	fgcolor.blue = prefer->terminal->setting->fgcolor_blue;
+	pg->fgcolor_entry = gtk_color_button_new_with_color(&fgcolor);
+	gtk_table_attach_defaults(GTK_BOX(pg->box), pg->fgcolor_label, 0,1, 4,5);
+	gtk_table_attach_defaults(GTK_BOX(pg->box), pg->fgcolor_entry, 1,2, 4,5);
+
 	/* adding to page */
     gtk_container_add(GTK_CONTAINER(tab->page), pg->box);
 }
@@ -82,10 +111,21 @@
 void lxterminal_preferences_general_save(Prefer *prefer, TabWidget *tab)
 {
 	PreferGeneral *pg = tab->childs;
-
+	
     g_free( prefer->terminal->setting->fontname );
-	prefer->terminal->setting->fontname = g_strdup( gtk_font_button_get_font_name(pg->font_button) );
-	prefer->terminal->setting->selchars = g_strdup( gtk_entry_get_text(pg->selchars_entry) );
+	prefer->terminal->setting->fontname = g_strdup( gtk_font_button_get_font_name((GtkFontButton *)pg->font_button) );
+	prefer->terminal->setting->selchars = g_strdup( gtk_entry_get_text((GtkEntry *)pg->selchars_entry) );
+	prefer->terminal->setting->scrollback = (glong)gtk_spin_button_get_value_as_int((GtkSpinButton *)pg->scrollback_entry);
+	GdkColor color;
+	gtk_color_button_get_color(pg->bgcolor_entry, &color);
+	prefer->terminal->setting->bgcolor_red = color.red;
+	prefer->terminal->setting->bgcolor_green = color.green;
+	prefer->terminal->setting->bgcolor_blue = color.blue;
+	gtk_color_button_get_color(pg->fgcolor_entry, &color);
+	prefer->terminal->setting->fgcolor_red = color.red;
+	prefer->terminal->setting->fgcolor_green = color.green;
+	prefer->terminal->setting->fgcolor_blue = color.blue;
+	
 }
 
 TabWidget *lxterminal_preferences_page_new(TabGroup *tabgroup)
Index: src/setting.h
===================================================================
--- src/setting.h	(revisione 838)
+++ src/setting.h	(copia locale)
@@ -4,6 +4,13 @@
 typedef struct _setting {
 	char *fontname;
 	char *selchars;
+	glong scrollback;
+	gint bgcolor_red;
+	gint bgcolor_green;
+	gint bgcolor_blue;
+	gint fgcolor_red;
+	gint fgcolor_green;
+	gint fgcolor_blue;
 	GKeyFile *keyfile;
 } Setting;
 
Index: src/preferences.h
===================================================================
--- src/preferences.h	(revisione 838)
+++ src/preferences.h	(copia locale)
@@ -26,12 +26,16 @@
 
 typedef struct {
 	GtkWidget *box;
-	GtkWidget *font_box;
 	GtkWidget *font_label;
 	GtkWidget *font_button;
-	GtkWidget *selchars_box;
 	GtkWidget *selchars_label;
 	GtkWidget *selchars_entry;
+	GtkWidget *scrollback_label;
+	GtkWidget *scrollback_entry;
+	GtkWidget *bgcolor_label;
+	GtkWidget *bgcolor_entry;
+	GtkWidget *fgcolor_label;
+	GtkWidget *fgcolor_entry;
 } PreferGeneral;
 
 void lxterminal_preferences_dialog(LXTerminal *terminal, guint action, GtkWidget *item);
Index: src/setting.c
===================================================================
--- src/setting.c	(revisione 838)
+++ src/setting.c	(copia locale)
@@ -47,6 +47,13 @@
 	/* push settings to GKeyFile */
 	g_key_file_set_string(setting->keyfile, "general", "fontname", setting->fontname);
 	g_key_file_set_string(setting->keyfile, "general", "selchars", setting->selchars);
+	g_key_file_set_integer(setting->keyfile, "general", "scrollback", (gint)setting->scrollback);
+	g_key_file_set_integer(setting->keyfile, "general", "bgcolor_red", setting->bgcolor_red);
+	g_key_file_set_integer(setting->keyfile, "general", "bgcolor_green", setting->bgcolor_green);
+	g_key_file_set_integer(setting->keyfile, "general", "bgcolor_blue", setting->bgcolor_blue);
+	g_key_file_set_integer(setting->keyfile, "general", "fgcolor_red", setting->fgcolor_red);
+	g_key_file_set_integer(setting->keyfile, "general", "fgcolor_green", setting->fgcolor_green);
+	g_key_file_set_integer(setting->keyfile, "general", "fgcolor_blue", setting->fgcolor_blue);
 
 	/* generate config data */
 	file_data = g_key_file_to_data(setting->keyfile, NULL, NULL);
@@ -78,6 +85,13 @@
 		/* general setting */
 		setting->fontname = g_key_file_get_string(setting->keyfile, "general", "fontname", NULL);
 		setting->selchars = g_key_file_get_string(setting->keyfile, "general", "selchars", NULL);
+		setting->scrollback = (glong)g_key_file_get_integer(setting->keyfile, "general", "scrollback", NULL);
+		setting->bgcolor_red = g_key_file_get_integer(setting->keyfile, "general", "bgcolor_red", NULL);
+		setting->bgcolor_green = g_key_file_get_integer(setting->keyfile, "general", "bgcolor_green", NULL);
+		setting->bgcolor_blue = g_key_file_get_integer(setting->keyfile, "general", "bgcolor_blue", NULL);
+		setting->fgcolor_red = g_key_file_get_integer(setting->keyfile, "general", "fgcolor_red", NULL);
+		setting->fgcolor_green = g_key_file_get_integer(setting->keyfile, "general", "fgcolor_green", NULL);
+		setting->fgcolor_blue = g_key_file_get_integer(setting->keyfile, "general", "fgcolor_blue", NULL);
 	}
 
 setting_default:
@@ -88,5 +102,8 @@
 	if (!setting->selchars)
 		setting->selchars = g_strdup("-A-Za-z0-9,./?%&#:_");
 
+	if (!setting->scrollback)
+		setting->scrollback = (glong)1000;
+	
 	return setting;
 }
