diff options
author | Elliot Lee <sopwith@src.gnome.org> | 1997-12-19 21:06:39 +0000 |
---|---|---|
committer | Elliot Lee <sopwith@src.gnome.org> | 1997-12-19 21:06:39 +0000 |
commit | 24b21a5d84d2d55d194cfd40ec041036049ff8c1 (patch) | |
tree | cc51ef29c0af3ec942062fd983ff8bbd70a361a6 | |
parent | 01eda653eeb73efcdf91aa8354f7fb08d756cd53 (diff) | |
download | gtk+-24b21a5d84d2d55d194cfd40ec041036049ff8c1.tar.gz |
OK, handle box is good to go except for having the parent resize when it is dragged out, and also allowing user to drag it back into the original parent
-rw-r--r-- | gdk/gdk.c | 10 | ||||
-rw-r--r-- | gdk/x11/gdkmain-x11.c | 10 | ||||
-rw-r--r-- | gtk/gtkhandlebox.c | 22 |
3 files changed, 27 insertions, 15 deletions
@@ -1763,6 +1763,8 @@ gdk_event_translate (GdkEvent *event, event->button.time = xevent->xbutton.time; event->button.x = xevent->xbutton.x; event->button.y = xevent->xbutton.y; + event->button.x_root = (gfloat)xevent->xbutton.x_root; + event->button.y_root = (gfloat)xevent->xbutton.y_root; event->button.pressure = 0.5; event->button.xtilt = 0; event->button.ytilt = 0; @@ -1864,8 +1866,8 @@ gdk_event_translate (GdkEvent *event, event->button.time = xevent->xbutton.time; event->button.x = xevent->xbutton.x; event->button.y = xevent->xbutton.y; - event->button.x_root = xevent->xbutton.x_root; - event->button.y_root = xevent->xbutton.y_root; + event->button.x_root = (gfloat)xevent->xbutton.x_root; + event->button.y_root = (gfloat)xevent->xbutton.y_root; event->button.pressure = 0.5; event->button.xtilt = 0; event->button.ytilt = 0; @@ -1936,8 +1938,8 @@ gdk_event_translate (GdkEvent *event, event->motion.time = xevent->xmotion.time; event->motion.x = xevent->xmotion.x; event->motion.y = xevent->xmotion.y; - event->motion.x_root = xevent->xmotion.x_root; - event->motion.y_root = xevent->xmotion.y_root; + event->motion.x_root = (gfloat)xevent->xmotion.x_root; + event->motion.y_root = (gfloat)xevent->xmotion.y_root; event->motion.pressure = 0.5; event->motion.xtilt = 0; event->motion.ytilt = 0; diff --git a/gdk/x11/gdkmain-x11.c b/gdk/x11/gdkmain-x11.c index 6b5c7ad1ec..bc512772f5 100644 --- a/gdk/x11/gdkmain-x11.c +++ b/gdk/x11/gdkmain-x11.c @@ -1763,6 +1763,8 @@ gdk_event_translate (GdkEvent *event, event->button.time = xevent->xbutton.time; event->button.x = xevent->xbutton.x; event->button.y = xevent->xbutton.y; + event->button.x_root = (gfloat)xevent->xbutton.x_root; + event->button.y_root = (gfloat)xevent->xbutton.y_root; event->button.pressure = 0.5; event->button.xtilt = 0; event->button.ytilt = 0; @@ -1864,8 +1866,8 @@ gdk_event_translate (GdkEvent *event, event->button.time = xevent->xbutton.time; event->button.x = xevent->xbutton.x; event->button.y = xevent->xbutton.y; - event->button.x_root = xevent->xbutton.x_root; - event->button.y_root = xevent->xbutton.y_root; + event->button.x_root = (gfloat)xevent->xbutton.x_root; + event->button.y_root = (gfloat)xevent->xbutton.y_root; event->button.pressure = 0.5; event->button.xtilt = 0; event->button.ytilt = 0; @@ -1936,8 +1938,8 @@ gdk_event_translate (GdkEvent *event, event->motion.time = xevent->xmotion.time; event->motion.x = xevent->xmotion.x; event->motion.y = xevent->xmotion.y; - event->motion.x_root = xevent->xmotion.x_root; - event->motion.y_root = xevent->xmotion.y_root; + event->motion.x_root = (gfloat)xevent->xmotion.x_root; + event->motion.y_root = (gfloat)xevent->xmotion.y_root; event->motion.pressure = 0.5; event->motion.xtilt = 0; event->motion.ytilt = 0; diff --git a/gtk/gtkhandlebox.c b/gtk/gtkhandlebox.c index f01ab294b3..30b728b648 100644 --- a/gtk/gtkhandlebox.c +++ b/gtk/gtkhandlebox.c @@ -142,8 +142,8 @@ gtk_handle_box_size_request (GtkWidget *widget, bin = GTK_BIN (widget); - requisition->width = DRAG_HANDLE_SIZE; - requisition->height = DRAG_HANDLE_SIZE; + requisition->width = DRAG_HANDLE_SIZE + GTK_CONTAINER(widget)->border_width * 2; + requisition->height = DRAG_HANDLE_SIZE + GTK_CONTAINER(widget)->border_width * 2; if (bin->child && GTK_WIDGET_VISIBLE (bin->child)) { @@ -171,14 +171,14 @@ gtk_handle_box_size_allocate (GtkWidget *widget, child_allocation.x = 0; child_allocation.y = 0; - child_allocation.width = allocation->width - DRAG_HANDLE_SIZE; - child_allocation.height = allocation->height; + child_allocation.width = allocation->width - DRAG_HANDLE_SIZE - GTK_CONTAINER(widget)->border_width * 2; + child_allocation.height = allocation->height - GTK_CONTAINER(widget)->border_width * 2; if (GTK_WIDGET_REALIZED (widget)) { gdk_window_move_resize (widget->window, - allocation->x + DRAG_HANDLE_SIZE, - allocation->y, + allocation->x + DRAG_HANDLE_SIZE + GTK_CONTAINER(widget)->border_width, + allocation->y + GTK_CONTAINER(widget)->border_width, child_allocation.width, child_allocation.height); } @@ -197,18 +197,26 @@ static void gtk_handle_box_paint(GtkWidget *widget, g_print("painting %dx%d+%d+%d\n", area->x, area->y, area->width, area->height); - startx = 1; endx = DRAG_HANDLE_SIZE; if(area->x > startx) startx = area->x; if((area->x + area->width) < endx) endx = area->x + area->width; line_y2 = area->y + area->height; + for(x = startx; x < DRAG_HANDLE_SIZE; x += 3) gtk_draw_vline(widget->style, widget->window, GTK_WIDGET_STATE(widget), area->y, line_y2, x); + + gtk_draw_shadow(widget->style, + widget->window, + GTK_WIDGET_STATE(widget), + GTK_SHADOW_OUT, + 0, 0, + widget->allocation.width - 1, + widget->allocation.height); } static void |