Revision: 511 Author: eht16 Date: 2006-06-30 07:28:32 -0700 (Fri, 30 Jun 2006) ViewCVS: http://svn.sourceforge.net/geany/?rev=511&view=rev
Log Message: ----------- Improved settings for the long line marker, it can now be easily disabled or set to highlight the background of too long lines.
Modified Paths: -------------- trunk/ChangeLog trunk/geany.glade trunk/src/document.c trunk/src/geany.h trunk/src/interface.c trunk/src/prefs.c trunk/src/sciwrappers.c trunk/src/sciwrappers.h Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2006-06-30 13:42:53 UTC (rev 510) +++ trunk/ChangeLog 2006-06-30 14:28:32 UTC (rev 511) @@ -8,6 +8,10 @@ callback. * geany.glade, src/interface.c, src/callbacks.c, src/sci_wrappers.c: Added "Select All" menu item. + * geany.glade, src/interface.c, src/document.c, src/sci_wrappers.c, + srcprefs.c, src/geany.h: + Improved settings for the long line marker, it can now be easily + disabled or set to highlight the background of too long lines.
2006-06-29 Nick Treleaven nick.treleaven@btinternet.com
Modified: trunk/geany.glade =================================================================== --- trunk/geany.glade 2006-06-30 13:42:53 UTC (rev 510) +++ trunk/geany.glade 2006-06-30 14:28:32 UTC (rev 511) @@ -3476,7 +3476,7 @@ <property name="xscale">1</property> <property name="yscale">1</property> <property name="top_padding">0</property> - <property name="bottom_padding">0</property> + <property name="bottom_padding">5</property> <property name="left_padding">12</property> <property name="right_padding">6</property>
@@ -3654,9 +3654,9 @@ <child> <widget class="GtkTable" id="table3"> <property name="visible">True</property> - <property name="n_rows">3</property> + <property name="n_rows">1</property> <property name="n_columns">2</property> - <property name="homogeneous">False</property> + <property name="homogeneous">True</property> <property name="row_spacing">3</property> <property name="column_spacing">25</property>
@@ -3689,62 +3689,6 @@ </child>
<child> - <widget class="GtkLabel" id="label133"> - <property name="visible">True</property> - <property name="label" translatable="yes">Long line marker</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> - <widget class="GtkLabel" id="label134"> - <property name="visible">True</property> - <property name="label" translatable="yes">Long line marker color</property> - <property name="use_underline">False</property> - <property name="use_markup">False</property> - <property name="justify">GTK_JUSTIFY_LEFT</property> - <property name="wrap">False</property> - <property name="selectable">False</property> - <property name="xalign">0</property> - <property name="yalign">0.5</property> - <property name="xpad">0</property> - <property name="ypad">0</property> - <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> - <property name="width_chars">-1</property> - <property name="single_line_mode">False</property> - <property name="angle">0</property> - </widget> - <packing> - <property name="left_attach">0</property> - <property name="right_attach">1</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> - </packing> - </child> - - <child> <widget class="GtkFontButton" id="editor_font"> <property name="visible">True</property> <property name="tooltip" translatable="yes">Sets the font for the editors windows</property> @@ -3760,67 +3704,289 @@ <property name="right_attach">2</property> <property name="top_attach">0</property> <property name="bottom_attach">1</property> - <property name="x_options">fill</property> <property name="y_options"></property> </packing> </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> + </widget> + </child>
+ <child> + <widget class="GtkLabel" id="label102"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Miscellaneous</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame8"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + + <child> + <widget class="GtkAlignment" id="alignment11"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkTable" id="table7"> + <property name="visible">True</property> + <property name="n_rows">3</property> + <property name="n_columns">2</property> + <property name="homogeneous">False</property> + <property name="row_spacing">3</property> + <property name="column_spacing">25</property> + + <child> + <widget class="GtkLabel" id="label133"> + <property name="visible">True</property> + <property name="label" translatable="yes">Long line marker</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label134"> + <property name="visible">True</property> + <property name="label" translatable="yes">Long line marker color</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkSpinButton" id="spin_long_line"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">The long line marker is a thin vertical line in the editor. It helps to mark long lines, or as a hint to break the line. Set this value to a value greater than 0 to specify the column where it should appear.</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">True</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">True</property> + <property name="adjustment">72 0 1000 1 10 10</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">1</property> + <property name="bottom_attach">2</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label156"> + <property name="visible">True</property> + <property name="label" translatable="yes">Type</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> + + <child> + <widget class="GtkHBox" id="hbox5"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">10</property> + <child> - <widget class="GtkSpinButton" id="spin_long_line"> + <widget class="GtkRadioButton" id="radio_long_line_line"> <property name="visible">True</property> - <property name="tooltip" translatable="yes">The long line marker is a thin vertical line in the editor. It helps to mark long lines, or as a hint to break the line. To disable set the value to 0, or greater than 0 to specify the column where it should appear.</property> + <property name="tooltip" translatable="yes">Prints a vertical line in the editor window at the given cursor position(see below).</property> <property name="can_focus">True</property> - <property name="climb_rate">1</property> - <property name="digits">0</property> - <property name="numeric">True</property> - <property name="update_policy">GTK_UPDATE_ALWAYS</property> - <property name="snap_to_ticks">False</property> - <property name="wrap">True</property> - <property name="adjustment">72 0 1000 1 10 10</property> + <property name="label" translatable="yes">Line</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> </widget> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">1</property> - <property name="bottom_attach">2</property> - <property name="y_options"></property> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> </packing> </child>
<child> - <widget class="GtkColorButton" id="long_line_color"> + <widget class="GtkRadioButton" id="radio_long_line_background"> <property name="visible">True</property> - <property name="tooltip" translatable="yes">Sets the color of the long line marker</property> + <property name="tooltip" translatable="yes">The background colour of characters after the given cursor position(see below) changed to the colour set below. (This is recommended if you use proportional fonts)</property> <property name="can_focus">True</property> - <property name="use_alpha">False</property> - <property name="title" translatable="yes">Color Chooser</property> + <property name="label" translatable="yes">Background</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">radio_long_line_line</property> </widget> <packing> - <property name="left_attach">1</property> - <property name="right_attach">2</property> - <property name="top_attach">2</property> - <property name="bottom_attach">3</property> - <property name="x_options">fill</property> - <property name="y_options"></property> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> </packing> </child> + + <child> + <widget class="GtkRadioButton" id="radio_long_line_disabled"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Disabled</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">radio_long_line_line</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> </widget> <packing> - <property name="padding">0</property> - <property name="expand">True</property> - <property name="fill">True</property> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> </packing> </child> + + <child> + <widget class="GtkColorButton" id="long_line_color"> + <property name="visible">True</property> + <property name="tooltip" translatable="yes">Sets the color of the long line marker</property> + <property name="can_focus">True</property> + <property name="use_alpha">False</property> + <property name="title" translatable="yes">Color Chooser</property> + <property name="focus_on_click">True</property> + </widget> + <packing> + <property name="left_attach">1</property> + <property name="right_attach">2</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options"></property> + </packing> + </child> </widget> </child> </widget> </child>
<child> - <widget class="GtkLabel" id="label102"> + <widget class="GtkLabel" id="label155"> <property name="visible">True</property> - <property name="label" translatable="yes"><b>Miscellaneous</b></property> + <property name="label" translatable="yes"><b>Long line marker</b></property> <property name="use_underline">False</property> <property name="use_markup">True</property> <property name="justify">GTK_JUSTIFY_LEFT</property>
Modified: trunk/src/document.c =================================================================== --- trunk/src/document.c 2006-06-30 13:42:53 UTC (rev 510) +++ trunk/src/document.c 2006-06-30 14:28:32 UTC (rev 511) @@ -222,7 +222,7 @@ sci_use_popup(sci, FALSE); sci_assign_cmdkey(sci, SCK_HOME, SCI_VCHOMEWRAP); sci_assign_cmdkey(sci, SCK_END, SCI_LINEENDWRAP); - sci_set_mark_long_lines(sci, app->long_line_column, app->long_line_color); + sci_set_mark_long_lines(sci, app->long_line_type, app->long_line_column, app->long_line_color); sci_set_symbol_margin(sci, app->show_markers_margin); sci_set_folding_margin_visible(sci, app->pref_editor_folding); sci_set_line_numbers(sci, app->show_linenumber_margin, 0);
Modified: trunk/src/geany.h =================================================================== --- trunk/src/geany.h 2006-06-30 13:42:53 UTC (rev 510) +++ trunk/src/geany.h 2006-06-30 14:28:32 UTC (rev 511) @@ -158,6 +158,7 @@ gboolean pref_main_show_goto; gint cur_idx; // currently only used by the build system (build_spawn_cmd) gint mru_length; + gint long_line_type; gint long_line_column; #ifdef HAVE_FIFO gboolean ignore_fifo;
Modified: trunk/src/interface.c =================================================================== --- trunk/src/interface.c 2006-06-30 13:42:53 UTC (rev 510) +++ trunk/src/interface.c 2006-06-30 14:28:32 UTC (rev 511) @@ -1908,13 +1908,23 @@ GtkWidget *label148; GtkWidget *table3; GtkWidget *label103; + GtkWidget *editor_font; + GtkWidget *label102; + GtkWidget *frame8; + GtkWidget *alignment11; + GtkWidget *table7; GtkWidget *label133; GtkWidget *label134; - GtkWidget *editor_font; GtkObject *spin_long_line_adj; GtkWidget *spin_long_line; + GtkWidget *label156; + GtkWidget *hbox5; + GtkWidget *radio_long_line_line; + GSList *radio_long_line_line_group = NULL; + GtkWidget *radio_long_line_background; + GtkWidget *radio_long_line_disabled; GtkWidget *long_line_color; - GtkWidget *label102; + GtkWidget *label155; GtkWidget *label95; GtkWidget *vbox2; GtkWidget *label17; @@ -2330,7 +2340,7 @@ alignment6 = gtk_alignment_new (0.5, 0.5, 1, 1); gtk_widget_show (alignment6); gtk_container_add (GTK_CONTAINER (frame5), alignment6); - gtk_alignment_set_padding (GTK_ALIGNMENT (alignment6), 0, 0, 12, 6); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment6), 0, 5, 12, 6);
vbox12 = gtk_vbox_new (FALSE, 0); gtk_widget_show (vbox12); @@ -2382,9 +2392,9 @@ gtk_widget_show (label148); gtk_box_pack_start (GTK_BOX (vbox12), label148, FALSE, FALSE, 0);
- table3 = gtk_table_new (3, 2, FALSE); + table3 = gtk_table_new (1, 2, TRUE); gtk_widget_show (table3); - gtk_box_pack_start (GTK_BOX (vbox12), table3, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (vbox12), table3, FALSE, TRUE, 0); gtk_table_set_row_spacings (GTK_TABLE (table3), 3); gtk_table_set_col_spacings (GTK_TABLE (table3), 25);
@@ -2395,49 +2405,103 @@ (GtkAttachOptions) (0), 0, 0); gtk_misc_set_alignment (GTK_MISC (label103), 0, 0.5);
+ editor_font = gtk_font_button_new (); + gtk_widget_show (editor_font); + gtk_table_attach (GTK_TABLE (table3), editor_font, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_tooltips_set_tip (tooltips, editor_font, _("Sets the font for the editors windows"), NULL); + + label102 = gtk_label_new (_("<b>Miscellaneous</b>")); + gtk_widget_show (label102); + gtk_frame_set_label_widget (GTK_FRAME (frame5), label102); + gtk_label_set_use_markup (GTK_LABEL (label102), TRUE); + + frame8 = gtk_frame_new (NULL); + gtk_widget_show (frame8); + gtk_box_pack_start (GTK_BOX (vbox5), frame8, TRUE, TRUE, 0); + gtk_frame_set_shadow_type (GTK_FRAME (frame8), GTK_SHADOW_NONE); + + alignment11 = gtk_alignment_new (0.5, 0.5, 1, 1); + gtk_widget_show (alignment11); + gtk_container_add (GTK_CONTAINER (frame8), alignment11); + gtk_alignment_set_padding (GTK_ALIGNMENT (alignment11), 0, 0, 12, 0); + + table7 = gtk_table_new (3, 2, FALSE); + gtk_widget_show (table7); + gtk_container_add (GTK_CONTAINER (alignment11), table7); + gtk_table_set_row_spacings (GTK_TABLE (table7), 3); + gtk_table_set_col_spacings (GTK_TABLE (table7), 25); + label133 = gtk_label_new (_("Long line marker")); gtk_widget_show (label133); - gtk_table_attach (GTK_TABLE (table3), label133, 0, 1, 1, 2, + gtk_table_attach (GTK_TABLE (table7), label133, 0, 1, 1, 2, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_misc_set_alignment (GTK_MISC (label133), 0, 0.5);
label134 = gtk_label_new (_("Long line marker color")); gtk_widget_show (label134); - gtk_table_attach (GTK_TABLE (table3), label134, 0, 1, 2, 3, + gtk_table_attach (GTK_TABLE (table7), label134, 0, 1, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_misc_set_alignment (GTK_MISC (label134), 0, 0.5);
- editor_font = gtk_font_button_new (); - gtk_widget_show (editor_font); - gtk_table_attach (GTK_TABLE (table3), editor_font, 1, 2, 0, 1, - (GtkAttachOptions) (GTK_FILL), - (GtkAttachOptions) (0), 0, 0); - gtk_tooltips_set_tip (tooltips, editor_font, _("Sets the font for the editors windows"), NULL); - spin_long_line_adj = gtk_adjustment_new (72, 0, 1000, 1, 10, 10); spin_long_line = gtk_spin_button_new (GTK_ADJUSTMENT (spin_long_line_adj), 1, 0); gtk_widget_show (spin_long_line); - gtk_table_attach (GTK_TABLE (table3), spin_long_line, 1, 2, 1, 2, + gtk_table_attach (GTK_TABLE (table7), spin_long_line, 1, 2, 1, 2, (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_tooltips_set_tip (tooltips, spin_long_line, _("The long line marker is a thin vertical line in the editor. It helps to mark long lines, or as a hint to break the line. To disable set the value to 0, or greater than 0 to specify the column where it should appear."), NULL); gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spin_long_line), TRUE); gtk_spin_button_set_wrap (GTK_SPIN_BUTTON (spin_long_line), TRUE);
+ label156 = gtk_label_new (_("Type")); + gtk_widget_show (label156); + gtk_table_attach (GTK_TABLE (table7), label156, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_misc_set_alignment (GTK_MISC (label156), 0, 0.5); + + hbox5 = gtk_hbox_new (FALSE, 10); + gtk_widget_show (hbox5); + gtk_table_attach (GTK_TABLE (table7), hbox5, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (GTK_FILL), 0, 0); + + radio_long_line_line = gtk_radio_button_new_with_mnemonic (NULL, _("Line")); + gtk_widget_show (radio_long_line_line); + gtk_box_pack_start (GTK_BOX (hbox5), radio_long_line_line, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, radio_long_line_line, _("Prints a vertical line in the editor window at the given cursor position(see below)."), NULL); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_long_line_line), radio_long_line_line_group); + radio_long_line_line_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_long_line_line)); + + radio_long_line_background = gtk_radio_button_new_with_mnemonic (NULL, _("Background")); + gtk_widget_show (radio_long_line_background); + gtk_box_pack_start (GTK_BOX (hbox5), radio_long_line_background, FALSE, FALSE, 0); + gtk_tooltips_set_tip (tooltips, radio_long_line_background, _("The background colour of characters after the given cursor position(see below) changed to the colour set below. (This is recommended if you use proportional fonts)"), NULL); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_long_line_background), radio_long_line_line_group); + radio_long_line_line_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_long_line_background)); + + radio_long_line_disabled = gtk_radio_button_new_with_mnemonic (NULL, _("Disabled")); + gtk_widget_show (radio_long_line_disabled); + gtk_box_pack_start (GTK_BOX (hbox5), radio_long_line_disabled, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_long_line_disabled), radio_long_line_line_group); + radio_long_line_line_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_long_line_disabled)); + long_line_color = gtk_color_button_new (); gtk_widget_show (long_line_color); - gtk_table_attach (GTK_TABLE (table3), long_line_color, 1, 2, 2, 3, + gtk_table_attach (GTK_TABLE (table7), long_line_color, 1, 2, 2, 3, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); gtk_tooltips_set_tip (tooltips, long_line_color, _("Sets the color of the long line marker"), NULL); gtk_color_button_set_title (GTK_COLOR_BUTTON (long_line_color), _("Color Chooser"));
- label102 = gtk_label_new (_("<b>Miscellaneous</b>")); - gtk_widget_show (label102); - gtk_frame_set_label_widget (GTK_FRAME (frame5), label102); - gtk_label_set_use_markup (GTK_LABEL (label102), TRUE); + label155 = gtk_label_new (_("<b>Long line marker</b>")); + gtk_widget_show (label155); + gtk_frame_set_label_widget (GTK_FRAME (frame8), label155); + gtk_label_set_use_markup (GTK_LABEL (label155), TRUE);
label95 = gtk_label_new (_("Editor")); gtk_widget_show (label95); @@ -2779,12 +2843,21 @@ GLADE_HOOKUP_OBJECT (prefs_dialog, label148, "label148"); GLADE_HOOKUP_OBJECT (prefs_dialog, table3, "table3"); GLADE_HOOKUP_OBJECT (prefs_dialog, label103, "label103"); + GLADE_HOOKUP_OBJECT (prefs_dialog, editor_font, "editor_font"); + GLADE_HOOKUP_OBJECT (prefs_dialog, label102, "label102"); + GLADE_HOOKUP_OBJECT (prefs_dialog, frame8, "frame8"); + GLADE_HOOKUP_OBJECT (prefs_dialog, alignment11, "alignment11"); + GLADE_HOOKUP_OBJECT (prefs_dialog, table7, "table7"); GLADE_HOOKUP_OBJECT (prefs_dialog, label133, "label133"); GLADE_HOOKUP_OBJECT (prefs_dialog, label134, "label134"); - GLADE_HOOKUP_OBJECT (prefs_dialog, editor_font, "editor_font"); GLADE_HOOKUP_OBJECT (prefs_dialog, spin_long_line, "spin_long_line"); + GLADE_HOOKUP_OBJECT (prefs_dialog, label156, "label156"); + GLADE_HOOKUP_OBJECT (prefs_dialog, hbox5, "hbox5"); + GLADE_HOOKUP_OBJECT (prefs_dialog, radio_long_line_line, "radio_long_line_line"); + GLADE_HOOKUP_OBJECT (prefs_dialog, radio_long_line_background, "radio_long_line_background"); + GLADE_HOOKUP_OBJECT (prefs_dialog, radio_long_line_disabled, "radio_long_line_disabled"); GLADE_HOOKUP_OBJECT (prefs_dialog, long_line_color, "long_line_color"); - GLADE_HOOKUP_OBJECT (prefs_dialog, label102, "label102"); + GLADE_HOOKUP_OBJECT (prefs_dialog, label155, "label155"); GLADE_HOOKUP_OBJECT (prefs_dialog, label95, "label95"); GLADE_HOOKUP_OBJECT (prefs_dialog, vbox2, "vbox2"); GLADE_HOOKUP_OBJECT (prefs_dialog, label17, "label17");
Modified: trunk/src/prefs.c =================================================================== --- trunk/src/prefs.c 2006-06-30 13:42:53 UTC (rev 510) +++ trunk/src/prefs.c 2006-06-30 14:28:32 UTC (rev 511) @@ -156,6 +156,14 @@ 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); @@ -370,6 +378,18 @@ 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"); @@ -458,30 +478,25 @@ utils_widget_show_hide(lookup_widget(app->window, "separatortoolitem5"), app->pref_main_show_goto); utils_treeviews_showhide();
- // re-colorize all open documents, if tab width or long line settings have changed -/* if ((app->pref_editor_tab_width != old_tab_width) || - (! utils_strcmp(app->long_line_color, old_long_line_color)) || - (app->long_line_column != old_long_line_column)) + // re-colourise all open documents, if tab width or long line settings have changed + for (i = 0; i < GEANY_MAX_OPEN_FILES; i++) { - gint i; -*/ for (i = 0; i < GEANY_MAX_OPEN_FILES; i++) + if (doc_list[i].is_valid) { - if (doc_list[i].is_valid) - { - sci_set_tab_width(doc_list[i].sci, app->pref_editor_tab_width); - sci_set_mark_long_lines(doc_list[i].sci, app->long_line_column, app->long_line_color); - sci_set_visible_eols(doc_list[i].sci, app->pref_editor_show_line_endings); - sci_set_indentionguides(doc_list[i].sci, app->pref_editor_show_indent_guide); - sci_set_visible_white_spaces(doc_list[i].sci, app->pref_editor_show_white_space); - sci_set_folding_margin_visible(doc_list[i].sci, app->pref_editor_folding); - if (! app->pref_editor_folding) document_unfold_all(i); - } -// } - old_tab_width = app->pref_editor_tab_width; - old_long_line_column = app->long_line_column; - g_free(old_long_line_color); - old_long_line_color = g_strdup(app->long_line_color); + sci_set_tab_width(doc_list[i].sci, app->pref_editor_tab_width); + sci_set_mark_long_lines(doc_list[i].sci, app->long_line_type, + app->long_line_column, app->long_line_color); + sci_set_visible_eols(doc_list[i].sci, app->pref_editor_show_line_endings); + sci_set_indentionguides(doc_list[i].sci, app->pref_editor_show_indent_guide); + sci_set_visible_white_spaces(doc_list[i].sci, app->pref_editor_show_white_space); + sci_set_folding_margin_visible(doc_list[i].sci, app->pref_editor_folding); + if (! app->pref_editor_folding) document_unfold_all(i); + } } + old_tab_width = app->pref_editor_tab_width; + old_long_line_column = app->long_line_column; + g_free(old_long_line_color); + old_long_line_color = g_strdup(app->long_line_color);
// store all settings configuration_save();
Modified: trunk/src/sciwrappers.c =================================================================== --- trunk/src/sciwrappers.c 2006-06-30 13:42:53 UTC (rev 510) +++ trunk/src/sciwrappers.c 2006-06-30 14:28:32 UTC (rev 511) @@ -50,18 +50,29 @@ } }
-void sci_set_mark_long_lines(ScintillaObject * sci, gint column, const gchar *color) +void sci_set_mark_long_lines(ScintillaObject * sci, gint type, gint column, const gchar *color) { - if (column > 0) + if (column == 0) type = 2; + switch (type) { - SSM(sci, SCI_SETEDGEMODE, EDGE_LINE, 0); - SSM(sci, SCI_SETEDGECOLUMN, column - 1, 0); - SSM(sci, SCI_SETEDGECOLOUR, utils_get_int_from_hexcolor(color), 0); + case 0: + { + SSM(sci, SCI_SETEDGEMODE, EDGE_LINE, 0); + break; + } + case 1: + { + SSM(sci, SCI_SETEDGEMODE, EDGE_BACKGROUND, 0); + break; + } + case 2: + { + SSM(sci, SCI_SETEDGEMODE, EDGE_NONE, 0); + return; + } } - else - { - SSM(sci, SCI_SETEDGEMODE, EDGE_NONE, 0); - } + SSM(sci, SCI_SETEDGECOLUMN, column - 1, 0); + SSM(sci, SCI_SETEDGECOLOUR, utils_get_int_from_hexcolor(color), 0); }
Modified: trunk/src/sciwrappers.h =================================================================== --- trunk/src/sciwrappers.h 2006-06-30 13:42:53 UTC (rev 510) +++ trunk/src/sciwrappers.h 2006-06-30 14:28:32 UTC (rev 511) @@ -27,7 +27,7 @@
void sci_set_line_numbers (ScintillaObject* sci, gboolean set, gint extra_width); -void sci_set_mark_long_lines (ScintillaObject* sci, gint column, const gchar *color); +void sci_set_mark_long_lines (ScintillaObject* sci, gint type, gint column, const gchar *color); void sci_set_text (ScintillaObject* sci, const gchar* text); void sci_add_text (ScintillaObject* sci, const gchar* text); void sci_add_text_buffer (ScintillaObject* sci, const gchar* text, gint len);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.