PATCH: desk-guide "show tasklist arrow" option
- From: Jason Leach <jasonleach usa net>
- To: gnome-hackers gnome org
- Cc: Tim Janik <timj gtk org>, George Lebel <jirka 5z com>
- Subject: PATCH: desk-guide "show tasklist arrow" option
- Date: Wed, 31 Jan 2001 19:55:02 -0500
Hey hackers,
Here's a patch that lets the user have a desk-guide without a tasklist
arrow button, which gains some people a little bit of screen real
estate and/or they just don't want an arrow. This feature was a
#gnome request from a while ago and personally I'd like it. Figured
it'd be nice to get it in before 1.4.
I tried to blend with your code style Tim, I think the patch is pretty
clean and straightforward.
Try it out. Let me know if it's okay to commit.
Thanks,
Jason.
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/gnome-core/applets/desk-guide/ChangeLog,v
retrieving revision 1.70
diff -u -r1.70 ChangeLog
--- ChangeLog 2000/12/06 04:19:48 1.70
+++ ChangeLog 2001/02/01 00:49:52
@@ -1,3 +1,10 @@
+2001-01-31 Jason Leach <jasonleach usa net>
+
+ * deskguide_applet.c: Added a boolean config option for "Show
+ tasklist arrow", default to true. Also renamed the "Switch
+ tasklist arrow" to a more descriptive "Switch horizontal/vertical
+ position of tasklist arrow".
+
Tue Dec 05 20:08:49 2000 George Lebl <jirka 5z com>
* deskguide_applet.c: bind signals on applet-widget BEFORE
Index: deskguide_applet.c
===================================================================
RCS file: /cvs/gnome/gnome-core/applets/desk-guide/deskguide_applet.c,v
retrieving revision 1.37
diff -u -r1.37 deskguide_applet.c
--- deskguide_applet.c 2000/12/06 04:19:48 1.37
+++ deskguide_applet.c 2001/02/01 00:49:52
@@ -75,8 +75,10 @@
static ConfigItem gp_config_items[] = {
CONFIG_PAGE (N_ ("Display")),
CONFIG_SECTION (sect_layout, N_ ("Layout")),
+ CONFIG_BOOL (show_arrow, TRUE,
+ N_ ("Show tasklist arrow")),
CONFIG_BOOL (switch_arrow, FALSE,
- N_ ("Switch tasklist arrow")),
+ N_ ("Switch horizontal/vertical position of tasklist arrow")),
CONFIG_BOOL (current_only, FALSE,
N_ ("Only show current desktop in pager")),
CONFIG_BOOL (raise_grid, FALSE,
@@ -767,7 +769,9 @@
GtkWidget *button, *abox, *arrow;
gboolean arrow_at_end = FALSE;
GtkWidget *main_box;
-
+
+ abox = NULL;
+
gtk_widget_set_usize (gp_container, 0, 0);
gp_panel_size = applet_widget_get_panel_pixel_size (APPLET_WIDGET (gp_applet));
gp_panel_size = MAX (gp_panel_size, 12);
@@ -832,13 +836,17 @@
/* provide box for arrow and button
*/
- abox = gtk_widget_new (GP_TYPE_VBOX,
- "visible", TRUE,
- "spacing", 0,
- NULL);
- (BOOL_CONFIG (switch_arrow)
- ? gtk_box_pack_end
- : gtk_box_pack_start) (GTK_BOX (main_box), abox, FALSE, TRUE, 0);
+ if (BOOL_CONFIG (show_arrow))
+ {
+ abox = gtk_widget_new (GP_TYPE_VBOX,
+ "visible", TRUE,
+ "spacing", 0,
+ NULL);
+
+ (BOOL_CONFIG (switch_arrow)
+ ? gtk_box_pack_end
+ : gtk_box_pack_start) (GTK_BOX (main_box), abox, FALSE, TRUE, 0);
+ }
/* provide desktop widget container
*/
@@ -856,26 +864,29 @@
/* add arrow and button
*/
- arrow = gtk_widget_new (GTK_TYPE_ARROW,
- "visible", TRUE,
- "arrow_type", GP_ARROW_DIR,
+ if (BOOL_CONFIG (show_arrow))
+ {
+ arrow = gtk_widget_new (GTK_TYPE_ARROW,
+ "visible", TRUE,
+ "arrow_type", GP_ARROW_DIR,
+ NULL);
+ button = gtk_widget_new (GTK_TYPE_BUTTON,
+ "visible", TRUE,
+ "can_focus", FALSE,
+ "child", arrow,
+ "signal::clicked", gp_widget_button_toggle_task_list, NULL,
+ "signal::event", gp_widget_ignore_button, GUINT_TO_POINTER (2),
+ "signal::event", gp_widget_ignore_button, GUINT_TO_POINTER (3),
+ NULL);
+ gtk_tooltips_set_tip (gp_tooltips,
+ button,
+ DESK_GUIDE_NAME,
NULL);
- button = gtk_widget_new (GTK_TYPE_BUTTON,
- "visible", TRUE,
- "can_focus", FALSE,
- "child", arrow,
- "signal::clicked", gp_widget_button_toggle_task_list, NULL,
- "signal::event", gp_widget_ignore_button, GUINT_TO_POINTER (2),
- "signal::event", gp_widget_ignore_button, GUINT_TO_POINTER (3),
- NULL);
- gtk_tooltips_set_tip (gp_tooltips,
- button,
- DESK_GUIDE_NAME,
- NULL);
- (arrow_at_end
- ? gtk_box_pack_end
- : gtk_box_pack_start) (GTK_BOX (abox), button, TRUE, TRUE, 0);
-
+ (arrow_at_end
+ ? gtk_box_pack_end
+ : gtk_box_pack_start) (GTK_BOX (abox), button, TRUE, TRUE, 0);
+ }
+
/* desktop pagers
*/
gp_create_desk_widgets ();
@@ -940,6 +951,10 @@
!BOOL_TMP_CONFIG (abandon_area_width));
gtk_widget_set_sensitive (CONFIG_WIDGET (toplevel, thumb_nail_delay),
BOOL_TMP_CONFIG (enable_thumb_nails));
+ gtk_widget_set_sensitive (CONFIG_WIDGET (toplevel, switch_arrow),
+ BOOL_TMP_CONFIG (show_arrow));
+ gtk_widget_set_sensitive (CONFIG_WIDGET (toplevel, task_view_popdown_request),
+ BOOL_TMP_CONFIG (show_arrow));
}
static void
[Date Prev][
Date Next] [Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]