Revision: 4357 http://geany.svn.sourceforge.net/geany/?rev=4357&view=rev Author: ntrel Date: 2009-10-23 16:18:05 +0000 (Fri, 23 Oct 2009)
Log Message: ----------- Add sidebar position interface pref.
Modified Paths: -------------- trunk/ChangeLog trunk/doc/geany.html trunk/doc/geany.txt trunk/geany.glade trunk/src/interface.c trunk/src/keyfile.c trunk/src/main.c trunk/src/prefs.c trunk/src/ui_utils.c trunk/src/ui_utils.h
Modified: trunk/ChangeLog =================================================================== --- trunk/ChangeLog 2009-10-23 11:32:27 UTC (rev 4356) +++ trunk/ChangeLog 2009-10-23 16:18:05 UTC (rev 4357) @@ -1,3 +1,11 @@ +2009-10-23 Nick Treleaven <nick(dot)treleaven(at)btinternet(dot)com> + + * src/interface.c, src/ui_utils.h, src/prefs.c, src/keyfile.c, + src/main.c, src/ui_utils.c, doc/geany.txt, doc/geany.html, + geany.glade: + Add sidebar position interface pref. + + 2009-10-23 Lex Trotman <elextr.at.gmail.dot.com>
* doc/geany.txt, doc/geany.html:
Modified: trunk/doc/geany.html =================================================================== --- trunk/doc/geany.html 2009-10-23 11:32:27 UTC (rev 4356) +++ trunk/doc/geany.html 2009-10-23 16:18:05 UTC (rev 4357) @@ -2013,6 +2013,8 @@ <dd>Show all the documents you have open currently. This can be used to change between documents (see <a class="reference" href="#switching-between-documents">Switching between documents</a>) and to perform some common operations such as saving, closing and reloading.</dd> +<dt>Position</dt> +<dd>Whether to place the sidebar on the left or right of the editor window.</dd> </dl> </div> <div class="section"> @@ -5802,7 +5804,7 @@ <div class="footer"> <hr class="footer" /> <a class="reference" href="geany.txt">View document source</a>. -Generated on: 2009-10-22 21:35 UTC. +Generated on: 2009-10-23 16:09 UTC. Generated by <a class="reference" href="http://docutils.sourceforge.net/">Docutils</a> from <a class="reference" href="http://docutils.sourceforge.net/rst.html">reStructuredText</a> source.
</div>
Modified: trunk/doc/geany.txt =================================================================== --- trunk/doc/geany.txt 2009-10-23 11:32:27 UTC (rev 4356) +++ trunk/doc/geany.txt 2009-10-23 16:18:05 UTC (rev 4357) @@ -1690,6 +1690,9 @@ change between documents (see `Switching between documents`_) and to perform some common operations such as saving, closing and reloading.
+Position + Whether to place the sidebar on the left or right of the editor window. + Fonts `````
Modified: trunk/geany.glade =================================================================== --- trunk/geany.glade 2009-10-23 11:32:27 UTC (rev 4356) +++ trunk/geany.glade 2009-10-23 16:18:05 UTC (rev 4357) @@ -3860,6 +3860,83 @@ <property name="fill">False</property> </packing> </child> + + <child> + <widget class="GtkHBox" id="hbox17"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">12</property> + + <child> + <widget class="GtkLabel" id="label237"> + <property name="visible">True</property> + <property name="label" translatable="yes">Position:</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.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="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="radio_sidebar_left"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Left</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">True</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="radio_sidebar_right"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Right</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_sidebar_left</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> + </packing> + </child> </widget> </child> </widget>
Modified: trunk/src/interface.c =================================================================== --- trunk/src/interface.c 2009-10-23 11:32:27 UTC (rev 4356) +++ trunk/src/interface.c 2009-10-23 16:18:05 UTC (rev 4357) @@ -2356,6 +2356,11 @@ GtkWidget *vbox11; GtkWidget *check_list_symbol; GtkWidget *check_list_openfiles; + GtkWidget *hbox17; + GtkWidget *label237; + GtkWidget *radio_sidebar_left; + GSList *radio_sidebar_left_group = NULL; + GtkWidget *radio_sidebar_right; GtkWidget *label146; GtkWidget *frame4; GtkWidget *alignment5; @@ -2990,6 +2995,27 @@ gtk_box_pack_start (GTK_BOX (vbox11), check_list_openfiles, FALSE, FALSE, 0); gtk_tooltips_set_tip (tooltips, check_list_openfiles, _("Toggle the documents list on and off"), NULL);
+ hbox17 = gtk_hbox_new (FALSE, 12); + gtk_widget_show (hbox17); + gtk_box_pack_start (GTK_BOX (vbox11), hbox17, TRUE, TRUE, 0); + + label237 = gtk_label_new (_("Position:")); + gtk_widget_show (label237); + gtk_box_pack_start (GTK_BOX (hbox17), label237, FALSE, FALSE, 0); + + radio_sidebar_left = gtk_radio_button_new_with_mnemonic (NULL, _("Left")); + gtk_widget_show (radio_sidebar_left); + gtk_box_pack_start (GTK_BOX (hbox17), radio_sidebar_left, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_sidebar_left), radio_sidebar_left_group); + radio_sidebar_left_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_sidebar_left)); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (radio_sidebar_left), TRUE); + + radio_sidebar_right = gtk_radio_button_new_with_mnemonic (NULL, _("Right")); + gtk_widget_show (radio_sidebar_right); + gtk_box_pack_start (GTK_BOX (hbox17), radio_sidebar_right, FALSE, FALSE, 0); + gtk_radio_button_set_group (GTK_RADIO_BUTTON (radio_sidebar_right), radio_sidebar_left_group); + radio_sidebar_left_group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio_sidebar_right)); + label146 = gtk_label_new (_("<b>Sidebar</b>")); gtk_widget_show (label146); gtk_frame_set_label_widget (GTK_FRAME (frame7), label146); @@ -4683,6 +4709,10 @@ GLADE_HOOKUP_OBJECT (prefs_dialog, vbox11, "vbox11"); GLADE_HOOKUP_OBJECT (prefs_dialog, check_list_symbol, "check_list_symbol"); GLADE_HOOKUP_OBJECT (prefs_dialog, check_list_openfiles, "check_list_openfiles"); + GLADE_HOOKUP_OBJECT (prefs_dialog, hbox17, "hbox17"); + GLADE_HOOKUP_OBJECT (prefs_dialog, label237, "label237"); + GLADE_HOOKUP_OBJECT (prefs_dialog, radio_sidebar_left, "radio_sidebar_left"); + GLADE_HOOKUP_OBJECT (prefs_dialog, radio_sidebar_right, "radio_sidebar_right"); GLADE_HOOKUP_OBJECT (prefs_dialog, label146, "label146"); GLADE_HOOKUP_OBJECT (prefs_dialog, frame4, "frame4"); GLADE_HOOKUP_OBJECT (prefs_dialog, alignment5, "alignment5");
Modified: trunk/src/keyfile.c =================================================================== --- trunk/src/keyfile.c 2009-10-23 11:32:27 UTC (rev 4356) +++ trunk/src/keyfile.c 2009-10-23 16:18:05 UTC (rev 4357) @@ -122,7 +122,13 @@ stash_group_add_toggle_button(group, &interface_prefs.notebook_double_click_hides_widgets, "notebook_double_click_hides_widgets", FALSE, "check_double_click_hides_widgets"); stash_group_add_integer(group, &interface_prefs.tab_pos_sidebar, "tab_pos_sidebar", GTK_POS_TOP); + stash_group_add_radio_buttons(group, &interface_prefs.sidebar_pos, + "sidebar_pos", GTK_POS_LEFT, + "radio_sidebar_left", GTK_POS_LEFT, + "radio_sidebar_right", GTK_POS_RIGHT, + NULL);
+ /* editor display */ stash_group_add_toggle_button(group, &interface_prefs.highlighting_invert_all, "highlighting_invert_all", FALSE, "check_highlighting_invert");
Modified: trunk/src/main.c =================================================================== --- trunk/src/main.c 2009-10-23 11:32:27 UTC (rev 4356) +++ trunk/src/main.c 2009-10-23 16:18:05 UTC (rev 4357) @@ -212,6 +212,9 @@ gtk_widget_hide(ui_lookup_widget(main_widgets.window, "send_selection_to_vte1")); gtk_widget_hide(ui_lookup_widget(main_widgets.editor_menu, "send_selection_to_vte2")); #endif + + if (interface_prefs.sidebar_pos != GTK_POS_LEFT) + ui_swap_sidebar_pos(); }
Modified: trunk/src/prefs.c =================================================================== --- trunk/src/prefs.c 2009-10-23 11:32:27 UTC (rev 4356) +++ trunk/src/prefs.c 2009-10-23 16:18:05 UTC (rev 4357) @@ -741,6 +741,7 @@ guint i; guint autoclose_brackets[5]; gboolean old_invert_all = interface_prefs.highlighting_invert_all; + gboolean old_sidebar_pos = interface_prefs.sidebar_pos;
/* Synchronize Stash settings */ prefs_action(PREF_UPDATE); @@ -748,6 +749,9 @@ if (interface_prefs.highlighting_invert_all != old_invert_all) filetypes_reload();
+ if (interface_prefs.sidebar_pos != old_sidebar_pos) + ui_swap_sidebar_pos(); + /* General settings */ /* startup */ widget = ui_lookup_widget(ui_widgets.prefs_dialog, "check_load_session");
Modified: trunk/src/ui_utils.c =================================================================== --- trunk/src/ui_utils.c 2009-10-23 11:32:27 UTC (rev 4356) +++ trunk/src/ui_utils.c 2009-10-23 16:18:05 UTC (rev 4357) @@ -1812,6 +1812,24 @@ }
+void ui_swap_sidebar_pos(void) +{ + GtkWidget *pane = ui_lookup_widget(main_widgets.window, "hpaned1"); + GtkWidget *left = gtk_paned_get_child1(GTK_PANED(pane)); + GtkWidget *right = gtk_paned_get_child2(GTK_PANED(pane)); + GtkWidget *box = ui_lookup_widget(main_widgets.window, "vbox1"); + + /* reparenting avoids scintilla problem with middle click paste */ + gtk_widget_reparent(left, box); + gtk_widget_reparent(right, box); + gtk_widget_reparent(right, pane); + gtk_widget_reparent(left, pane); + + gtk_paned_set_position(GTK_PANED(pane), pane->allocation.width + - gtk_paned_get_position(GTK_PANED(pane))); +} + + static void init_recent_files(void) { GtkWidget *toolbar_recent_files_menu;
Modified: trunk/src/ui_utils.h =================================================================== --- trunk/src/ui_utils.h 2009-10-23 11:32:27 UTC (rev 4356) +++ trunk/src/ui_utils.h 2009-10-23 16:18:05 UTC (rev 4357) @@ -52,6 +52,7 @@ gboolean show_symbol_list_expanders; gboolean notebook_double_click_hides_widgets; gboolean highlighting_invert_all; + gint sidebar_pos; } GeanyInterfacePrefs;
@@ -297,4 +298,6 @@
void ui_progress_bar_stop(void);
+void ui_swap_sidebar_pos(void); + #endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.