Author: mhabersack
Date: 2007-06-29 16:01:08 -0400 (Fri, 29 Jun 2007)
New Revision: 81068
Modified:
trunk/moon/desklet/calendar/Makefile
trunk/moon/desklet/calendar/calendar.cs
trunk/moon/desklet/calendar/default.xaml
Log:
close button added
Modified: trunk/moon/desklet/calendar/Makefile
===================================================================
--- trunk/moon/desklet/calendar/Makefile 2007-06-29 20:01:05 UTC (rev
81067)
+++ trunk/moon/desklet/calendar/Makefile 2007-06-29 20:01:08 UTC (rev
81068)
@@ -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/calendar/calendar.cs
===================================================================
--- trunk/moon/desklet/calendar/calendar.cs 2007-06-29 20:01:05 UTC (rev
81067)
+++ trunk/moon/desklet/calendar/calendar.cs 2007-06-29 20:01:08 UTC (rev
81068)
@@ -109,6 +109,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;
@@ -297,8 +302,29 @@
}
+ 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/calendar/default.xaml
===================================================================
--- trunk/moon/desklet/calendar/default.xaml 2007-06-29 20:01:05 UTC (rev
81067)
+++ trunk/moon/desklet/calendar/default.xaml 2007-06-29 20:01:08 UTC (rev
81068)
@@ -34,7 +34,7 @@
</Storyboard>
</Canvas.Resources>
- <Rectangle
+ <Rectangle
Fill="#F0AFAFAF"
x:Name="calendar_rect"
RadiusX="10"
@@ -581,4 +581,8 @@
Foreground="#333333"
Canvas.Top="150"/>
+ <!-- close/drag elements -->
+ <Polygon x:Name="desklet-close" Canvas.Left="207" 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