From 9d807458dc53bde7972c79afcb4e429ddb6934d0 Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Mon, 15 May 2023 08:23:26 +0200 Subject: [PATCH 01/16] flatpak: Add dri permissions Needed for all GTK 4 apps as they render via GPU. --- build-aux/flatpak/org.gnome.Gtranslator.json | 1 + 1 file changed, 1 insertion(+) diff --git a/build-aux/flatpak/org.gnome.Gtranslator.json b/build-aux/flatpak/org.gnome.Gtranslator.json index 2c0551c6..aaf59b44 100644 --- a/build-aux/flatpak/org.gnome.Gtranslator.json +++ b/build-aux/flatpak/org.gnome.Gtranslator.json @@ -9,6 +9,7 @@ ], "desktop-file-name-suffix" : "(Development) ", "finish-args" : [ + "--device=dri", "--share=ipc", "--share=network", "--socket=fallback-x11", -- GitLab From 87670328a0ab1d0baf98404ec720b18d8eb1651c Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Mon, 15 May 2023 08:25:30 +0200 Subject: [PATCH 02/16] application: Move resource base path to construct This is more inline with other apps and fixes a few annoying issues like the correct creation of the shortcut window. --- src/gtr-application.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gtr-application.c b/src/gtr-application.c index 9b648694..59c38a2c 100644 --- a/src/gtr-application.c +++ b/src/gtr-application.c @@ -596,7 +596,6 @@ gtr_application_startup (GApplication *application) GtrApplication *app = GTR_APPLICATION (application); GtrApplicationPrivate *priv = gtr_application_get_instance_private (app); - g_application_set_resource_base_path (application, "/org/gnome/translator"); G_APPLICATION_CLASS (gtr_application_parent_class)->startup (application); g_set_application_name (_("Translation Editor")); gtk_window_set_default_icon_name (PACKAGE_APPID); @@ -738,6 +737,7 @@ gtr_application_new () return GTR_APPLICATION (g_object_new (GTR_TYPE_APPLICATION, "application-id", PACKAGE_APPID, "flags", G_APPLICATION_HANDLES_OPEN, + "resource-base-path", "/org/gnome/translator/", NULL)); } -- GitLab From c3c0905701b54e6360a20d8eec171373c4818c81 Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Mon, 15 May 2023 08:27:31 +0200 Subject: [PATCH 03/16] Remove app.quit from app menus This is not exposed in general in menus, only as a ctrl+q accelerator. --- src/gtr-dl-teams.ui | 4 ---- src/gtr-projects.ui | 4 ---- src/gtr-tab.ui | 4 ---- 3 files changed, 12 deletions(-) diff --git a/src/gtr-dl-teams.ui b/src/gtr-dl-teams.ui index 446cbf29..a6875df6 100644 --- a/src/gtr-dl-teams.ui +++ b/src/gtr-dl-teams.ui @@ -21,10 +21,6 @@ About Translation Editor app.about - - Quit - app.quit - diff --git a/src/gtr-projects.ui b/src/gtr-projects.ui index 1cfa39fc..64cd8b32 100644 --- a/src/gtr-projects.ui +++ b/src/gtr-projects.ui @@ -29,10 +29,6 @@ Help app.help - - Quit - app.quit - diff --git a/src/gtr-tab.ui b/src/gtr-tab.ui index 2f978805..474ec8e8 100644 --- a/src/gtr-tab.ui +++ b/src/gtr-tab.ui @@ -277,10 +277,6 @@ Help app.help - - Quit - app.quit - -- GitLab From 787618470b021b5c084ef1faffb1683686fe8782 Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Mon, 15 May 2023 08:29:40 +0200 Subject: [PATCH 04/16] preferences-dialog: Add flat class to menu button Buttons inside rows use these. --- src/gtr-preferences-dialog.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gtr-preferences-dialog.c b/src/gtr-preferences-dialog.c index cba4d2d2..83d2dbdc 100644 --- a/src/gtr-preferences-dialog.c +++ b/src/gtr-preferences-dialog.c @@ -277,6 +277,7 @@ create_profile_row (GtrPreferencesDialog *dlg, gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (menu), G_MENU_MODEL (gmenu)); gtk_menu_button_set_icon_name (GTK_MENU_BUTTON (menu), "view-more-symbolic"); adw_action_row_add_suffix (ADW_ACTION_ROW (row), menu); + gtk_widget_add_css_class (menu, "flat"); adw_action_row_set_activatable_widget (ADW_ACTION_ROW (row), check); -- GitLab From 5a7e154a9892b68f9d92afe0a9d0f99332c886dc Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Mon, 15 May 2023 08:30:19 +0200 Subject: [PATCH 05/16] Move About option after Help in menus All apps end in the About option in their menus. --- src/gtr-projects.ui | 8 ++++---- src/gtr-tab.ui | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/gtr-projects.ui b/src/gtr-projects.ui index 64cd8b32..ff46bde4 100644 --- a/src/gtr-projects.ui +++ b/src/gtr-projects.ui @@ -21,14 +21,14 @@ Keyboard Shortcuts win.show-help-overlay - - About Translation Editor - app.about - Help app.help + + About Translation Editor + app.about + diff --git a/src/gtr-tab.ui b/src/gtr-tab.ui index 474ec8e8..c41d13c4 100644 --- a/src/gtr-tab.ui +++ b/src/gtr-tab.ui @@ -269,14 +269,14 @@ Keyboard Shortcuts win.show-help-overlay - - About Translation Editor - app.about - Help app.help + + About Translation Editor + app.about + -- GitLab From 9d0c74767c9d1bf534ec06e551fa432d78ab59db Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Mon, 15 May 2023 08:31:41 +0200 Subject: [PATCH 06/16] preferences-dialog: Use Header Capitalization In tooltips. --- src/gtr-preferences-dialog.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gtr-preferences-dialog.c b/src/gtr-preferences-dialog.c index 83d2dbdc..5f93cf73 100644 --- a/src/gtr-preferences-dialog.c +++ b/src/gtr-preferences-dialog.c @@ -265,10 +265,10 @@ create_profile_row (GtrPreferencesDialog *dlg, // MenuButton gmenu = g_menu_new (); - gitem = g_menu_item_new (_("edit"), "profile.edit"); + gitem = g_menu_item_new (_("Edit"), "profile.edit"); g_menu_item_set_action_and_target (gitem, "profile.edit", "s", profile_name); g_menu_append_item (gmenu, gitem); - gitem = g_menu_item_new (_("delete"), "profile.delete"); + gitem = g_menu_item_new (_("Delete"), "profile.delete"); g_menu_item_set_action_and_target (gitem, "profile.delete", "s", profile_name); g_menu_append_item (gmenu, gitem); -- GitLab From d9fa0520bf7ef2d5efe49d0e9cb879bff1416746 Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Mon, 15 May 2023 08:33:28 +0200 Subject: [PATCH 07/16] window: Move devel class to construct Otherwise new windows don't have the proper style. --- src/gtr-application.c | 4 ---- src/gtr-window.c | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gtr-application.c b/src/gtr-application.c index 59c38a2c..47c658dc 100644 --- a/src/gtr-application.c +++ b/src/gtr-application.c @@ -676,10 +676,6 @@ gtr_application_setup_window (GApplication *application, window = gtr_application_create_window (GTR_APPLICATION (application)); gtk_application_add_window (GTK_APPLICATION (application), GTK_WINDOW (window)); - /** loading custom styles **/ - if (g_strrstr (PACKAGE_APPID, "Devel") != NULL) - gtk_widget_add_css_class (GTK_WIDGET (window), "devel"); - /* If it is the first run, the default directory was created in this * run, then we show the First run greeter */ diff --git a/src/gtr-window.c b/src/gtr-window.c index 7ab3e389..960bf195 100644 --- a/src/gtr-window.c +++ b/src/gtr-window.c @@ -248,6 +248,10 @@ gtr_window_init (GtrWindow *window) priv->state_settings = g_settings_new ("org.gnome.gtranslator.state.window"); priv->active_tab = NULL; + /* loading custom styles */ + if (g_strrstr (PACKAGE_APPID, "Devel") != NULL) + gtk_widget_add_css_class (GTK_WIDGET (window), "devel"); + gtk_widget_init_template (GTK_WIDGET (window)); /* Profile manager */ -- GitLab From f1456548d3b8a44ed61556530eff3f313b07db15 Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Mon, 15 May 2023 08:34:48 +0200 Subject: [PATCH 08/16] translatio-memory-dlg: Add pill style to button Buttons in this context use the pill class according to the HIG. --- src/translation-memory/gtr-translation-memory-dialog.ui | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/translation-memory/gtr-translation-memory-dialog.ui b/src/translation-memory/gtr-translation-memory-dialog.ui index ab5ff721..72806b47 100644 --- a/src/translation-memory/gtr-translation-memory-dialog.ui +++ b/src/translation-memory/gtr-translation-memory-dialog.ui @@ -79,8 +79,10 @@ True True True + center -- GitLab From db2140d3b5420878a7a17ebc88367ed1e1f678e5 Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Mon, 15 May 2023 08:39:13 +0200 Subject: [PATCH 09/16] window: Do not connect to "response" on non-dialog The translation memory dialog is not a GtkDialog and does not have this signal. --- src/gtr-window.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gtr-window.c b/src/gtr-window.c index 960bf195..dd173718 100644 --- a/src/gtr-window.c +++ b/src/gtr-window.c @@ -649,8 +649,6 @@ gtr_window_show_tm_dialog (GtrWindow *window) dlg = gtr_translation_memory_dialog_new (GTK_WINDOW (window), priv->translation_memory); - g_signal_connect (dlg, "response", G_CALLBACK (gtk_window_destroy), NULL); - gtk_window_present (GTK_WINDOW (dlg)); } -- GitLab From 49a29d352f0a88505d77427b8a735e3b867ad49b Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Mon, 15 May 2023 08:39:49 +0200 Subject: [PATCH 10/16] translation-memory-dialog: Use switch Instead of a check mark, this is more idiomatic UI. --- src/translation-memory/gtr-translation-memory-dialog.ui | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/translation-memory/gtr-translation-memory-dialog.ui b/src/translation-memory/gtr-translation-memory-dialog.ui index 72806b47..df791f2e 100644 --- a/src/translation-memory/gtr-translation-memory-dialog.ui +++ b/src/translation-memory/gtr-translation-memory-dialog.ui @@ -60,7 +60,7 @@ use_lang_profile_in_tm - + center -- GitLab From 695a9d662807c212aac256c3b49e3aa8600a1218 Mon Sep 17 00:00:00 2001 From: Maximiliano Sandoval R Date: Mon, 15 May 2023 08:40:53 +0200 Subject: [PATCH 11/16] dl-teams: Center Load File button Also makes use of proper Header Capitalization for the button. --- src/gtr-dl-teams.ui | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gtr-dl-teams.ui b/src/gtr-dl-teams.ui index a6875df6..4325ffd8 100644 --- a/src/gtr-dl-teams.ui +++ b/src/gtr-dl-teams.ui @@ -159,8 +159,8 @@ - Load file - end + Load File + center