Commit 9f527b82 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

added new function gimp_dockable_blink() which lets the dockable's

2005-01-18  Michael Natterer  <mitch@gimp.org>

	* app/widgets/gimpdockable.[ch]: added new function
	gimp_dockable_blink() which lets the dockable's title_area blink.

	* app/widgets/gimpdialogfactory.c
	(gimp_dialog_factory_dialog_new_internal): let wilber blink at the
	user :) Fixes bug #164156.
parent 25268823
2005-01-18 Michael Natterer <mitch@gimp.org>
* app/widgets/gimpdockable.[ch]: added new function
gimp_dockable_blink() which lets the dockable's title_area blink.
* app/widgets/gimpdialogfactory.c
(gimp_dialog_factory_dialog_new_internal): let wilber blink at the
user :) Fixes bug #164156.
2005-01-18 Alexander Shopov <ash@contact.bg>
* configure.in (ALL_LINGUAS): Added "bg" (Bulgarian)
......
......@@ -558,6 +558,8 @@ gimp_dialog_factory_dialog_new_internal (GimpDialogFactory *factory,
toplevel = gtk_widget_get_toplevel (dialog);
gtk_window_present (GTK_WINDOW (toplevel));
gimp_dockable_blink (GIMP_DOCKABLE (dialog));
}
}
}
......
......@@ -87,6 +87,7 @@ static gboolean gimp_dockable_menu_button_press (GtkWidget *button,
static void gimp_dockable_close_clicked (GtkWidget *button,
GimpDockable *dockable);
static gboolean gimp_dockable_show_menu (GimpDockable *dockable);
static gboolean gimp_dockable_blink_timeout (GimpDockable *dockable);
static void gimp_dockable_title_changed (GimpDocked *docked,
GimpDockable *dockable);
......@@ -281,6 +282,13 @@ gimp_dockable_destroy (GtkObject *object)
dockable->close_button = NULL;
}
if (dockable->blink_timeout_id)
{
g_source_remove (dockable->blink_timeout_id);
dockable->blink_timeout_id = 0;
dockable->blink_counter = 0;
}
GTK_OBJECT_CLASS (parent_class)->destroy (object);
}
......@@ -532,6 +540,15 @@ gimp_dockable_expose_event (GtkWidget *widget,
gint text_x;
gint text_y;
if (dockable->blink_counter & 1)
{
gtk_paint_box (widget->style, widget->window,
GTK_STATE_SELECTED, GTK_SHADOW_NONE,
&expose_area, widget, "",
title_area.x, title_area.y,
title_area.width, title_area.height);
}
if (! dockable->title_layout)
{
GtkBin *bin = GTK_BIN (dockable);
......@@ -643,6 +660,9 @@ gimp_dockable_forall (GtkContainer *container,
callback, callback_data);
}
/* public functions */
GtkWidget *
gimp_dockable_new (const gchar *name,
const gchar *blurb,
......@@ -871,6 +891,24 @@ gimp_dockable_detach (GimpDockable *dockable)
gtk_widget_show (dock);
}
void
gimp_dockable_blink (GimpDockable *dockable)
{
g_return_if_fail (GIMP_IS_DOCKABLE (dockable));
if (dockable->blink_timeout_id)
g_source_remove (dockable->blink_timeout_id);
dockable->blink_timeout_id =
g_timeout_add (150, (GSourceFunc) gimp_dockable_blink_timeout,
dockable);
gimp_dockable_blink_timeout (dockable);
}
/* private functions */
static void
gimp_dockable_get_title_area (GimpDockable *dockable,
GdkRectangle *area)
......@@ -1047,6 +1085,29 @@ gimp_dockable_show_menu (GimpDockable *dockable)
return TRUE;
}
static gboolean
gimp_dockable_blink_timeout (GimpDockable *dockable)
{
if (GTK_WIDGET_DRAWABLE (dockable))
{
GdkRectangle area;
gimp_dockable_get_title_area (dockable, &area);
gtk_widget_queue_draw_area (GTK_WIDGET (dockable),
area.x, area.y, area.width, area.height);
}
if (dockable->blink_counter++ > 3)
{
dockable->blink_timeout_id = 0;
dockable->blink_counter = 0;
return FALSE;
}
return TRUE;
}
static void
gimp_dockable_title_changed (GimpDocked *docked,
GimpDockable *dockable)
......
......@@ -54,6 +54,9 @@ struct _GimpDockable
GdkWindow *title_window;
GtkWidget *menu_button;
GtkWidget *close_button;
guint blink_timeout_id;
gint blink_counter;
};
struct _GimpDockableClass
......@@ -87,5 +90,7 @@ GimpUIManager * gimp_dockable_get_menu (GimpDockable *dockable,
void gimp_dockable_detach (GimpDockable *dockable);
void gimp_dockable_blink (GimpDockable *dockable);
#endif /* __GIMP_DOCKABLE_H__ */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment