From dfcf007a44cff4dc0f55d0ae5ec7c702a06cb309 Mon Sep 17 00:00:00 2001 From: Michael Webster Date: Fri, 6 Jul 2018 14:40:07 -0400 Subject: [PATCH] search bar/xed-history-entry: Set a 'width-chars' on the GtkEntry widgets of the search and replace entry widgets, and allow their labels to ellipsize upon resizing. This allows the entry widgets to have a smaller minimum size, which was having an impact on window tiling for certain locales and display resolutions (muffin and other wm's won't allow tiling of a window if the resulting window size is less than the minimum size hints reported by gtk and other toolkits.) Ellipsizing the labels has the same benefit of enabling xed to be resized smaller to tile on smaller displays. This ellipsizing only occurs once the entries hit their minimum size. Fixes #73 --- xed/resources/ui/xed-searchbar.ui | 7 ++++++- xed/xed-history-entry.c | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/xed/resources/ui/xed-searchbar.ui b/xed/resources/ui/xed-searchbar.ui index 0ecddef..f8123f1 100755 --- a/xed/resources/ui/xed-searchbar.ui +++ b/xed/resources/ui/xed-searchbar.ui @@ -1,5 +1,5 @@ - + @@ -58,6 +58,7 @@ False _Search for: True + end 0 @@ -71,6 +72,7 @@ False Replace _with: True + end 0 @@ -252,5 +254,8 @@ + + + diff --git a/xed/xed-history-entry.c b/xed/xed-history-entry.c index 7497faa..aad20ab 100644 --- a/xed/xed-history-entry.c +++ b/xed/xed-history-entry.c @@ -473,6 +473,7 @@ xed_history_entry_new (const gchar *history_id, gboolean enable_completion) { GtkWidget *ret; + GtkEntry *real_entry; g_return_val_if_fail (history_id != NULL, NULL); @@ -498,6 +499,9 @@ xed_history_entry_new (const gchar *history_id, xed_history_entry_set_enable_completion (XED_HISTORY_ENTRY (ret), enable_completion); + real_entry = GTK_ENTRY (xed_history_entry_get_entry (XED_HISTORY_ENTRY (ret))); + gtk_entry_set_width_chars (real_entry, 6); + return ret; }