diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 12 | ||||
| -rw-r--r-- | src/gtkutil.c | 13 | ||||
| -rw-r--r-- | src/xterm.h | 2 |
3 files changed, 24 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 8a267b46d14..2326957d4e0 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,15 @@ | |||
| 1 | 2005-01-08 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | ||
| 2 | |||
| 3 | * xterm.h (struct x_output): New member, toolbar_detached. | ||
| 4 | |||
| 5 | * gtkutil.c (xg_create_frame_widgets): Set initial tool bar height to | ||
| 6 | 38. | ||
| 7 | (xg_tool_bar_detach_callback): Set toolbar_detached to 1. | ||
| 8 | (xg_tool_bar_attach_callback): Set toolbar_detached to 0. | ||
| 9 | (xg_create_tool_bar): Initialize toolbar_detached. | ||
| 10 | (update_frame_tool_bar): Only set FRAME_TOOLBAR_HEIGHT (f) if | ||
| 11 | toolbar_detached is zero. | ||
| 12 | |||
| 1 | 2005-01-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> | 13 | 2005-01-07 Jan Dj,Ad(Brv <jan.h.d@swipnet.se> |
| 2 | 14 | ||
| 3 | * xmenu.c (create_and_show_popup_menu): Pass zero as button to | 15 | * xmenu.c (create_and_show_popup_menu): Pass zero as button to |
diff --git a/src/gtkutil.c b/src/gtkutil.c index 686168badda..39d5e768dda 100644 --- a/src/gtkutil.c +++ b/src/gtkutil.c | |||
| @@ -756,7 +756,7 @@ xg_create_frame_widgets (f) | |||
| 756 | So we cheat a bit by setting a height that is what it will have | 756 | So we cheat a bit by setting a height that is what it will have |
| 757 | later on when tool bar items are added. */ | 757 | later on when tool bar items are added. */ |
| 758 | if (FRAME_EXTERNAL_TOOL_BAR (f) && f->n_tool_bar_items == 0) | 758 | if (FRAME_EXTERNAL_TOOL_BAR (f) && f->n_tool_bar_items == 0) |
| 759 | FRAME_TOOLBAR_HEIGHT (f) = 34; | 759 | FRAME_TOOLBAR_HEIGHT (f) = 38; |
| 760 | 760 | ||
| 761 | 761 | ||
| 762 | /* We don't want this widget double buffered, because we draw on it | 762 | /* We don't want this widget double buffered, because we draw on it |
| @@ -3156,6 +3156,8 @@ xg_tool_bar_detach_callback (wbox, w, client_data) | |||
| 3156 | 3156 | ||
| 3157 | if (f) | 3157 | if (f) |
| 3158 | { | 3158 | { |
| 3159 | FRAME_X_OUTPUT (f)->toolbar_detached = 1; | ||
| 3160 | |||
| 3159 | /* When detaching a tool bar, not everything dissapear. There are | 3161 | /* When detaching a tool bar, not everything dissapear. There are |
| 3160 | a few pixels left that are used to drop the tool bar back into | 3162 | a few pixels left that are used to drop the tool bar back into |
| 3161 | place. */ | 3163 | place. */ |
| @@ -3187,11 +3189,13 @@ xg_tool_bar_attach_callback (wbox, w, client_data) | |||
| 3187 | { | 3189 | { |
| 3188 | GtkRequisition req; | 3190 | GtkRequisition req; |
| 3189 | 3191 | ||
| 3192 | FRAME_X_OUTPUT (f)->toolbar_detached = 0; | ||
| 3193 | |||
| 3190 | gtk_widget_size_request (w, &req); | 3194 | gtk_widget_size_request (w, &req); |
| 3191 | FRAME_TOOLBAR_HEIGHT (f) = req.height; | 3195 | FRAME_TOOLBAR_HEIGHT (f) = req.height; |
| 3192 | 3196 | ||
| 3193 | /* The height has changed, resize outer widget and set columns | 3197 | /* The height has changed, resize outer widget and set columns |
| 3194 | rows to what we had before detaching the tool bar. */ | 3198 | rows to what we had before attaching the tool bar. */ |
| 3195 | xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f)); | 3199 | xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f)); |
| 3196 | } | 3200 | } |
| 3197 | } | 3201 | } |
| @@ -3305,6 +3309,8 @@ xg_create_tool_bar (f) | |||
| 3305 | 3309 | ||
| 3306 | x->toolbar_widget = gtk_toolbar_new (); | 3310 | x->toolbar_widget = gtk_toolbar_new (); |
| 3307 | x->handlebox_widget = gtk_handle_box_new (); | 3311 | x->handlebox_widget = gtk_handle_box_new (); |
| 3312 | x->toolbar_detached = 0; | ||
| 3313 | |||
| 3308 | gtk_container_add (GTK_CONTAINER (x->handlebox_widget), | 3314 | gtk_container_add (GTK_CONTAINER (x->handlebox_widget), |
| 3309 | x->toolbar_widget); | 3315 | x->toolbar_widget); |
| 3310 | 3316 | ||
| @@ -3537,7 +3543,8 @@ update_frame_tool_bar (f) | |||
| 3537 | } | 3543 | } |
| 3538 | 3544 | ||
| 3539 | gtk_widget_size_request (x->toolbar_widget, &new_req); | 3545 | gtk_widget_size_request (x->toolbar_widget, &new_req); |
| 3540 | if (old_req.height != new_req.height) | 3546 | if (old_req.height != new_req.height |
| 3547 | && ! FRAME_X_OUTPUT (f)->toolbar_detached) | ||
| 3541 | { | 3548 | { |
| 3542 | FRAME_TOOLBAR_HEIGHT (f) = new_req.height; | 3549 | FRAME_TOOLBAR_HEIGHT (f) = new_req.height; |
| 3543 | xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f)); | 3550 | xg_resize_outer_widget (f, FRAME_COLS (f), FRAME_LINES (f)); |
diff --git a/src/xterm.h b/src/xterm.h index 2f71f644217..2c24dcd592c 100644 --- a/src/xterm.h +++ b/src/xterm.h | |||
| @@ -499,6 +499,8 @@ struct x_output | |||
| 499 | GtkWidget *toolbar_widget; | 499 | GtkWidget *toolbar_widget; |
| 500 | /* The handle box that makes the tool bar detachable. */ | 500 | /* The handle box that makes the tool bar detachable. */ |
| 501 | GtkWidget *handlebox_widget; | 501 | GtkWidget *handlebox_widget; |
| 502 | /* Non-zero if the tool bar is detached. */ | ||
| 503 | int toolbar_detached; | ||
| 502 | 504 | ||
| 503 | /* The last size hints set. */ | 505 | /* The last size hints set. */ |
| 504 | GdkGeometry size_hints; | 506 | GdkGeometry size_hints; |