Author: peter Date: 2007-01-08 19:55:00 +0000 (Mon, 08 Jan 2007) New Revision: 24321
Modified: squeeze/trunk/src/button_drag_box.c squeeze/trunk/src/button_drag_box.h Log: lock filename in place Modified: squeeze/trunk/src/button_drag_box.c =================================================================== --- squeeze/trunk/src/button_drag_box.c 2007-01-08 19:52:42 UTC (rev 24320) +++ squeeze/trunk/src/button_drag_box.c 2007-01-08 19:55:00 UTC (rev 24321) @@ -28,6 +28,9 @@ #define SQ_INDICATOR_SIZE 9 static void +sq_button_drag_box_lock_buttons(SQButtonDragBox *box, guint buttons); + +static void sq_button_drag_box_add_fixed_button(SQButtonDragBox *box, const gchar *label); static void @@ -72,6 +75,8 @@ { GtkWidget *frame; + box->locked_buttons = 0; + box->visible_box = gtk_hbox_new(FALSE, 0); box->hidden_box = gtk_hbox_new(FALSE, 0); @@ -114,6 +119,8 @@ sq_button_drag_box_add_button(SQ_BUTTON_DRAG_BOX(box), "Size", TRUE); sq_button_drag_box_add_button(SQ_BUTTON_DRAG_BOX(box), "Time", TRUE); + sq_button_drag_box_lock_buttons(SQ_BUTTON_DRAG_BOX(box), 1); + return box; } @@ -145,6 +152,12 @@ g_signal_connect(G_OBJECT(button), "focus", G_CALLBACK(cb_signal_blocker), NULL); } +static void +sq_button_drag_box_lock_buttons(SQButtonDragBox *box, guint buttons) +{ + box->locked_buttons = buttons; +} + static GdkPixbuf* sq_create_icon_from_widget(GtkWidget *widget) { @@ -250,6 +263,7 @@ gtk_box_pack_start(GTK_BOX(box->visible_box), source, FALSE, FALSE, 0); gtk_widget_unref(source); + guint button = 0; gint xoffset = box->visible_box->allocation.x; GtkWidget *item; @@ -263,7 +277,8 @@ if(GTK_WIDGET_VISIBLE(item)) { - if(x < (item->allocation.width/2 + item->allocation.x - xoffset)) + button++; + if((box->locked_buttons < button) && (x < (item->allocation.width/2 + item->allocation.x - xoffset))) { break; } @@ -282,6 +297,7 @@ { SQButtonDragBox *box = SQ_BUTTON_DRAG_BOX(user_data); + guint button = 0; gint ix, iy; gint xoffset = box->visible_box->allocation.x; GtkWidget *item; @@ -296,7 +312,8 @@ if(GTK_WIDGET_VISIBLE(item)) { - if(x < (item->allocation.width/2 + item->allocation.x - xoffset)) + button++; + if((box->locked_buttons < button) && (x < (item->allocation.width/2 + item->allocation.x - xoffset))) { ix = item->allocation.x; break; Modified: squeeze/trunk/src/button_drag_box.h =================================================================== --- squeeze/trunk/src/button_drag_box.h 2007-01-08 19:52:42 UTC (rev 24320) +++ squeeze/trunk/src/button_drag_box.h 2007-01-08 19:55:00 UTC (rev 24321) @@ -49,6 +49,7 @@ GtkWidget *hidden_box; GtkTargetEntry entry; GdkWindow *indicator; + guint locked_buttons; }; typedef struct _SQButtonDragBoxClass SQButtonDragBoxClass; _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits