SF.net SVN: geany: [1444] trunk
eht16 at users.sourceforge.net
eht16 at xxxxx
Tue Apr 10 17:06:58 UTC 2007
Revision: 1444
http://svn.sourceforge.net/geany/?rev=1444&view=rev
Author: eht16
Date: 2007-04-10 10:06:57 -0700 (Tue, 10 Apr 2007)
Log Message:
-----------
Added options to show or hide the statusbar as well as the editor scrollbars.
Added sci_set_scrollbar_mode() to easily show or hide the scrollbars.
Modified Paths:
--------------
trunk/ChangeLog
trunk/geany.glade
trunk/src/document.c
trunk/src/geany.h
trunk/src/interface.c
trunk/src/keyfile.c
trunk/src/main.c
trunk/src/prefs.c
trunk/src/sciwrappers.c
trunk/src/sciwrappers.h
trunk/src/ui_utils.c
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2007-04-08 16:38:46 UTC (rev 1443)
+++ trunk/ChangeLog 2007-04-10 17:06:57 UTC (rev 1444)
@@ -1,3 +1,13 @@
+2007-04-10 Enrico Tröger <enrico.troeger at uvena.de>
+
+ * geany.glade, src/document.c, src/geany.h, src/interface.c,
+ src/keyfile.c, src/main.c, src/prefs.c, src/ui_utils.c:
+ Added options to show or hide the statusbar as well as the editor
+ scrollbars.
+ * src/sciwrappers.c, src/sciwrappers.h:
+ Added sci_set_scrollbar_mode() to easily show or hide the scrollbars.
+
+
2007-04-08 Enrico Tröger <enrico.troeger at uvena.de>
* configure.in, Makefile.am, doc/Makefile.am, scintilla/Makefile.am,
Modified: trunk/geany.glade
===================================================================
--- trunk/geany.glade 2007-04-08 16:38:46 UTC (rev 1443)
+++ trunk/geany.glade 2007-04-10 17:06:57 UTC (rev 1444)
@@ -3777,6 +3777,93 @@
<property name="fill">True</property>
</packing>
</child>
+
+ <child>
+ <widget class="GtkFrame" id="frame23">
+ <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="alignment26">
+ <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="GtkVBox" id="vbox22">
+ <property name="visible">True</property>
+ <property name="homogeneous">False</property>
+ <property name="spacing">0</property>
+
+ <child>
+ <widget class="GtkCheckButton" id="check_statusbar_visible">
+ <property name="visible">True</property>
+ <property name="tooltip" translatable="yes">Whether to show the status bar at the bottom of the main window.</property>
+ <property name="can_focus">True</property>
+ <property name="label" translatable="yes">Show statusbar</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="padding">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ </packing>
+ </child>
+
+ <child>
+ <placeholder/>
+ </child>
+
+ <child>
+ <placeholder/>
+ </child>
+ </widget>
+ </child>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkLabel" id="label187">
+ <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>
</widget>
<packing>
<property name="tab_expand">False</property>
Modified: trunk/src/document.c
===================================================================
--- trunk/src/document.c 2007-04-08 16:38:46 UTC (rev 1443)
+++ trunk/src/document.c 2007-04-10 17:06:57 UTC (rev 1444)
@@ -300,6 +300,7 @@
sci_set_symbol_margin(sci, app->show_markers_margin);
sci_set_line_numbers(sci, app->show_linenumber_margin, 0);
sci_set_lines_wrapped(sci, app->pref_editor_line_breaking);
+ sci_set_scrollbar_mode(sci, app->pref_editor_show_scrollbars);
// signal for insert-key(works without too, but to update the right status bar)
//g_signal_connect((GtkWidget*) sci, "key-press-event",
Modified: trunk/src/geany.h
===================================================================
--- trunk/src/geany.h 2007-04-08 16:38:46 UTC (rev 1443)
+++ trunk/src/geany.h 2007-04-10 17:06:57 UTC (rev 1444)
@@ -91,6 +91,7 @@
gboolean sidebar_symbol_visible;
gboolean sidebar_openfiles_visible;
gboolean sidebar_visible;
+ gboolean statusbar_visible;
gboolean msgwindow_visible;
gboolean fullscreen;
gboolean beep_on_errors;
@@ -115,6 +116,7 @@
gboolean pref_editor_auto_complete_constructs;
gboolean pref_editor_folding;
gboolean pref_editor_unfold_all_children;
+ gboolean pref_editor_show_scrollbars;
gint pref_editor_tab_width;
gboolean pref_editor_use_tabs;
gint pref_editor_default_encoding;
Modified: trunk/src/interface.c
===================================================================
--- trunk/src/interface.c 2007-04-08 16:38:46 UTC (rev 1443)
+++ trunk/src/interface.c 2007-04-10 17:06:57 UTC (rev 1444)
@@ -2363,6 +2363,11 @@
GtkWidget *combo_tab_sidebar;
GtkWidget *combo_tab_editor;
GtkWidget *label158;
+ GtkWidget *frame23;
+ GtkWidget *alignment26;
+ GtkWidget *vbox22;
+ GtkWidget *check_statusbar_visible;
+ GtkWidget *label187;
GtkWidget *label157;
GtkWidget *vbox15;
GtkWidget *frame12;
@@ -2826,6 +2831,30 @@
gtk_frame_set_label_widget (GTK_FRAME (frame9), label158);
gtk_label_set_use_markup (GTK_LABEL (label158), TRUE);
+ frame23 = gtk_frame_new (NULL);
+ gtk_widget_show (frame23);
+ gtk_box_pack_start (GTK_BOX (vbox14), frame23, TRUE, TRUE, 0);
+ gtk_frame_set_shadow_type (GTK_FRAME (frame23), GTK_SHADOW_NONE);
+
+ alignment26 = gtk_alignment_new (0.5, 0.5, 1, 1);
+ gtk_widget_show (alignment26);
+ gtk_container_add (GTK_CONTAINER (frame23), alignment26);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (alignment26), 0, 0, 12, 0);
+
+ vbox22 = gtk_vbox_new (FALSE, 0);
+ gtk_widget_show (vbox22);
+ gtk_container_add (GTK_CONTAINER (alignment26), vbox22);
+
+ check_statusbar_visible = gtk_check_button_new_with_mnemonic (_("Show statusbar"));
+ gtk_widget_show (check_statusbar_visible);
+ gtk_box_pack_start (GTK_BOX (vbox22), check_statusbar_visible, FALSE, FALSE, 0);
+ gtk_tooltips_set_tip (tooltips, check_statusbar_visible, _("Whether to show the status bar at the bottom of the main window."), NULL);
+
+ label187 = gtk_label_new (_("<b>Miscellaneous</b>"));
+ gtk_widget_show (label187);
+ gtk_frame_set_label_widget (GTK_FRAME (frame23), label187);
+ gtk_label_set_use_markup (GTK_LABEL (label187), TRUE);
+
label157 = gtk_label_new (_("Interface"));
gtk_widget_show (label157);
gtk_notebook_set_tab_label (GTK_NOTEBOOK (notebook2), gtk_notebook_get_nth_page (GTK_NOTEBOOK (notebook2), 1), label157);
@@ -3836,6 +3865,11 @@
GLADE_HOOKUP_OBJECT (prefs_dialog, combo_tab_sidebar, "combo_tab_sidebar");
GLADE_HOOKUP_OBJECT (prefs_dialog, combo_tab_editor, "combo_tab_editor");
GLADE_HOOKUP_OBJECT (prefs_dialog, label158, "label158");
+ GLADE_HOOKUP_OBJECT (prefs_dialog, frame23, "frame23");
+ GLADE_HOOKUP_OBJECT (prefs_dialog, alignment26, "alignment26");
+ GLADE_HOOKUP_OBJECT (prefs_dialog, vbox22, "vbox22");
+ GLADE_HOOKUP_OBJECT (prefs_dialog, check_statusbar_visible, "check_statusbar_visible");
+ GLADE_HOOKUP_OBJECT (prefs_dialog, label187, "label187");
GLADE_HOOKUP_OBJECT (prefs_dialog, label157, "label157");
GLADE_HOOKUP_OBJECT (prefs_dialog, vbox15, "vbox15");
GLADE_HOOKUP_OBJECT (prefs_dialog, frame12, "frame12");
Modified: trunk/src/keyfile.c
===================================================================
--- trunk/src/keyfile.c 2007-04-08 16:38:46 UTC (rev 1443)
+++ trunk/src/keyfile.c 2007-04-10 17:06:57 UTC (rev 1444)
@@ -103,9 +103,11 @@
g_key_file_set_boolean(config, PACKAGE, "sidebar_symbol_visible", app->sidebar_symbol_visible);
g_key_file_set_boolean(config, PACKAGE, "sidebar_openfiles_visible", app->sidebar_openfiles_visible);
g_key_file_set_boolean(config, PACKAGE, "sidebar_visible", app->sidebar_visible);
+ g_key_file_set_boolean(config, PACKAGE, "statusbar_visible", app->statusbar_visible);
g_key_file_set_boolean(config, PACKAGE, "msgwindow_visible", app->msgwindow_visible);
g_key_file_set_boolean(config, PACKAGE, "use_folding", app->pref_editor_folding);
g_key_file_set_boolean(config, PACKAGE, "unfold_all_children", app->pref_editor_unfold_all_children);
+ g_key_file_set_boolean(config, PACKAGE, "show_editor_scrollbars", app->pref_editor_show_scrollbars);
g_key_file_set_integer(config, PACKAGE, "indention_mode", app->pref_editor_indention_mode);
g_key_file_set_boolean(config, PACKAGE, "use_tab_to_indent", app->use_tab_to_indent);
g_key_file_set_boolean(config, PACKAGE, "use_indicators", app->pref_editor_use_indicators);
@@ -320,6 +322,7 @@
app->sidebar_symbol_visible = utils_get_setting_boolean(config, PACKAGE, "sidebar_symbol_visible", TRUE);
app->sidebar_openfiles_visible = utils_get_setting_boolean(config, PACKAGE, "sidebar_openfiles_visible", TRUE);
app->sidebar_visible = utils_get_setting_boolean(config, PACKAGE, "sidebar_visible", TRUE);
+ app->statusbar_visible = utils_get_setting_boolean(config, PACKAGE, "statusbar_visible", TRUE);
app->msgwindow_visible = utils_get_setting_boolean(config, PACKAGE, "msgwindow_visible", TRUE);
app->pref_editor_line_breaking = utils_get_setting_boolean(config, PACKAGE, "line_breaking", FALSE); //default is off for better performance
app->pref_editor_indention_mode = utils_get_setting_integer(config, PACKAGE, "indention_mode", INDENT_ADVANCED);
@@ -333,6 +336,7 @@
app->pref_editor_auto_complete_symbols = utils_get_setting_boolean(config, PACKAGE, "auto_complete_symbols", TRUE);
app->pref_editor_folding = utils_get_setting_boolean(config, PACKAGE, "use_folding", TRUE);
app->pref_editor_unfold_all_children = utils_get_setting_boolean(config, PACKAGE, "unfold_all_children", FALSE);
+ app->pref_editor_show_scrollbars = utils_get_setting_boolean(config, PACKAGE, "show_editor_scrollbars", FALSE);
app->show_markers_margin = utils_get_setting_boolean(config, PACKAGE, "show_markers_margin", TRUE);
app->show_linenumber_margin = utils_get_setting_boolean(config, PACKAGE, "show_linenumber_margin", TRUE);
app->fullscreen = utils_get_setting_boolean(config, PACKAGE, "fullscreen", FALSE);
Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c 2007-04-08 16:38:46 UTC (rev 1443)
+++ trunk/src/main.c 2007-04-10 17:06:57 UTC (rev 1444)
@@ -207,6 +207,12 @@
gtk_window_set_default_size(GTK_WINDOW(app->window), app->geometry[2], app->geometry[3]);
}
+ // hide statusbar if desired
+ if (! app->statusbar_visible)
+ {
+ gtk_widget_hide(app->statusbar);
+ }
+
app->ignore_callback = TRUE;
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(
lookup_widget(app->window, "menu_line_breaking1")), app->pref_editor_line_breaking);
Modified: trunk/src/prefs.c
===================================================================
--- trunk/src/prefs.c 2007-04-08 16:38:46 UTC (rev 1443)
+++ trunk/src/prefs.c 2007-04-10 17:06:57 UTC (rev 1444)
@@ -155,7 +155,10 @@
widget = lookup_widget(app->prefs_dialog, "combo_tab_sidebar");
gtk_combo_box_set_active(GTK_COMBO_BOX(widget), app->tab_pos_sidebar);
+ widget = lookup_widget(app->prefs_dialog, "check_statusbar_visible");
+ gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->statusbar_visible);
+
// Toolbar settings
widget = lookup_widget(app->prefs_dialog, "check_toolbar_show");
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget), app->toolbar_visible);
@@ -466,7 +469,10 @@
widget = lookup_widget(app->prefs_dialog, "combo_tab_sidebar");
app->tab_pos_sidebar = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
+ widget = lookup_widget(app->prefs_dialog, "check_statusbar_visible");
+ app->statusbar_visible = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
+
// Toolbar settings
widget = lookup_widget(app->prefs_dialog, "check_toolbar_show");
app->toolbar_visible = gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(widget));
@@ -668,6 +674,14 @@
gtk_toolbar_set_style(GTK_TOOLBAR(app->toolbar), app->toolbar_icon_style);
ui_treeviews_show_hide(FALSE);
gtk_notebook_set_show_tabs(GTK_NOTEBOOK(app->notebook), app->show_notebook_tabs);
+ // handle statusbar visibility
+ if (app->statusbar_visible)
+ {
+ gtk_widget_show(app->statusbar);
+ ui_update_statusbar(-1, -1);
+ }
+ else
+ gtk_widget_hide(app->statusbar);
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);
Modified: trunk/src/sciwrappers.c
===================================================================
--- trunk/src/sciwrappers.c 2007-04-08 16:38:46 UTC (rev 1443)
+++ trunk/src/sciwrappers.c 2007-04-10 17:06:57 UTC (rev 1444)
@@ -935,3 +935,9 @@
SSM(sci, SCI_SETSELECTIONMODE, mode, 0);
}
+void sci_set_scrollbar_mode(ScintillaObject *sci, gboolean visible)
+{
+ SSM(sci, SCI_SETHSCROLLBAR, visible, 0);
+ SSM(sci, SCI_SETVSCROLLBAR, visible, 0);
+}
+
Modified: trunk/src/sciwrappers.h
===================================================================
--- trunk/src/sciwrappers.h 2007-04-08 16:38:46 UTC (rev 1443)
+++ trunk/src/sciwrappers.h 2007-04-10 17:06:57 UTC (rev 1444)
@@ -174,4 +174,6 @@
void sci_set_tab_indents (ScintillaObject * sci, gboolean set);
void sci_set_use_tabs (ScintillaObject * sci, gboolean set);
+void sci_set_scrollbar_mode (ScintillaObject * sci, gboolean visible);
+
#endif
Modified: trunk/src/ui_utils.c
===================================================================
--- trunk/src/ui_utils.c 2007-04-08 16:38:46 UTC (rev 1443)
+++ trunk/src/ui_utils.c 2007-04-10 17:06:57 UTC (rev 1444)
@@ -81,6 +81,9 @@
gchar string[512];
va_list args;
+ if (! app->statusbar_visible)
+ return; // just do nothing if statusbar is not visible
+
va_start(args, format);
g_vsnprintf(string, 512, format, args);
va_end(args);
@@ -96,9 +99,12 @@
const gchar *cur_tag;
guint line, col;
+ if (! app->statusbar_visible)
+ return; // just do nothing if statusbar is not visible
+
if (idx == -1) idx = document_get_cur_idx();
- if (idx >= 0 && doc_list[idx].is_valid)
+ if (DOC_IDX_VALID(idx))
{
utils_get_current_function(idx, &cur_tag);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Commits
mailing list