[Goodies-commits] r6725 - in xfce4-notes-plugin/trunk: . panel-plugin
Mike Massonnet
mmassonnet at xfce.org
Fri Feb 20 08:27:28 CET 2009
Author: mmassonnet
Date: 2009-02-20 07:27:28 +0000 (Fri, 20 Feb 2009)
New Revision: 6725
Modified:
xfce4-notes-plugin/trunk/ChangeLog
xfce4-notes-plugin/trunk/panel-plugin/notes.c
Log:
Set default thickness for frame and add two mouse cursors for resizing
Modified: xfce4-notes-plugin/trunk/ChangeLog
===================================================================
--- xfce4-notes-plugin/trunk/ChangeLog 2009-02-19 19:49:42 UTC (rev 6724)
+++ xfce4-notes-plugin/trunk/ChangeLog 2009-02-20 07:27:28 UTC (rev 6725)
@@ -1,3 +1,14 @@
+2009-02-20 Mike Massonnet <mmassonnet at xfce.org>
+
+Set default thickness for frame and add two mouse cursors for resizing
+ * panel-plugin/notes.c(notes_window_new_with_label):
+ - Set default thickness of the frame to x=1 and y=3 so it looks
+ sharp on the left and right side of the window and like a small
+ status bar for the bottom where we display the mouse cursor for
+ resizing
+ * panel-plugin/notes.c(notes_window_motion_event):
+ - Display two more resizing cursors: bottom and bottom left
+
2009-02-19 Mike Massonnet <mmassonnet at xfce.org>
Make window resizable with the mouse
Modified: xfce4-notes-plugin/trunk/panel-plugin/notes.c
===================================================================
--- xfce4-notes-plugin/trunk/panel-plugin/notes.c 2009-02-19 19:49:42 UTC (rev 6724)
+++ xfce4-notes-plugin/trunk/panel-plugin/notes.c 2009-02-20 07:27:28 UTC (rev 6725)
@@ -176,6 +176,7 @@
NotesWindow *notes_window;
GtkWidget *label, *arrow_menu;
+ GtkRcStyle *style;
gchar *window_name_tmp;
gchar *accel_name;
@@ -210,6 +211,10 @@
/* Frame */
notes_window->frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (notes_window->frame), GTK_SHADOW_OUT);
+ style = gtk_widget_get_modifier_style (notes_window->frame);
+ style->xthickness = 1;
+ style->ythickness = 3;
+ gtk_widget_modify_style (notes_window->frame, style);
gtk_container_add (GTK_CONTAINER (notes_window->window),
notes_window->frame);
gtk_widget_show (notes_window->frame);
@@ -1121,8 +1126,8 @@
notes_window_motion_event (NotesWindow *notes_window,
GdkEventMotion *event)
{
- GtkAllocation alloc = notes_window->window->allocation;
- GdkCursor *cursor;
+ GtkAllocation alloc = notes_window->window->allocation;
+ GdkCursor *cursor;
if (event->x > 2 &&
event->y > 2 &&
@@ -1133,12 +1138,30 @@
TRACE ("Window Motion: (%.0fx%.0f) %dx%d", event->x, event->y, alloc.width, alloc.height);
/* Display a mouse cursor for the bottom right corner */
- if (event->x >= alloc.width - CORNER_MARGIN && event->y >= alloc.height - CORNER_MARGIN)
+ if (event->x >= alloc.width - CORNER_MARGIN &&
+ event->y >= alloc.height - CORNER_MARGIN)
{
cursor = gdk_cursor_new (GDK_BOTTOM_RIGHT_CORNER);
gdk_window_set_cursor (notes_window->window->window, cursor);
gdk_cursor_unref (cursor);
}
+ /* Display a mouse cursor for the bottom line */
+ else if (event->x > CORNER_MARGIN &&
+ event->y > alloc.height - CORNER_MARGIN &&
+ event->x < alloc.width - CORNER_MARGIN)
+ {
+ cursor = gdk_cursor_new (GDK_BOTTOM_SIDE);
+ gdk_window_set_cursor (notes_window->window->window, cursor);
+ gdk_cursor_unref (cursor);
+ }
+ /* Display a mouse cursor for the bottom left corner */
+ else if (event->x <= CORNER_MARGIN &&
+ event->y >= alloc.height - CORNER_MARGIN)
+ {
+ cursor = gdk_cursor_new (GDK_BOTTOM_LEFT_CORNER);
+ gdk_window_set_cursor (notes_window->window->window, cursor);
+ gdk_cursor_unref (cursor);
+ }
else
{
gdk_window_set_cursor (notes_window->window->window, NULL);
@@ -1192,7 +1215,7 @@
{
edge = GDK_WINDOW_EDGE_SOUTH_EAST;
}
- /* Bottom corner */
+ /* Bottom line */
else if (event->x > CORNER_MARGIN &&
event->y > alloc.height - CORNER_MARGIN &&
event->x < alloc.width - CORNER_MARGIN)
More information about the Goodies-commits
mailing list