From 7e9b154f0c73563c4f6a1ce681b78f508d88317c Mon Sep 17 00:00:00 2001 From: Havoc Pennington Date: Sat, 28 Apr 2001 00:12:47 +0000 Subject: fix warning 2001-04-27 Havoc Pennington * gtk/gtkcombo.c (gtk_combo_popup_button_press): fix warning * gtk/gtkmessagedialog.c (gtk_message_dialog_init): make messages selectable * gtk/gtkentry.c (gtk_entry_real_insert_text): don't strip line/para separators (gtk_entry_create_layout): set single paragraph mode on the layout * gtk/gtkbutton.c (gtk_button_new_from_stock): don't put much spacing between the image and label; instead, inside a button box the button will get extra space that will go there, but if people configure button box for 0 chubbiness, then there's no spacing. * gtk/gtkbbox.c (gtk_button_box_class_init): Make child ipadding and min/max size style properties, so people can tune their chubbiness. * tests/testgtk.c (make_toolbar): remove calls to removed toolbar functions * gtk/gtktoolbar.c (gtk_toolbar_class_init): Make space_size, space_style, and button_relief into style properties, remove functions for setting them * gtk/gtkmenu.c (gtk_menu_key_press): handle menu bar accel to pop it back down * gtk/gtkoptionmenu.c (gtk_option_menu_get_props): free boxed types from gtk_widget_style_get * gtk/gtkmenubar.c (gtk_menu_bar_set_shadow_type): Remove, replace with a style property. * gdk/x11/gdkevents-x11.c: namespace the settings * gtk/gtkmenubar.c: Add F10 accelerator to move between menubars. * gtk/gtksettings.c (gtk_settings_class_init): remove code with side effects from inside g_assert(), so that G_DISABLE_ASSERT can be used. Also, translate doc strings for settings. Also, namespace the double-click-time property. Also, remove bell properties crap. --- gtk/gtkentry.c | 55 ++----------------------------------------------------- 1 file changed, 2 insertions(+), 53 deletions(-) (limited to 'gtk/gtkentry.c') diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c index 644c4c4c55..193ef49124 100644 --- a/gtk/gtkentry.c +++ b/gtk/gtkentry.c @@ -1694,43 +1694,6 @@ gtk_entry_style_set (GtkWidget *widget, } } -static char * -strstr_len (const char *haystack, - int haystack_len, - const char *needle) -{ - int i; - - g_return_val_if_fail (haystack != NULL, NULL); - g_return_val_if_fail (needle != NULL, NULL); - - if (haystack_len < 0) - return strstr (haystack, needle); - else - { - const char *p = haystack; - int needle_len = strlen (needle); - const char *end = haystack + haystack_len - needle_len; - - if (needle_len == 0) - return (char *)haystack; - - while (*p && p <= end) - { - for (i = 0; i < needle_len; i++) - if (p[i] != needle[i]) - goto next; - - return (char *)p; - - next: - p++; - } - } - - return NULL; -} - /* Default signal handlers */ static void @@ -1741,26 +1704,10 @@ gtk_entry_real_insert_text (GtkEntry *entry, { gint index; gint n_chars; - gchar line_separator[7]; - gint len; - gchar *p; if (new_text_length < 0) new_text_length = strlen (new_text); - /* We don't want to allow inserting paragraph delimeters - */ - pango_find_paragraph_boundary (new_text, new_text_length, &new_text_length, NULL); - - /* Or line separators - this is really painful - */ - len = g_unichar_to_utf8 (0x2028, line_separator); /* 0x2028 == LS */ - line_separator[len] = '\0'; - - p = strstr_len (new_text, new_text_length, line_separator); - if (p) - new_text_length = p - new_text; - n_chars = g_utf8_strlen (new_text, new_text_length); if (entry->text_max_length > 0 && n_chars + entry->text_length > entry->text_max_length) { @@ -2167,6 +2114,8 @@ gtk_entry_create_layout (GtkEntry *entry, gint preedit_length = 0; PangoAttrList *preedit_attrs = NULL; + pango_layout_set_single_paragraph_mode (layout, TRUE); + if (include_preedit) { gtk_im_context_get_preedit_string (entry->im_context, -- cgit v1.2.1