aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog14
-rw-r--r--src/gtkutil.c32
-rw-r--r--src/lisp.h2
-rw-r--r--src/xdisp.c15
-rw-r--r--src/xsettings.c3
5 files changed, 49 insertions, 17 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4c4ac5f8725..9cb3b248232 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,17 @@
12010-07-28 Jan Djärv <jan.h.d@swipnet.se>
2
3 * xsettings.c (Ftool_bar_get_system_style): Also check for
4 Qtext_image_horiz.
5
6 * xdisp.c (Qtext_image_horiz): Define.
7 (syms_of_xdisp): Initialize Qtext_image_horiz. Add text-image-horiz
8 to ducumentation of tool-bar-style.
9
10 * lisp.h (Qtext_image_horiz): Declare.
11
12 * gtkutil.c (xg_make_tool_item, xg_show_toolbar_item): Handle tool bar
13 style text_image_horiz.
14
12010-07-27 Dan Nicolaescu <dann@ics.uci.edu> 152010-07-27 Dan Nicolaescu <dann@ics.uci.edu>
2 16
3 * emacs.c (Fkill_emacs): Remove return statement. 17 * emacs.c (Fkill_emacs): Remove return statement.
diff --git a/src/gtkutil.c b/src/gtkutil.c
index b1bb2e32324..3fb05ba1348 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -3703,8 +3703,7 @@ xg_create_tool_bar (FRAME_PTR f)
3703 gtk_widget_set_name (x->toolbar_widget, "emacs-toolbar"); 3703 gtk_widget_set_name (x->toolbar_widget, "emacs-toolbar");
3704 3704
3705 gtk_toolbar_set_style (GTK_TOOLBAR (x->toolbar_widget), GTK_TOOLBAR_ICONS); 3705 gtk_toolbar_set_style (GTK_TOOLBAR (x->toolbar_widget), GTK_TOOLBAR_ICONS);
3706 toolbar_set_orientation (x->toolbar_widget, 3706 toolbar_set_orientation (x->toolbar_widget, GTK_ORIENTATION_HORIZONTAL);
3707 GTK_ORIENTATION_HORIZONTAL);
3708} 3707}
3709 3708
3710 3709
@@ -3749,15 +3748,23 @@ xg_make_tool_item (FRAME_PTR f,
3749 int i) 3748 int i)
3750{ 3749{
3751 GtkToolItem *ti = gtk_tool_item_new (); 3750 GtkToolItem *ti = gtk_tool_item_new ();
3752 GtkWidget *vb = EQ (Vtool_bar_style, Qboth_horiz) 3751 Lisp_Object style = Ftool_bar_get_system_style ();
3752 int both_horiz = EQ (style, Qboth_horiz);
3753 int text_image = EQ (style, Qtext_image_horiz);
3754
3755 GtkWidget *vb = both_horiz || text_image
3753 ? gtk_hbox_new (FALSE, 0) : gtk_vbox_new (FALSE, 0); 3756 ? gtk_hbox_new (FALSE, 0) : gtk_vbox_new (FALSE, 0);
3754 GtkWidget *wb = gtk_button_new (); 3757 GtkWidget *wb = gtk_button_new ();
3755 GtkWidget *weventbox = gtk_event_box_new (); 3758 GtkWidget *weventbox = gtk_event_box_new ();
3756 3759
3757 if (wimage) 3760 if (wimage && ! text_image)
3758 gtk_box_pack_start (GTK_BOX (vb), wimage, TRUE, TRUE, 0); 3761 gtk_box_pack_start (GTK_BOX (vb), wimage, TRUE, TRUE, 0);
3759 3762
3760 gtk_box_pack_start (GTK_BOX (vb), gtk_label_new (label), TRUE, TRUE, 0); 3763 gtk_box_pack_start (GTK_BOX (vb), gtk_label_new (label), TRUE, TRUE, 0);
3764
3765 if (wimage && text_image)
3766 gtk_box_pack_start (GTK_BOX (vb), wimage, TRUE, TRUE, 0);
3767
3761 gtk_button_set_focus_on_click (GTK_BUTTON (wb), FALSE); 3768 gtk_button_set_focus_on_click (GTK_BUTTON (wb), FALSE);
3762 gtk_button_set_relief (GTK_BUTTON (wb), GTK_RELIEF_NONE); 3769 gtk_button_set_relief (GTK_BUTTON (wb), GTK_RELIEF_NONE);
3763 gtk_container_add (GTK_CONTAINER (wb), vb); 3770 gtk_container_add (GTK_CONTAINER (wb), vb);
@@ -3819,11 +3826,12 @@ static void
3819xg_show_toolbar_item (GtkToolItem *ti) 3826xg_show_toolbar_item (GtkToolItem *ti)
3820{ 3827{
3821 Lisp_Object style = Ftool_bar_get_system_style (); 3828 Lisp_Object style = Ftool_bar_get_system_style ();
3829 int both_horiz = EQ (style, Qboth_horiz);
3830 int text_image = EQ (style, Qtext_image_horiz);
3822 3831
3823 int show_label = EQ (style, Qboth) 3832 int horiz = both_horiz || text_image;
3824 || EQ (style, Qboth_horiz) || EQ (style, Qtext); 3833 int show_label = ! EQ (style, Qimage);
3825 int show_image = ! EQ (style, Qtext); 3834 int show_image = ! EQ (style, Qtext);
3826 int horiz = EQ (style, Qboth_horiz);
3827 3835
3828 GtkWidget *weventbox = gtk_bin_get_child (GTK_BIN (ti)); 3836 GtkWidget *weventbox = gtk_bin_get_child (GTK_BIN (ti));
3829 GtkWidget *wbutton = gtk_bin_get_child (GTK_BIN (weventbox)); 3837 GtkWidget *wbutton = gtk_bin_get_child (GTK_BIN (weventbox));
@@ -3836,15 +3844,21 @@ xg_show_toolbar_item (GtkToolItem *ti)
3836 new_box = gtk_hbox_new (FALSE, 0); 3844 new_box = gtk_hbox_new (FALSE, 0);
3837 else if (GTK_IS_HBOX (vb) && !horiz && show_label && show_image) 3845 else if (GTK_IS_HBOX (vb) && !horiz && show_label && show_image)
3838 new_box = gtk_vbox_new (FALSE, 0); 3846 new_box = gtk_vbox_new (FALSE, 0);
3839 if (new_box) 3847
3848 if (!new_box && horiz)
3849 gtk_box_reorder_child (GTK_BOX (vb), wlbl, text_image ? 0 : 1);
3850 else if (new_box)
3840 { 3851 {
3841 g_object_ref (G_OBJECT (wimage)); 3852 g_object_ref (G_OBJECT (wimage));
3842 g_object_ref (G_OBJECT (wlbl)); 3853 g_object_ref (G_OBJECT (wlbl));
3843 gtk_container_remove (GTK_CONTAINER (vb), wimage); 3854 gtk_container_remove (GTK_CONTAINER (vb), wimage);
3844 gtk_container_remove (GTK_CONTAINER (vb), wlbl); 3855 gtk_container_remove (GTK_CONTAINER (vb), wlbl);
3845 gtk_widget_destroy (GTK_WIDGET (vb)); 3856 gtk_widget_destroy (GTK_WIDGET (vb));
3846 gtk_box_pack_start (GTK_BOX (new_box), wimage, TRUE, TRUE, 0); 3857 if (! text_image)
3858 gtk_box_pack_start (GTK_BOX (new_box), wimage, TRUE, TRUE, 0);
3847 gtk_box_pack_start (GTK_BOX (new_box), wlbl, TRUE, TRUE, 0); 3859 gtk_box_pack_start (GTK_BOX (new_box), wlbl, TRUE, TRUE, 0);
3860 if (text_image)
3861 gtk_box_pack_start (GTK_BOX (new_box), wimage, TRUE, TRUE, 0);
3848 gtk_container_add (GTK_CONTAINER (wbutton), new_box); 3862 gtk_container_add (GTK_CONTAINER (wbutton), new_box);
3849 g_object_unref (G_OBJECT (wimage)); 3863 g_object_unref (G_OBJECT (wimage));
3850 g_object_unref (G_OBJECT (wlbl)); 3864 g_object_unref (G_OBJECT (wlbl));
diff --git a/src/lisp.h b/src/lisp.h
index 150ff77c948..b9d67c4b78e 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -2631,7 +2631,7 @@ extern Lisp_Object Qinhibit_point_motion_hooks;
2631extern Lisp_Object Qinhibit_redisplay, Qdisplay; 2631extern Lisp_Object Qinhibit_redisplay, Qdisplay;
2632extern Lisp_Object Qinhibit_eval_during_redisplay; 2632extern Lisp_Object Qinhibit_eval_during_redisplay;
2633extern Lisp_Object Qmessage_truncate_lines; 2633extern Lisp_Object Qmessage_truncate_lines;
2634extern Lisp_Object Qimage, Qtext, Qboth, Qboth_horiz; 2634extern Lisp_Object Qimage, Qtext, Qboth, Qboth_horiz, Qtext_image_horiz;
2635extern Lisp_Object Qspace, Qcenter, QCalign_to; 2635extern Lisp_Object Qspace, Qcenter, QCalign_to;
2636extern Lisp_Object Vmessage_log_max; 2636extern Lisp_Object Vmessage_log_max;
2637extern Lisp_Object QCdata, QCfile; 2637extern Lisp_Object QCdata, QCfile;
diff --git a/src/xdisp.c b/src/xdisp.c
index a1a03d355c2..cd088f0aa1d 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -456,7 +456,7 @@ Lisp_Object QCmap, QCpointer;
456Lisp_Object Qrect, Qcircle, Qpoly; 456Lisp_Object Qrect, Qcircle, Qpoly;
457 457
458/* Tool bar styles */ 458/* Tool bar styles */
459Lisp_Object Qtext, Qboth, Qboth_horiz; 459Lisp_Object Qtext, Qboth, Qboth_horiz, Qtext_image_horiz;
460 460
461/* Non-zero means print newline to stdout before next mini-buffer 461/* Non-zero means print newline to stdout before next mini-buffer
462 message. */ 462 message. */
@@ -25636,6 +25636,8 @@ syms_of_xdisp (void)
25636 staticpro (&Qboth); 25636 staticpro (&Qboth);
25637 Qboth_horiz = intern_c_string ("both-horiz"); 25637 Qboth_horiz = intern_c_string ("both-horiz");
25638 staticpro (&Qboth_horiz); 25638 staticpro (&Qboth_horiz);
25639 Qtext_image_horiz = intern_c_string ("text-image-horiz");
25640 staticpro (&Qtext_image_horiz);
25639 QCmap = intern_c_string (":map"); 25641 QCmap = intern_c_string (":map");
25640 staticpro (&QCmap); 25642 staticpro (&QCmap);
25641 QCpointer = intern_c_string (":pointer"); 25643 QCpointer = intern_c_string (":pointer");
@@ -25979,11 +25981,12 @@ vertical margin. */);
25979 DEFVAR_LISP ("tool-bar-style", &Vtool_bar_style, 25981 DEFVAR_LISP ("tool-bar-style", &Vtool_bar_style,
25980 doc: /* *Tool bar style to use. 25982 doc: /* *Tool bar style to use.
25981It can be one of 25983It can be one of
25982 image - show images only 25984 image - show images only
25983 text - show text only 25985 text - show text only
25984 both - show both, text under image 25986 both - show both, text below image
25985 both-horiz - show text to the right of the image 25987 both-horiz - show text to the right of the image
25986 any other - use system default or image if no system default. */); 25988 text-image-horiz - show text to the left of the image
25989 any other - use system default or image if no system default. */);
25987 Vtool_bar_style = Qnil; 25990 Vtool_bar_style = Qnil;
25988 25991
25989 DEFVAR_INT ("tool-bar-max-label-size", &tool_bar_max_label_size, 25992 DEFVAR_INT ("tool-bar-max-label-size", &tool_bar_max_label_size,
diff --git a/src/xsettings.c b/src/xsettings.c
index c02c850ac85..0d9c9cadb27 100644
--- a/src/xsettings.c
+++ b/src/xsettings.c
@@ -730,7 +730,8 @@ known style. Otherwise return image. */)
730 if (EQ (Vtool_bar_style, Qimage) 730 if (EQ (Vtool_bar_style, Qimage)
731 || EQ (Vtool_bar_style, Qtext) 731 || EQ (Vtool_bar_style, Qtext)
732 || EQ (Vtool_bar_style, Qboth) 732 || EQ (Vtool_bar_style, Qboth)
733 || EQ (Vtool_bar_style, Qboth_horiz)) 733 || EQ (Vtool_bar_style, Qboth_horiz)
734 || EQ (Vtool_bar_style, Qtext_image_horiz))
734 return Vtool_bar_style; 735 return Vtool_bar_style;
735 if (!NILP (current_tool_bar_style)) 736 if (!NILP (current_tool_bar_style))
736 return current_tool_bar_style; 737 return current_tool_bar_style;