summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoeren Sandmann <sandmann@daimi.au.dk>2002-04-04 20:28:47 +0000
committerSøren Sandmann Pedersen <ssp@src.gnome.org>2002-04-04 20:28:47 +0000
commit3c52eba0b51ced6a53db8d73287588e6fe0b73e5 (patch)
treebb8d7994590ea175a0ade207c7c361e022646bb5
parentabda40ede4b5b1a176f88b6ef59ec8623492eadf (diff)
downloadgtk+-3c52eba0b51ced6a53db8d73287588e6fe0b73e5.tar.gz
Fix problem with menu titles being clipped (#75948)
Thu Apr 4 22:28:08 2002 Soeren Sandmann <sandmann@daimi.au.dk> * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem with menu titles being clipped (#75948)
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.pre-2-105
-rw-r--r--ChangeLog.pre-2-25
-rw-r--r--ChangeLog.pre-2-45
-rw-r--r--ChangeLog.pre-2-65
-rw-r--r--ChangeLog.pre-2-85
-rw-r--r--gtk/gtkmenuitem.c11
-rw-r--r--tests/testgtk.c26
8 files changed, 52 insertions, 15 deletions
diff --git a/ChangeLog b/ChangeLog
index e3372ad631..c4514adba6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Thu Apr 4 22:28:08 2002 Soeren Sandmann <sandmann@daimi.au.dk>
+
+ * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem with menu
+ titles being clipped (#75948)
+
2002-04-04 Tor Lillqvist <tml@iki.fi>
* gdk/gdkrgb.c: Fix some bugs, and introduce a minor feature.
diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10
index e3372ad631..c4514adba6 100644
--- a/ChangeLog.pre-2-10
+++ b/ChangeLog.pre-2-10
@@ -1,3 +1,8 @@
+Thu Apr 4 22:28:08 2002 Soeren Sandmann <sandmann@daimi.au.dk>
+
+ * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem with menu
+ titles being clipped (#75948)
+
2002-04-04 Tor Lillqvist <tml@iki.fi>
* gdk/gdkrgb.c: Fix some bugs, and introduce a minor feature.
diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2
index e3372ad631..c4514adba6 100644
--- a/ChangeLog.pre-2-2
+++ b/ChangeLog.pre-2-2
@@ -1,3 +1,8 @@
+Thu Apr 4 22:28:08 2002 Soeren Sandmann <sandmann@daimi.au.dk>
+
+ * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem with menu
+ titles being clipped (#75948)
+
2002-04-04 Tor Lillqvist <tml@iki.fi>
* gdk/gdkrgb.c: Fix some bugs, and introduce a minor feature.
diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4
index e3372ad631..c4514adba6 100644
--- a/ChangeLog.pre-2-4
+++ b/ChangeLog.pre-2-4
@@ -1,3 +1,8 @@
+Thu Apr 4 22:28:08 2002 Soeren Sandmann <sandmann@daimi.au.dk>
+
+ * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem with menu
+ titles being clipped (#75948)
+
2002-04-04 Tor Lillqvist <tml@iki.fi>
* gdk/gdkrgb.c: Fix some bugs, and introduce a minor feature.
diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6
index e3372ad631..c4514adba6 100644
--- a/ChangeLog.pre-2-6
+++ b/ChangeLog.pre-2-6
@@ -1,3 +1,8 @@
+Thu Apr 4 22:28:08 2002 Soeren Sandmann <sandmann@daimi.au.dk>
+
+ * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem with menu
+ titles being clipped (#75948)
+
2002-04-04 Tor Lillqvist <tml@iki.fi>
* gdk/gdkrgb.c: Fix some bugs, and introduce a minor feature.
diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8
index e3372ad631..c4514adba6 100644
--- a/ChangeLog.pre-2-8
+++ b/ChangeLog.pre-2-8
@@ -1,3 +1,8 @@
+Thu Apr 4 22:28:08 2002 Soeren Sandmann <sandmann@daimi.au.dk>
+
+ * gtk/gtkmenuitem.c (gtk_menu_item_paint): Fix problem with menu
+ titles being clipped (#75948)
+
2002-04-04 Tor Lillqvist <tml@iki.fi>
* gdk/gdkrgb.c: Fix some bugs, and introduce a minor feature.
diff --git a/gtk/gtkmenuitem.c b/gtk/gtkmenuitem.c
index 2735a5c141..5e30156e9f 100644
--- a/gtk/gtkmenuitem.c
+++ b/gtk/gtkmenuitem.c
@@ -614,9 +614,16 @@ gtk_menu_item_paint (GtkWidget *widget,
if (menu_item->submenu && menu_item->show_submenu_indicator)
{
+ GtkRequisition child_requisition;
gint arrow_x, arrow_y;
- gint arrow_size = height - 2 * widget->style->ythickness;
- gint arrow_extent = arrow_size / 2;
+ gint arrow_size;
+ gint arrow_extent;
+
+ gtk_widget_get_child_requisition (GTK_BIN (menu_item)->child,
+ &child_requisition);
+
+ arrow_size = child_requisition.height - 2 * widget->style->ythickness;
+ arrow_extent = arrow_size * 0.6;
shadow_type = GTK_SHADOW_OUT;
if (state_type == GTK_STATE_PRELIGHT)
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 997ba0c633..f744220c61 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -2487,19 +2487,19 @@ void create_labels (void)
frame = gtk_frame_new ("Internationalized Label");
label = gtk_label_new (NULL);
gtk_label_set_markup (GTK_LABEL (label),
- "French (Français) Bonjour, Salut\n"
- "Korean (한글) 안녕하세요, 안녕하십니까\n"
- "Russian (Русский) Здравствуйте!\n"
- "Chinese (Simplified) <span lang=\"zh-cn\">元气 开发</span>\n"
- "Chinese (Traditional) <span lang=\"zh-tw\">元氣 開發</span>\n"
- "Japanese <span lang=\"ja\">元気 開発</span>");
+ "French (FranÁais) Bonjour, Salut\n"
+ "Korean (한ꁸ) 안녕하섁요, 안녕하싁니ꁹ\n"
+ "Russian (ЁуссЁЁЁ) ЗЁрЁЁстЁуЁтЁ!\n"
+ "Chinese (Simplified) <span lang=\"zh-cn\">元恰 偼发</span>\n"
+ "Chinese (Traditional) <span lang=\"zh-tw\">元恰 開癁</span>\n"
+ "Japanese <span lang=\"ja\">元恰 開癁</span>");
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_container_add (GTK_CONTAINER (frame), label);
gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0);
frame = gtk_frame_new ("Bidirection Label");
- label = gtk_label_new ("Arabic السلام عليكم\n"
- "Hebrew שלום");
+ label = gtk_label_new ("Arabic ؁ل؁ل؁م ؁ليكم\n"
+ "Hebrew ׁלום");
gtk_widget_set_direction (label, GTK_TEXT_DIR_RTL);
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT);
gtk_container_add (GTK_CONTAINER (frame), label);
@@ -2535,7 +2535,7 @@ void create_labels (void)
frame = gtk_frame_new ("Underlined label");
label = gtk_label_new ("This label is underlined!\n"
- "This one is underlined (こんにちは) in quite a funky fashion");
+ "This one is underlined (こんぁぁぁ) in quite a funky fashion");
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_label_set_pattern (GTK_LABEL (label), "_________________________ _ _________ _ _____ _ __ __ ___ ____ _____");
gtk_container_add (GTK_CONTAINER (frame), label);
@@ -3489,7 +3489,7 @@ static GtkItemFactoryEntry menu_items[] =
{ "/File/_Save", NULL, gtk_ifactory_cb, 0, "<StockItem>", GTK_STOCK_SAVE },
{ "/File/Save _As...", "<control>A", gtk_ifactory_cb, 0, "<StockItem>", GTK_STOCK_SAVE },
{ "/File/_Dump \"_Accels\"", NULL, dump_accels, 0 },
- { "/File/\\/Test__Escaping/And\\/\n\tWei\\\\rdly",
+ { "/File/\\/Test__Escaping/And\\/\n\tWei\\\\rdly/and more",
NULL, gtk_ifactory_cb, 0 },
{ "/File/sep1", NULL, gtk_ifactory_cb, 0, "<Separator>" },
{ "/File/_Quit", NULL, gtk_ifactory_cb, 0, "<StockItem>", GTK_STOCK_QUIT },
@@ -3648,9 +3648,9 @@ create_key_lookup (void)
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
button = gtk_button_new_with_mnemonic ("Button 2 (_A)");
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
- button = gtk_button_new_with_mnemonic ("Button 3 (_ф)");
+ button = gtk_button_new_with_mnemonic ("Button 3 (_ф)");
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
- button = gtk_button_new_with_mnemonic ("Button 4 (_Ф)");
+ button = gtk_button_new_with_mnemonic ("Button 4 (_Ё)");
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
button = gtk_button_new_with_mnemonic ("Button 6 (_b)");
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), button, FALSE, FALSE, 0);
@@ -4073,7 +4073,7 @@ create_entry (void)
gtk_box_pack_start (GTK_BOX (box2), hbox, TRUE, TRUE, 0);
entry = gtk_entry_new ();
- gtk_entry_set_text (GTK_ENTRY (entry), "hello world السلام عليكم");
+ gtk_entry_set_text (GTK_ENTRY (entry), "hello world ؁ل؁ل؁م ؁ليكم");
gtk_editable_select_region (GTK_EDITABLE (entry), 0, 5);
gtk_box_pack_start (GTK_BOX (hbox), entry, TRUE, TRUE, 0);