Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Thu, 05 Dec 2024 13:48:53 UTC Commit: e171d2a1d764717d0b359feadfe4b90399f9735d https://github.com/geany/geany/commit/e171d2a1d764717d0b359feadfe4b90399f973...
Log Message: ----------- Hide find/replace dialogs when wrap dialog is shown
These dialogs are restored once the wrap dialog is closed.
In addition to a cleaner interface where two dialogs are not displayed on top of each other, once the find/replace dialog is restored, it gains focus so users can keep searching without interruption (without this patch, the editor window gets focus so users have to press Ctrl+F again to get to the search dialog again).
Modified Paths: -------------- src/search.c
Modified: src/search.c 12 lines changed, 12 insertions(+), 0 deletions(-) =================================================================== @@ -1153,8 +1153,17 @@ gboolean search_show_wrap_dialog(GtkWidget *parent, const gchar *search_text) gboolean ret; GtkWidget *dialog; GtkWidget *btn; + GtkWidget *visible_dialog = NULL; gchar *question_text;
+ if (find_dlg.dialog && gtk_widget_is_visible(find_dlg.dialog)) + visible_dialog = find_dlg.dialog; + else if (replace_dlg.dialog && gtk_widget_is_visible(replace_dlg.dialog)) + visible_dialog = replace_dlg.dialog; + + if (visible_dialog) + gtk_widget_hide(visible_dialog); + if (parent == NULL) parent = main_widgets.window;
@@ -1179,6 +1188,9 @@ gboolean search_show_wrap_dialog(GtkWidget *parent, const gchar *search_text) gtk_widget_destroy(dialog); g_free(question_text);
+ if (visible_dialog && ret == GTK_RESPONSE_YES) + gtk_widget_show(visible_dialog); + return ret == GTK_RESPONSE_YES; }
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).