]> Eric's Git Repo - ericdock.git/commitdiff
Fixed up clock rendering and icons
authorEric Wertz <ericdwertz@gmail.com>
Fri, 7 Oct 2016 15:48:00 +0000 (11:48 -0400)
committerEric Wertz <ericdwertz@gmail.com>
Fri, 7 Oct 2016 15:48:00 +0000 (11:48 -0400)
clock.h
dock_icon.h
main.c
pager_item.h

diff --git a/clock.h b/clock.h
index a82c2af0681042b3bab99ae3673ccd146682865d..0692d891aeb773ccb9308be44d511d5af663a595 100644 (file)
--- a/clock.h
+++ b/clock.h
@@ -96,14 +96,14 @@ void clock_draw_timestring(cairo_t* cr, double x, double y, int blurpass)
     sprintf(timestring,"%i:%02i%s",hour, minute, ampm);
     cairo_text_extents(cr,timestring,&extents);
     text_x-=extents.x_advance;
-    cairo_move_to(cr,text_x, y + extents.y_bearing + extents.height - SCALE_VALUE( 2.0 ) );
+    cairo_move_to(cr,text_x, y - SCALE_VALUE( 4.0 ) );
     cairo_text_path(cr,timestring);
 
-    sprintf(timestring,"%02i/%02i/%02i", 
-            timeinfo->tm_mon, timeinfo->tm_mday, timeinfo->tm_year + 1900 );
+    sprintf(timestring,"%i/%02i/%02i", 
+            timeinfo->tm_mon+1, timeinfo->tm_mday, timeinfo->tm_year + 1900 );
     cairo_text_extents(cr,timestring,&extents);
     text_x = x - extents.x_advance;
-    cairo_move_to(cr,text_x, y - extents.y_bearing + SCALE_VALUE( 2.0 ) );
+    cairo_move_to(cr,text_x, y - extents.y_bearing + SCALE_VALUE( 4.0 ) );
     cairo_text_path(cr,timestring);
 
     //sprintf(timestring,"%s, %s %i, %i",weekday_names[timeinfo->tm_wday],month_names[timeinfo->tm_mon],timeinfo->tm_mday,timeinfo->tm_year+1900);
index 2f376f6a9b628ba6c9e7783de4d90f0126d93b9f..16a18df7f7daf445f29fdf02690e5d3054f2a47b 100644 (file)
@@ -110,6 +110,9 @@ void dock_icon_activate( dock_icon* icon, Time time, int from_click )
         wnck_window_activate( item->window, time );
         tooltip_window_hide();
     }
+
+    if( icon->icon_state == ICON_STATE_ALERT )
+        icon->icon_state = ICON_STATE_NORMAL;
 }
 
 void dock_icon_mouse_down( dock_icon* icon, double mx, double my, Time time )
diff --git a/main.c b/main.c
index b8c1ee8a7a297e87ced4a004eaa8f0b216f6815d..c55b76535103c7216ef0544148834a4a1c11c004 100644 (file)
--- a/main.c
+++ b/main.c
@@ -18,6 +18,7 @@
 #define ICON_STATE_NORMAL 0
 #define ICON_STATE_HOVER 1
 #define ICON_STATE_ACTIVE 2
+#define ICON_STATE_ALERT 3
 
 GList* dock_icons = NULL;
 eric_window* dock_window = NULL;
index 7121ba49fe81089ffe1fa8e6b9aacc25cc79dbe2..eb56e78c0cf97f72fa1f9605d7b1a2bcfb407cbc 100644 (file)
@@ -32,6 +32,11 @@ void pager_item_icon_changed( WnckWindow* window, pager_item* item )
     item->icon_pixbuf = wnck_window_get_mini_icon( window );
 }
 
+void pager_item_state_changed( WnckWindow* window, WnckWindowState changed_mask, WnckWindowState new_state, pager_item* item )
+{
+    //item->icon_pixbuf = wnck_window_get_mini_icon( window );
+}
+
 pager_item* pager_item_create( WnckWindow* window )
 {
     pager_item* item = malloc( sizeof( pager_item ) );
@@ -41,7 +46,8 @@ pager_item* pager_item_create( WnckWindow* window )
     item->icon_state = ICON_STATE_NORMAL;
 
     g_signal_connect( G_OBJECT( window ), "name-changed", G_CALLBACK( pager_item_name_changed ), (gpointer)item );
-    g_signal_connect( G_OBJECT( window ), "icon-changed", G_CALLBACK( pager_item_name_changed ), (gpointer)item );
+    g_signal_connect( G_OBJECT( window ), "icon-changed", G_CALLBACK( pager_item_icon_changed ), (gpointer)item );
+    g_signal_connect( G_OBJECT( window ), "state-changed", G_CALLBACK( pager_item_state_changed ), (gpointer)item );
 
     item->width = SCALE_VALUE( 320 );
     item->height = SCALE_VALUE( 24.0 );