mousetweaks r249 - in trunk: . src
- From: gerdk svn gnome org
- To: svn-commits-list gnome org
- Subject: mousetweaks r249 - in trunk: . src
- Date: Sat, 23 Aug 2008 18:50:29 +0000 (UTC)
Author: gerdk
Date: Sat Aug 23 18:50:28 2008
New Revision: 249
URL: http://svn.gnome.org/viewvc/mousetweaks?rev=249&view=rev
Log:
2008-08-23 Gerd Kohlberger <gerdk svn gnome org>
* src/mt-main.c:(cursor_overlay_time):
* src/mt-ctw.c:
* src/mt-ctw.h:
Use theme colors for the cursor overlay. Looks nicer and works
better with dark cursor themes.
Modified:
trunk/ChangeLog
trunk/src/mt-ctw.c
trunk/src/mt-ctw.h
trunk/src/mt-main.c
Modified: trunk/src/mt-ctw.c
==============================================================================
--- trunk/src/mt-ctw.c (original)
+++ trunk/src/mt-ctw.c Sat Aug 23 18:50:28 2008
@@ -153,6 +153,12 @@
return TRUE;
}
+GtkWidget *
+mt_ctw_get_window (void)
+{
+ return WID ("ctw");
+}
+
gboolean
mt_ctw_init (MTClosure *mt, gint x, gint y)
{
@@ -166,7 +172,7 @@
if (!xml)
return FALSE;
- ctw = WID ("ctw");
+ ctw = mt_ctw_get_window ();
gtk_window_stick (GTK_WINDOW (ctw));
gtk_window_set_keep_above (GTK_WINDOW (ctw), TRUE);
g_signal_connect (ctw, "delete-event", G_CALLBACK (ctw_delete_cb), mt);
@@ -190,6 +196,7 @@
data = g_slist_nth_data (group, mt->style);
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (data), TRUE);
+ gtk_widget_realize (ctw);
mt_ctw_update_style (mt->style);
mt_ctw_update_sensitivity (mt);
mt_ctw_update_visibility (mt);
Modified: trunk/src/mt-ctw.h
==============================================================================
--- trunk/src/mt-ctw.h (original)
+++ trunk/src/mt-ctw.h Sat Aug 23 18:50:28 2008
@@ -24,14 +24,14 @@
G_BEGIN_DECLS
-gboolean mt_ctw_init (MTClosure *mt,
- gint x,
- gint y);
-void mt_ctw_set_clicktype (guint ct);
-void mt_ctw_update_sensitivity (MTClosure *mt);
-void mt_ctw_update_visibility (MTClosure *mt);
-void mt_ctw_update_style (gint style);
-
+gboolean mt_ctw_init (MTClosure *mt,
+ gint x,
+ gint y);
+GtkWidget * mt_ctw_get_window (void);
+void mt_ctw_set_clicktype (guint ct);
+void mt_ctw_update_sensitivity (MTClosure *mt);
+void mt_ctw_update_visibility (MTClosure *mt);
+void mt_ctw_update_style (gint style);
G_END_DECLS
Modified: trunk/src/mt-main.c
==============================================================================
--- trunk/src/mt-main.c (original)
+++ trunk/src/mt-main.c Sat Aug 23 18:50:28 2008
@@ -359,6 +359,8 @@
MtTimer *timer,
gdouble time)
{
+ GtkWidget *ctw;
+ GdkColor c;
cairo_surface_t *surface;
cairo_t *cr;
gdouble target;
@@ -376,10 +378,17 @@
return FALSE;
}
+ ctw = mt_ctw_get_window ();
+ c = ctw->style->bg[GTK_STATE_SELECTED];
target = mt_timer_get_target (timer);
+
cairo_set_operator (cr, CAIRO_OPERATOR_ATOP);
cairo_rectangle (cr, 0, 0, width, height / (target / time));
- cairo_set_source_rgba (cr, 0., 0., 0., 0.75);
+ cairo_set_source_rgba (cr,
+ c.red / 65535.,
+ c.green / 65535.,
+ c.blue / 65535.,
+ 0.75);
cairo_fill (cr);
cairo_destroy (cr);
cairo_surface_destroy (surface);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]