Kaydet (Commit) f1529b04 authored tarafından Enrico Tröger's avatar Enrico Tröger

Little redesign of the preferences dialog.

New options for setting the placement of notebook tabs.


git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@525 ea778897-0a13-0410-b9d1-a72fbfd435f5
üst b28e30b3
......@@ -3,6 +3,10 @@
* src/callbacks.c, src/msgwindow.c, src/utils.c:
Improved "Find usage", so it displays not "null" for unsaved files
in the results, and unsaved file are also clickable.
* geany.glade, src/interface.c, src/geany.h, src/keyfile.c,
src/prefs.c, src/dialogs.c, src/main.c:
Little redesign of the preferences dialog.
New options for setting the placement of notebook tabs.
2006-07-02 Nick Treleaven <nick.treleaven@btinternet.com>
......
This diff is collapsed.
......@@ -1772,7 +1772,7 @@ void dialogs_show_prefs_dialog(void)
label = gtk_label_new(_("Terminal"));
gtk_notebook_set_tab_label(GTK_NOTEBOOK(notebook), gtk_notebook_get_nth_page(
GTK_NOTEBOOK(notebook), 5), label);
GTK_NOTEBOOK(notebook), 6), label);
g_object_set_data_full(G_OBJECT(app->prefs_dialog), "font_term",
gtk_widget_ref(font_term), (GDestroyNotify) gtk_widget_unref);
......
......@@ -165,6 +165,9 @@ typedef struct MyApp
gboolean pref_main_confirm_exit;
gboolean pref_main_show_search;
gboolean pref_main_show_goto;
gint tab_pos_editor;
gint tab_pos_msgwin;
gint tab_pos_sidebar;
gint cur_idx; // currently only used by the build system (build_spawn_cmd)
gint mru_length;
gint long_line_type;
......
This diff is collapsed.
......@@ -79,6 +79,9 @@ void configuration_save(void)
g_key_file_set_integer(config, PACKAGE, "mru_length", app->mru_length);
g_key_file_set_integer(config, PACKAGE, "long_line_type", app->long_line_type);
g_key_file_set_integer(config, PACKAGE, "tab_pos_editor", app->tab_pos_editor);
g_key_file_set_integer(config, PACKAGE, "tab_pos_msgwin", app->tab_pos_msgwin);
g_key_file_set_integer(config, PACKAGE, "tab_pos_sidebar", app->tab_pos_sidebar);
g_key_file_set_integer(config, PACKAGE, "long_line_column", app->long_line_column);
g_key_file_set_string(config, PACKAGE, "long_line_color", app->long_line_color);
g_key_file_set_boolean(config, PACKAGE, "beep_on_errors", app->beep_on_errors);
......@@ -229,6 +232,9 @@ gboolean configuration_load(void)
app->long_line_type = utils_get_setting_integer(config, PACKAGE, "long_line_type", 0);
app->long_line_color = utils_get_setting_string(config, PACKAGE, "long_line_color", "#C2EBC2");
app->long_line_column = utils_get_setting_integer(config, PACKAGE, "long_line_column", 72);
app->tab_pos_editor = utils_get_setting_integer(config, PACKAGE, "tab_pos_editor", GTK_POS_TOP);
app->tab_pos_msgwin = utils_get_setting_integer(config, PACKAGE, "tab_pos_msgwin",GTK_POS_LEFT);
app->tab_pos_sidebar = utils_get_setting_integer(config, PACKAGE, "tab_pos_sidebar", GTK_POS_TOP);
app->treeview_symbol_visible = utils_get_setting_boolean(config, PACKAGE, "treeview_symbol_visible", TRUE);
app->treeview_openfiles_visible = utils_get_setting_boolean(config, PACKAGE, "treeview_openfiles_visible", TRUE);
app->msgwindow_visible = utils_get_setting_boolean(config, PACKAGE, "msgwindow_visible", TRUE);
......
......@@ -204,6 +204,11 @@ static void apply_settings(void)
gtk_menu_tool_button_set_menu(GTK_MENU_TOOL_BUTTON(
lookup_widget(app->window, "menutoolbutton1")), app->new_file_menu);
// set the tab placements of the notebooks
gtk_notebook_set_tab_pos(GTK_NOTEBOOK(app->notebook), app->tab_pos_editor);
gtk_notebook_set_tab_pos(GTK_NOTEBOOK(msgwindow.notebook), app->tab_pos_msgwin);
gtk_notebook_set_tab_pos(GTK_NOTEBOOK(app->treeview_notebook), app->tab_pos_sidebar);
}
......
......@@ -85,6 +85,14 @@ void prefs_init_dialog(void)
widget = lookup_widget(app->prefs_dialog, "check_ask_for_quit");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_main_confirm_exit);
if (app->tab_order_ltr)
widget = lookup_widget(app->prefs_dialog, "radio_tab_right");
else
widget = lookup_widget(app->prefs_dialog, "radio_tab_left");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
// Interface settings
widget = lookup_widget(app->prefs_dialog, "check_toolbar_search");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_main_show_search);
......@@ -103,12 +111,38 @@ void prefs_init_dialog(void)
widget = lookup_widget(app->prefs_dialog, "msgwin_font");
gtk_font_button_set_font_name(GTK_FONT_BUTTON(widget), app->msgwin_font);
if (app->tab_order_ltr)
widget = lookup_widget(app->prefs_dialog, "radio_tab_right");
else
widget = lookup_widget(app->prefs_dialog, "radio_tab_left");
widget = lookup_widget(app->prefs_dialog, "editor_font");
gtk_font_button_set_font_name(GTK_FONT_BUTTON(widget), app->editor_font);
widget = lookup_widget(app->prefs_dialog, "spin_long_line");
gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget), app->long_line_column);
old_long_line_column = app->long_line_column;
switch (app->long_line_type)
{
case 0: widget = lookup_widget(app->prefs_dialog, "radio_long_line_line"); break;
case 1: widget = lookup_widget(app->prefs_dialog, "radio_long_line_background"); break;
default: widget = lookup_widget(app->prefs_dialog, "radio_long_line_disabled"); break;
}
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
old_long_line_color = g_strdup(app->long_line_color);
color = g_new0(GdkColor, 1);
gdk_color_parse(app->long_line_color, color);
widget = lookup_widget(app->prefs_dialog, "long_line_color");
gtk_color_button_set_color(GTK_COLOR_BUTTON(widget), color);
g_free(color);
widget = lookup_widget(app->prefs_dialog, "combo_tab_editor");
gtk_combo_box_set_active(GTK_COMBO_BOX(widget), app->tab_pos_editor);
widget = lookup_widget(app->prefs_dialog, "combo_tab_msgwin");
gtk_combo_box_set_active(GTK_COMBO_BOX(widget), app->tab_pos_msgwin);
widget = lookup_widget(app->prefs_dialog, "combo_tab_sidebar");
gtk_combo_box_set_active(GTK_COMBO_BOX(widget), app->tab_pos_sidebar);
// Editor settings
widget = lookup_widget(app->prefs_dialog, "spin_tab_width");
......@@ -149,28 +183,6 @@ void prefs_init_dialog(void)
widget = lookup_widget(app->prefs_dialog, "check_indicators");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->pref_editor_use_indicators);
widget = lookup_widget(app->prefs_dialog, "editor_font");
gtk_font_button_set_font_name(GTK_FONT_BUTTON(widget), app->editor_font);
widget = lookup_widget(app->prefs_dialog, "spin_long_line");
gtk_spin_button_set_value(GTK_SPIN_BUTTON(widget), app->long_line_column);
old_long_line_column = app->long_line_column;
switch (app->long_line_type)
{
case 0: widget = lookup_widget(app->prefs_dialog, "radio_long_line_line"); break;
case 1: widget = lookup_widget(app->prefs_dialog, "radio_long_line_background"); break;
default: widget = lookup_widget(app->prefs_dialog, "radio_long_line_disabled"); break;
}
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), TRUE);
old_long_line_color = g_strdup(app->long_line_color);
color = g_new0(GdkColor, 1);
gdk_color_parse(app->long_line_color, color);
widget = lookup_widget(app->prefs_dialog, "long_line_color");
gtk_color_button_set_color(GTK_COLOR_BUTTON(widget), color);
g_free(color);
// Tools Settings
#ifdef GEANY_WIN32
......@@ -290,7 +302,7 @@ void prefs_init_dialog(void)
#endif
}
//gtk_notebook_set_tab_pos
/*
* callbacks
......@@ -321,6 +333,11 @@ void on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_dat
widget = lookup_widget(app->prefs_dialog, "check_switch_pages");
app->switch_msgwin_pages = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(app->prefs_dialog, "radio_tab_right");
app->tab_order_ltr = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
// Interface settings
widget = lookup_widget(app->prefs_dialog, "check_toolbar_search");
app->pref_main_show_search = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
......@@ -333,8 +350,27 @@ void on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_dat
widget = lookup_widget(app->prefs_dialog, "check_list_openfiles");
app->treeview_openfiles_visible = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(app->prefs_dialog, "radio_tab_right");
app->tab_order_ltr = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(app->prefs_dialog, "radio_long_line_line");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) app->long_line_type = 0;
else
{
widget = lookup_widget(app->prefs_dialog, "radio_long_line_background");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) app->long_line_type = 1;
else
{ // now only the disabled radio remains, so disable it
app->long_line_type = 2;
}
}
if (app->long_line_column == 0) app->long_line_type = 2;
widget = lookup_widget(app->prefs_dialog, "combo_tab_editor");
app->tab_pos_editor = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
widget = lookup_widget(app->prefs_dialog, "combo_tab_msgwin");
app->tab_pos_msgwin = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
widget = lookup_widget(app->prefs_dialog, "combo_tab_sidebar");
app->tab_pos_sidebar = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
// Editor settings
......@@ -378,18 +414,6 @@ void on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_dat
widget = lookup_widget(app->prefs_dialog, "check_indicators");
app->pref_editor_use_indicators = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
widget = lookup_widget(app->prefs_dialog, "radio_long_line_line");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) app->long_line_type = 0;
else
{
widget = lookup_widget(app->prefs_dialog, "radio_long_line_background");
if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget))) app->long_line_type = 1;
else
{ // now only the disabled radio remains, so disable it
app->long_line_type = 2;
}
}
if (app->long_line_column == 0) app->long_line_type = 2;
// Tools Settings
widget = lookup_widget(app->prefs_dialog, "entry_com_make");
......@@ -408,6 +432,7 @@ void on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_dat
g_free(app->tools_print_cmd);
app->tools_print_cmd = g_strdup(gtk_entry_get_text(GTK_ENTRY(widget)));
// Template settings
widget = lookup_widget(app->prefs_dialog, "entry_template_developer");
g_free(app->pref_template_developer);
......@@ -478,6 +503,10 @@ void on_prefs_button_clicked(GtkDialog *dialog, gint response, gpointer user_dat
utils_widget_show_hide(lookup_widget(app->window, "separatortoolitem5"), app->pref_main_show_goto);
utils_treeviews_showhide();
gtk_notebook_set_tab_pos(GTK_NOTEBOOK(app->notebook), app->tab_pos_editor);
gtk_notebook_set_tab_pos(GTK_NOTEBOOK(msgwindow.notebook), app->tab_pos_msgwin);
gtk_notebook_set_tab_pos(GTK_NOTEBOOK(app->treeview_notebook), app->tab_pos_sidebar);
// re-colourise all open documents, if tab width or long line settings have changed
for (i = 0; i < GEANY_MAX_OPEN_FILES; i++)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment