SF.net SVN: geany: [1503] trunk

eht16 at users.sourceforge.net eht16 at xxxxx
Fri May 4 15:33:08 UTC 2007


Revision: 1503
          http://svn.sourceforge.net/geany/?rev=1503&view=rev
Author:   eht16
Date:     2007-05-04 08:33:07 -0700 (Fri, 04 May 2007)

Log Message:
-----------
Set widget names for the main widgets to allow users to define custom styles in .gtkrc-2.0.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/doc/geany.docbook
    trunk/src/main.c
    trunk/src/prefs.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2007-05-03 16:13:30 UTC (rev 1502)
+++ trunk/ChangeLog	2007-05-04 15:33:07 UTC (rev 1503)
@@ -1,3 +1,10 @@
+2007-05-04  Enrico Tröger  <enrico.troeger at uvena.de>
+
+ * doc/geany.docbook, src/main.c, src/prefs.c:
+   Set widget names for the main widgets to allow users to define custom
+   styles in .gtkrc-2.0.
+
+
 2007-05-03  Nick Treleaven  <nick.treleaven at btinternet.com>
 
  * src/keybindings.c, src/keybindings.h:

Modified: trunk/doc/geany.docbook
===================================================================
--- trunk/doc/geany.docbook	2007-05-03 16:13:30 UTC (rev 1502)
+++ trunk/doc/geany.docbook	2007-05-04 15:33:07 UTC (rev 1503)
@@ -416,6 +416,56 @@
 					</para>
 				</note>
 			</section>
+			<section id="general_userstyles">
+				<title>Defining own widget styles using .gtkrc-2.0</title>
+				<para>
+					You can  define your widget style for many of <application>Geany</application>'s
+					GUI parts. To do this, just edit your <filename>.gtkrc-2.0</filename> (usually
+					found in your home directory on UNIX-like systems and in the etc subdirecory
+					of your <application>Geany</application> installation on Windows).
+				</para>
+				<para>
+					To get a defined style get noticed by <application>Geany</application> you must
+					it assign to one of <application>Geany</application>'s widgets. To do so,
+					use the following line:
+				</para>
+				<para>
+					<command>widget "Geany*" style "geany_style"</command>
+				</para>
+				<para>
+					This would assign your already defined style "geany_style" to all
+					<application>Geany</application> widgets. You can also assign styles only to
+					specific widgets. At the moment you can use the following widgets:
+					<orderedlist numeration="arabic">
+						<listitem>
+							<para>GeanyMainWindow</para>
+						</listitem>
+						<listitem>
+							<para>GeanyEditMenu</para>
+						</listitem>
+						<listitem>
+							<para>GeanyToolbarMenu</para>
+						</listitem>
+						<listitem>
+							<para>GeanyPrefsDialog</para>
+						</listitem>
+					</orderedlist>
+				</para>
+				<para>Example of a simple .gtkrc-2.0:
+					<programlisting>style "geanyStyle"
+{
+	font_name="Sans 12"
+}
+widget "GeanyMainWindow" style "geanyStyle"
+
+style "geanyStyle"
+{
+	font_name="Sans 10"
+}
+widget "GeanyPrefsDialog" style "geanyStyle"
+</programlisting>
+				</para>
+			</section>
 		</section>
 		<section id="charset">
 			<title>Character sets and Unicode Byte-Order-Mark (BOM)</title>

Modified: trunk/src/main.c
===================================================================
--- trunk/src/main.c	2007-05-03 16:13:30 UTC (rev 1502)
+++ trunk/src/main.c	2007-05-04 15:33:07 UTC (rev 1503)
@@ -339,6 +339,11 @@
 	app->undo_items[0] = lookup_widget(app->popup_menu, "undo1");
 	app->undo_items[1] = lookup_widget(app->window, "menu_undo2");
 	app->undo_items[2] = lookup_widget(app->window, "toolbutton_undo");
+
+	// set widget names for matching with .gtkrc-2.0
+	gtk_widget_set_name(app->window, "GeanyMainWindow");
+	gtk_widget_set_name(app->toolbar_menu, "GeanyToolbarMenu");
+	gtk_widget_set_name(app->popup_menu, "GeanyEditMenu");
 }
 
 

Modified: trunk/src/prefs.c
===================================================================
--- trunk/src/prefs.c	2007-05-03 16:13:30 UTC (rev 1502)
+++ trunk/src/prefs.c	2007-05-04 15:33:07 UTC (rev 1503)
@@ -1014,6 +1014,7 @@
 		gchar *encoding_string;
 
 		app->prefs_dialog = create_prefs_dialog();
+		gtk_widget_set_name(app->prefs_dialog, "GeanyPrefsDialog");
 		gtk_window_set_transient_for(GTK_WINDOW(app->prefs_dialog), GTK_WINDOW(app->window));
 
 		// init the default file encoding combo box


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