Author: mhabersack
Date: 2007-06-29 16:18:58 -0400 (Fri, 29 Jun 2007)
New Revision: 81071

Modified:
   trunk/moon/desklet/glassycalendar/Makefile
   trunk/moon/desklet/glassycalendar/calendar.cs
   trunk/moon/desklet/glassycalendar/default.xaml
Log:
added close button


Modified: trunk/moon/desklet/glassycalendar/Makefile
===================================================================
--- trunk/moon/desklet/glassycalendar/Makefile  2007-06-29 20:11:03 UTC (rev 
81070)
+++ trunk/moon/desklet/glassycalendar/Makefile  2007-06-29 20:18:58 UTC (rev 
81071)
@@ -1,4 +1,8 @@
 DESKLET = calendar
 SOURCES = calendar.cs
+EXTRA_ASSEMBLIES = ../desklets.dll
 
 include ../rules.make
+
+postcompile:
+       cp -a ../desklets.dll bin/

Modified: trunk/moon/desklet/glassycalendar/calendar.cs
===================================================================
--- trunk/moon/desklet/glassycalendar/calendar.cs       2007-06-29 20:11:03 UTC 
(rev 81070)
+++ trunk/moon/desklet/glassycalendar/calendar.cs       2007-06-29 20:18:58 UTC 
(rev 81071)
@@ -95,6 +95,11 @@
                static readonly Brush CALENDAR_BRUSH = new SolidColorBrush 
(Colors.Red);
                static readonly Brush CALENDAR_FILL_BRUSH = new SolidColorBrush 
(Color.FromArgb (40, 255, 0, 0));
 
+               Polygon closeButton;
+                
+                Brush buttonHilite = new SolidColorBrush (Color.FromArgb 
(0xAA, 0xFF, 0xFF, 0xFF));
+                Brush buttonNormal = new SolidColorBrush (Color.FromArgb 
(0x66, 0xFF, 0xFF, 0xFF));
+               
                void drawDay (int l, int c, int day, bool mainMonth, bool 
curDay) {
                        days[l, c].Text = day.ToString ();
                        days[l, c].Foreground = mainMonth ? (curDay ? 
CURRENT_DAY : CURRENT_MONTH) : OTHERS;
@@ -282,9 +287,29 @@
                        detailsStoryboard.Begin ();
                }
 
+               void HighlightButton (Polygon button)
+                {
+                        button.Stroke = buttonHilite;
+                }
 
+                void UnhighlightButton (Polygon button)
+                {
+                        button.Stroke = buttonNormal;
+                }
+               
                public void PageLoaded (object o, EventArgs e) 
                {
+                       Mono.Desklets.Desklet.SetupToolbox (this);
+
+                        closeButton = FindName ("desklet-close") as Polygon;
+                        closeButton.MouseEnter += delegate {
+                                HighlightButton (closeButton);
+                        };
+
+                        closeButton.MouseLeave += delegate {
+                                UnhighlightButton (closeButton);
+                        };
+                       
                        monthText = FindName ("month") as TextBlock;
                        detailText = FindName ("detail") as TextBlock;
                        Children.Remove (detailText);                   

Modified: trunk/moon/desklet/glassycalendar/default.xaml
===================================================================
--- trunk/moon/desklet/glassycalendar/default.xaml      2007-06-29 20:11:03 UTC 
(rev 81070)
+++ trunk/moon/desklet/glassycalendar/default.xaml      2007-06-29 20:18:58 UTC 
(rev 81071)
@@ -139,5 +139,8 @@
        <TextBlock x:Name="c5_l4" Text="" FontSize="12" FontWeight="ExtraBlack" 
Canvas.Left="138" Foreground="#333333" Canvas.Top="150"/>
        <TextBlock x:Name="c5_l5" Text="" FontSize="12" FontWeight="ExtraBlack" 
Canvas.Left="168" Foreground="#333333" Canvas.Top="150"/>
        <TextBlock x:Name="c5_l6" Text="" FontSize="12" FontWeight="ExtraBlack" 
Canvas.Left="198" Foreground="#333333" Canvas.Top="150"/>
-
+       <!-- close/drag elements -->
+       <Polygon x:Name="desklet-close" Canvas.Left="202" Canvas.Top="163"
+                Points="4 4 8 8 4 12 6 14 10 10 14 14 16 12 12 8 16 4 14 2 10 
6 6 2 4 4"
+                Stroke="#66FFFFFF" StrokeThickness="3" Fill="#66FFFFFF" />
 </Canvas>

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to