[gtranslator/gtk4: 24/52] Fixed popover, progress bar, and partially fixed search bar and worked on most of suggestions of Ma
- From: Daniel Garcia Moreno <danigm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtranslator/gtk4: 24/52] Fixed popover, progress bar, and partially fixed search bar and worked on most of suggestions of Ma
- Date: Mon, 5 Sep 2022 15:17:50 +0000 (UTC)
commit 3dbdb4d8a185bb4ff29a674ef90a5d1113bdbe71
Author: afshan ahmed khan <afshanahmeda2k gmail com>
Date: Sat Jun 25 16:18:27 2022 +0530
Fixed popover, progress bar, and partially fixed search bar and worked on most of suggestions of
Maximiliano
meson.build | 1 -
src/codeview/gtr-viewer.c | 9 +-
src/gtr-application.c | 2 +-
src/gtr-close-confirmation-dialog.c | 1 -
src/gtr-context.c | 2 +-
src/gtr-dl-teams.ui | 3 +
src/gtr-languages-fetcher.c | 3 +-
src/gtr-preferences-dialog-new.ui | 440 --------------------------
src/gtr-preferences-dialog.c | 7 +-
src/gtr-preferences-dialog.ui | 14 +-
src/gtr-profile-dialog.ui | 12 -
src/gtr-projects.c | 1 -
src/gtr-projects.ui | 15 +-
src/gtr-search-bar.c | 6 +-
src/gtr-search-bar.ui | 35 +-
src/gtr-tab-new.ui | 616 ------------------------------------
src/gtr-tab.c | 53 +++-
src/gtr-tab.ui | 85 +----
src/gtr-utils.c | 14 +-
src/gtr-window.c | 3 +-
20 files changed, 108 insertions(+), 1214 deletions(-)
---
diff --git a/meson.build b/meson.build
index 7c18c802..44fb73e9 100644
--- a/meson.build
+++ b/meson.build
@@ -113,7 +113,6 @@ gtr_deps = [
gtk_dep,
libadwaita_dep,
dependency('libgda-6.0'),
- dependency('atk'),
dependency('gio-2.0', version: '>= 2.36.0'),
dependency('gsettings-desktop-schemas'),
dependency('gthread-2.0', version: '>= 2.13.0'),
diff --git a/src/codeview/gtr-viewer.c b/src/codeview/gtr-viewer.c
index 92e373fe..58309a77 100644
--- a/src/codeview/gtr-viewer.c
+++ b/src/codeview/gtr-viewer.c
@@ -405,6 +405,12 @@ jump_to_line (GtkTextView *view, gint line)
0.25, FALSE, 0.0, 0.0);
}
+static void
+gtr_viewer_destroy (GtkWidget *dlg , GtkWidget **dlg_ptr)
+{
+ gtk_window_destroy(GTK_WINDOW(dlg));
+ *dlg_ptr = NULL;
+}
void
gtr_show_viewer (GtrWindow *window, const gchar *path, gint line)
{
@@ -433,8 +439,7 @@ gtr_show_viewer (GtrWindow *window, const gchar *path, gint line)
g_free (label);
g_signal_connect (dlg,
- "destroy", G_CALLBACK (gtk_window_destroy), NULL);
- g_free(dlg);
+ "destroy", G_CALLBACK (gtk_window_destroy), &dlg);
gtk_widget_show (GTK_WIDGET (dlg));
}
diff --git a/src/gtr-application.c b/src/gtr-application.c
index 785aac54..c6bd1a8e 100644
--- a/src/gtr-application.c
+++ b/src/gtr-application.c
@@ -892,7 +892,7 @@ gtr_application_create_window (GtrApplication *app)
* @original: TRUE if you want original TextViews.
* @translated: TRUE if you want translated TextViews.
*
- * Returns all the views currently present in #GtranslationApplication1
+ * Returns all the views currently present in #GtranslationApplication
*
* Return value: (transfer container) (element-type Gtranslator.View):
* a newly allocated list of #GtranslationApplication objects
diff --git a/src/gtr-close-confirmation-dialog.c b/src/gtr-close-confirmation-dialog.c
index 40cecdc3..82a85411 100644
--- a/src/gtr-close-confirmation-dialog.c
+++ b/src/gtr-close-confirmation-dialog.c
@@ -31,7 +31,6 @@
#include "gtr-utils.h"
#include "gtr-window.h"
#include "gtr-po.h"
-#include <atk/atk.h>
/* Properties */
diff --git a/src/gtr-context.c b/src/gtr-context.c
index 9c40f633..4786aac3 100644
--- a/src/gtr-context.c
+++ b/src/gtr-context.c
@@ -144,7 +144,7 @@ setup_notes_edition (GtrContextPanel *panel)
dd->text_buffer = text_buffer;
g_signal_connect (dialog, "response", G_CALLBACK (dialog_response_cb), dd);
- gtk_widget_show (dialog);
+ gtk_window_present (GTK_WINDOW (dialog));
}
static void
diff --git a/src/gtr-dl-teams.ui b/src/gtr-dl-teams.ui
index 68344191..10fe6707 100644
--- a/src/gtr-dl-teams.ui
+++ b/src/gtr-dl-teams.ui
@@ -119,6 +119,9 @@
<property name="AtkObject::accessible-name" translatable="1">Main Menu</property>
</object>
</child>-->
+ <accessibility>
+ <property name="label" translatable="yes">Main Menu</property>
+ </accessibility>
</object>
</child>
</object>
diff --git a/src/gtr-languages-fetcher.c b/src/gtr-languages-fetcher.c
index 4eb6c468..e85daf14 100644
--- a/src/gtr-languages-fetcher.c
+++ b/src/gtr-languages-fetcher.c
@@ -365,7 +365,8 @@ gtr_languages_fetcher_init (GtrLanguagesFetcher *fetcher)
root_objects, &error);
if (error)
{
- g_debug("%s \n", error->message);
+ g_warning("%s \n", error->message);
+ g_error_free (error);
}
content = GTK_WIDGET (gtk_builder_get_object (builder, "main_box"));
diff --git a/src/gtr-preferences-dialog.c b/src/gtr-preferences-dialog.c
index 8dd8122f..eb55fe5e 100644
--- a/src/gtr-preferences-dialog.c
+++ b/src/gtr-preferences-dialog.c
@@ -682,6 +682,7 @@ gtr_preferences_dialog_init (GtrPreferencesDialog * dlg)
if (error)
{
g_debug("%s \n",error->message);
+ g_free(error);
}
priv->notebook = GTK_WIDGET (gtk_builder_get_object (builder, "notebook"));
g_object_ref (priv->notebook);
@@ -729,6 +730,7 @@ gtr_preferences_dialog_init (GtrPreferencesDialog * dlg)
gtk_font_chooser_set_font (GTK_FONT_CHOOSER (priv->font_button), font);
g_signal_connect (priv->font_button, "font-set", G_CALLBACK (on_font_set), dlg);
+ g_free(error);
}
static void
@@ -755,7 +757,8 @@ gtr_preferences_dialog_class_init (GtrPreferencesDialogClass * klass)
g_debug("class_init ran\n");
}
-static void gtr_destroy_preferences_dialog (GtkWidget *dlg , GtkWidget **dlg_ptr)
+static void
+gtr_destroy_preferences_dialog (GtkWidget *dlg , GtkWidget **dlg_ptr)
{
gtk_window_destroy(GTK_WINDOW(dlg));
*dlg_ptr = NULL;
@@ -775,7 +778,7 @@ gtr_show_preferences_dialog (GtrWindow * window)
g_signal_connect (dlg,
"destroy", G_CALLBACK (gtr_destroy_preferences_dialog), &dlg);
gtk_window_set_transient_for (GTK_WINDOW (dlg), GTK_WINDOW (window));
- gtk_widget_show (dlg);
+ gtk_window_present (GTK_WINDOW(dlg));
}
//gtk_window_set_type_hint (GTK_WINDOW (dlg), GDK_WINDOW_TYPE_HINT_DIALOG);
diff --git a/src/gtr-preferences-dialog.ui b/src/gtr-preferences-dialog.ui
index 1df5e029..0dc4f1ae 100644
--- a/src/gtr-preferences-dialog.ui
+++ b/src/gtr-preferences-dialog.ui
@@ -64,7 +64,6 @@
<property name="margin_end">6</property>
<property name="margin_top">6</property>
<property name="margin_bottom">6</property>
- <property name="visible">TRUE</property>
<!-- page1 -->
<child>
@@ -359,22 +358,13 @@
<object class="GtkButton" id="add-button">
<property name="focusable">1</property>
<property name="receives_default">1</property>
- <child>
- <object class="GtkImage" id="image1">
- <property name="icon_name">list-add-symbolic</property>
- </object>
- </child>
+ <property name="icon_name">list-add-symbolic</property>
</object>
</child>
<child type="end">
<object class="GtkButton" id="delete-button">
- <property name="focusable">1</property>
<property name="receives_default">1</property>
- <child>
- <object class="GtkImage" id="image2">
- <property name="icon_name">list-remove-symbolic</property>
- </object>
- </child>
+ <property name="icon_name">list-remove-symbolic</property>
</object>
</child>
<child type="end">
diff --git a/src/gtr-profile-dialog.ui b/src/gtr-profile-dialog.ui
index e9deb338..0bfbd521 100644
--- a/src/gtr-profile-dialog.ui
+++ b/src/gtr-profile-dialog.ui
@@ -10,9 +10,6 @@
<property name="modal">1</property>
<property name="window_position">center-on-parent</property>
<property name="type_hint">dialog</property>
- <child type="titlebar">
- <placeholder/>
- </child>
<child internal-child="content_area">
<object class="GtkBox" id="vbox1">
<!--<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>-->
@@ -196,9 +193,6 @@
</child>
<child>
<object class="GtkBox" id="fetcher_box">
- <child>
- <placeholder/>
- </child>
<layout>
<property name="column">0</property>
<property name="row">8</property>
@@ -220,12 +214,6 @@
<property name="can_focus">False</property>
<!--<property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK |
GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property>-->
<!--<property name="layout_style">end</property>-->
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
</object>
</child>
</object>
diff --git a/src/gtr-projects.c b/src/gtr-projects.c
index add776d9..9f328454 100644
--- a/src/gtr-projects.c
+++ b/src/gtr-projects.c
@@ -24,7 +24,6 @@
#include "gtr-projects.h"
#include "gtr-window.h"
#include "gtr-utils.h"
-#include "atk/atk.h"
typedef struct
{
diff --git a/src/gtr-projects.ui b/src/gtr-projects.ui
index b08fb191..a048ad6e 100644
--- a/src/gtr-projects.ui
+++ b/src/gtr-projects.ui
@@ -78,19 +78,12 @@
</child>
<child type="end">
<object class="GtkMenuButton" id="main_menu">
- <property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="popover">main_menu_popover</property>
- <child>
- <object class="GtkImage">
- <property name="icon_name">open-menu-symbolic</property>
- </object>
- </child>
- <!-- <child internal-child="accessible">
- <object class="AtkObject" id="main_menu-atkobject">
- <property name="AtkObject::accessible-name" translatable="1">Main Menu</property>
- </object>
- </child> -->
+ <property name="icon_name">open-menu-symbolic</property>
+ <accessibility>
+ <property name="label" translatable="yes">Main Menu</property>
+ </accessibility>
</object>
</child>
</object>
diff --git a/src/gtr-search-bar.c b/src/gtr-search-bar.c
index 38cb8f26..79fccaa5 100644
--- a/src/gtr-search-bar.c
+++ b/src/gtr-search-bar.c
@@ -102,7 +102,6 @@ gtr_search_bar_get_search_text (GtrSearchBar *dialog)
//g_assert (GTR_IS_SEARCH_BAR (dialog));
g_return_val_if_fail (GTR_IS_SEARCH_BAR (dialog), NULL);
- //return gtk_entry_get_text (GTK_ENTRY (dialog->search_entry));
const gchar *text;
GtkEntryBuffer *buffer = gtk_entry_get_buffer (GTK_ENTRY(dialog->search_entry));
text = gtk_entry_buffer_get_text (buffer);
@@ -672,6 +671,7 @@ gtr_search_bar_class_init (GtrSearchBarClass *klass)
gtk_widget_class_set_css_name (widget_class, "gtrsearchbar");
+ //CLEANUP:
/* Replace by gtk_widget_class_add_binding_signal in gtk 4. */
/* Also add gtk_widget_class_add_binding for next-match and previous-match as
* in gtksearchentry.c, which are already in the app as app.find-next and
@@ -697,9 +697,6 @@ gtr_search_bar_init (GtrSearchBar *self)
self->at_original_text = TRUE;
self->at_translated_text = TRUE;
- //TODO: Replace in gtk4
- //g_object_set (G_OBJECT (self->next_button), "can-default", TRUE, NULL);
-
self->search_bindings = g_binding_group_new ();
g_binding_group_bind_full (self->search_bindings, "search-text",
@@ -749,7 +746,6 @@ gtr_search_bar_init (GtrSearchBar *self)
self);
add_actions (self);
- g_printf("init: search bar\n");
}
void
diff --git a/src/gtr-search-bar.ui b/src/gtr-search-bar.ui
index 00923f48..094cd336 100644
--- a/src/gtr-search-bar.ui
+++ b/src/gtr-search-bar.ui
@@ -15,7 +15,6 @@
<property name="column_spacing">8</property>
<child>
<object class="GtkEntry" id="search_entry">
- <property name="focusable">1</property>
<property name="hexpand">1</property>
<property name="primary_icon_name">edit-find-symbolic</property>
<property name="primary_icon_activatable">0</property>
@@ -46,7 +45,6 @@
<child>
<object class="GtkEntry" id="replace_entry">
<property name="visible">0</property>
- <property name="focusable">1</property>
<property name="width-chars">20</property>
<property name="max-width-chars">30</property>
<property name="primary_icon_name">edit-find-replace-symbolic</property>
@@ -67,22 +65,13 @@
</style>
<child>
<object class="GtkButton" id="previous_button">
- <child>
- <object class="GtkImage">
- <property name="icon_name">go-up-symbolic</property>
- <property name="icon_size">normal</property>
- </object>
- </child>
+ <!--CLEANUP: <property name="action-name">editor-search.move-previous</property> -->
+ <property name="icon_name">go-up-symbolic</property>
</object>
</child>
<child>
<object class="GtkButton" id="next_button">
- <child>
- <object class="GtkImage">
- <property name="icon_name">go-down-symbolic</property>
- <property name="icon_size">normal</property>
- </object>
- </child>
+ <property name="icon_name">go-down-symbolic</property>
</object>
</child>
<layout>
@@ -95,7 +84,6 @@
<object class="GtkButton" id="replace_button">
<property name="label" translatable="1">Replace</property>
<property name="visible">0</property>
- <property name="focusable">1</property>
<layout>
<property name="column">1</property>
<property name="row">2</property>
@@ -106,7 +94,8 @@
<object class="GtkButton" id="replace_all_button">
<property name="label" translatable="1">Replace All</property>
<property name="visible">0</property>
- <property name="focusable">1</property>
+ <!--TODO: <property name="action-name">editor-search.replace-all</property> -->
+ <property name="action_name">editor-search.replace-all</property>
<layout>
<property name="column">2</property>
<property name="row">2</property>
@@ -122,25 +111,15 @@
<object class="GtkToggleButton">
<property name="active" bind-source="GtrSearchBar" bind-property="replace-mode"
bind-flags="sync-create|bidirectional"/>
<property name="tooltip-text" translatable="1">Switch between Search and
Search-and-Replace</property>
- <property name="focusable">1</property>
- <child>
- <object class="GtkImage">
- <property name="icon_name">edit-find-replace-symbolic</property>
- </object>
- </child>
+ <property name="icon_name">edit-find-replace-symbolic</property>
</object>
</child>
<child>
<object class="GtkToggleButton" id="show_options">
<property name="tooltip-text" translatable="1">Show or hide search options such as case
sensitivity</property>
<property name="focus-on-click">0</property>
- <property name="focusable">1</property>
<property name="active" bind-source="GtrSearchBar" bind-property="show-options"
bind-flags="sync-create|bidirectional"/>
- <child>
- <object class="GtkImage">
- <property name="icon_name">emblem-system-symbolic</property>
- </object>
- </child>
+ <property name="icon_name">emblem-system-symbolic</property>
</object>
</child>
<layout>
diff --git a/src/gtr-tab.c b/src/gtr-tab.c
index 781fa743..27f8bb52 100644
--- a/src/gtr-tab.c
+++ b/src/gtr-tab.c
@@ -68,7 +68,7 @@ typedef struct
GSettings *editor_settings;
GSettings *state_settings;
- GtkWidget *progress_eventbox;
+ GtkWidget *progress_gesture_click;
GtkWidget *progress_box;
GtkWidget *progress_revealer;
GtkWidget *progress_percentage;
@@ -133,6 +133,9 @@ typedef struct
GtkWidget *titlebar;
GtkWidget *save;
GtkWidget *sort_id;
+ GtkWidget *sort_status;
+ GtkWidget *sort_msgid;
+ GtkWidget *sort_translated;
GtkWidget *order_menu_popover;
GtkWidget *search_toggle;
GtkWidget *upload;
@@ -262,7 +265,7 @@ gtr_page_notify_child_revealed (GtrTab *tab,
//----------------------------------------------------------------//
-/*static gboolean
+static gboolean
show_hide_revealer (GtkWidget *widget, GdkEvent *ev, GtrTab *tab)
{
GtrTabPrivate *priv;
@@ -273,7 +276,7 @@ show_hide_revealer (GtkWidget *widget, GdkEvent *ev, GtrTab *tab)
gtk_revealer_set_reveal_child (rev, !gtk_revealer_get_reveal_child (rev));
return TRUE;
-}*/
+}
static gboolean
msg_grab_focus (GtrTab *tab)
@@ -830,6 +833,30 @@ on_state_notify (GtrPo *po,
g_object_notify (G_OBJECT (tab), "name");
}
+static void
+sort_by_id_cb (GtkWidget *checkbutton, GtrTab* tab)
+{
+ gtr_tab_sort_by(tab,(GtrMessageTableSortBy) 0);
+}
+
+static void
+sort_by_status_cb (GtkWidget *checkbutton, GtrTab* tab)
+{
+ gtr_tab_sort_by(tab,(GtrMessageTableSortBy) 1);
+}
+
+static void
+sort_by_msgid_cb (GtkWidget *checkbutton, GtrTab* tab)
+{
+ gtr_tab_sort_by(tab,(GtrMessageTableSortBy) 3);
+}
+
+static void
+sort_by_translated_cb (GtkWidget *checkbutton, GtrTab* tab)
+{
+ gtr_tab_sort_by(tab,(GtrMessageTableSortBy) 5);
+}
+
static void
gtr_tab_init (GtrTab * tab)
{
@@ -870,14 +897,27 @@ gtr_tab_init (GtrTab * tab)
priv->find_replace_flag = FALSE;
priv->progress = gtr_progress_new ();
+ priv->progress_gesture_click = gtk_gesture_click_new();
gtk_widget_show (GTK_WIDGET (priv->progress));
+ gtk_widget_add_controller(priv->progress_box, priv->progress_gesture_click);
gtk_box_append (GTK_BOX (priv->progress_box), GTK_WIDGET (priv->progress));
- //g_signal_connect (priv->progress_eventbox, "button-press-event",
- //G_CALLBACK (show_hide_revealer), tab);
+ g_signal_connect (priv->progress_gesture_click, "pressed",
+ G_CALLBACK (show_hide_revealer), tab);
g_signal_connect (priv->search_revealer, "notify::child-revealed",
G_CALLBACK (emit_searchbar_toggled), tab);
+
+ // TODO: related to header of gtr tab move to saperate header file
+ g_signal_connect (priv->sort_id, "toggled",
+ G_CALLBACK(sort_by_id_cb), tab);
+ g_signal_connect (priv->sort_status, "toggled",
+ G_CALLBACK(sort_by_status_cb), tab);
+ g_signal_connect (priv->sort_msgid, "toggled",
+ G_CALLBACK(sort_by_msgid_cb), tab);
+ g_signal_connect (priv->sort_translated, "toggled",
+ G_CALLBACK(sort_by_translated_cb), tab);
+ gtk_check_button_set_active (priv->sort_id, TRUE);
}
static void
@@ -1101,6 +1141,9 @@ gtr_tab_class_init (GtrTabClass * klass)
gtk_widget_class_bind_template_child_private (widget_class, GtrTab, titlebar);
gtk_widget_class_bind_template_child_private (widget_class, GtrTab, sort_id);
+ gtk_widget_class_bind_template_child_private (widget_class, GtrTab, sort_status);
+ gtk_widget_class_bind_template_child_private (widget_class, GtrTab, sort_msgid);
+ gtk_widget_class_bind_template_child_private (widget_class, GtrTab, sort_translated);
gtk_widget_class_bind_template_child_private (widget_class, GtrTab, order_menu_popover);
gtk_widget_class_bind_template_child_private (widget_class, GtrTab, search_toggle);
gtk_widget_class_bind_template_child_private (widget_class, GtrTab, undo);
diff --git a/src/gtr-tab.ui b/src/gtr-tab.ui
index cc7b1766..d2121ce6 100644
--- a/src/gtr-tab.ui
+++ b/src/gtr-tab.ui
@@ -16,7 +16,6 @@
<signal name="notify::child-revealed" handler="gtr_page_notify_child_revealed" swapped="true"
object="GtrTab"/>
<child>
<object class="GtrSearchBar" id="search_bar">
- <property name="visible">True</property>
<signal name="stop-search" handler="gtr_page_stop_search" swapped="true" object="GtrTab"/>
</object>
</child>
@@ -198,7 +197,7 @@
</child>
</template>
- <object class="GtkPopoverMenu" id="order_menu_popover">
+ <object class="GtkPopover" id="order_menu_popover">
<property name="child">
<object class="GtkBox">
<property name="margin_start">6</property>
@@ -221,27 +220,27 @@
</child>
<child>
<object class="GtkCheckButton" id="sort_id">
- <property name="action_name">app.sort_by_id</property>
+ <!--<property name="action_name">app.sort_by_id</property>-->
<property name="label" translatable="1">Appearance in the original file</property>
</object>
</child>
<child>
<object class="GtkCheckButton" id="sort_status">
- <property name="action_name">app.sort_by_status</property>
+ <!--<property name="action_name">app.sort_by_status</property>-->
<property name="label" translatable="1">Message status</property>
<property name="group">sort_id</property>
</object>
</child>
<child>
<object class="GtkCheckButton" id="sort_msgid">
- <property name="action_name">app.sort_by_msgid</property>
+ <!--<property name="action_name">app.sort_by_msgid</property>-->
<property name="label" translatable="1">Original message</property>
<property name="group">sort_id</property>
</object>
</child>
<child>
<object class="GtkCheckButton" id="sort_translated">
- <property name="action_name">app.sort_by_translated</property>
+ <!--<property name="action_name">app.sort_by_translated</property>-->
<property name="label" translatable="1">Translated message</property>
<property name="group">sort_id</property>
</object>
@@ -310,23 +309,14 @@
<property name="receives_default">1</property>
<property name="tooltip_text" translatable="1">Open a new file (<Ctrl>o)</property>
<property name="action_name">app.open</property>
- <child>
- <object class="GtkImage">
- <property name="icon_name">document-open-symbolic</property>
- </object>
- </child>
+ <property name="icon_name">document-open-symbolic</property>
</object>
</child>
<child>
<object class="GtkButton" id="dl_button">
<property name="tooltip_text" translatable="1">Open from Damned Lies (<Ctrl>d)</property>
<property name="action_name">app.dl</property>
- <child>
- <object class="GtkImage">
- <property name="focusable">1</property>
- <property name="icon_name">folder-download-symbolic</property>
- </object>
- </child>
+ <property name="icon_name">folder-download-symbolic</property>
</object>
</child>
<style>
@@ -345,11 +335,7 @@
<property name="receives_default">1</property>
<property name="tooltip_text" translatable="1">Undo (<Ctrl>z)</property>
<property name="action_name">app.undo</property>
- <child>
- <object class="GtkImage">
- <property name="icon_name">edit-undo-symbolic</property>
- </object>
- </child>
+ <property name="icon_name">edit-undo-symbolic</property>
</object>
</child>
<child>
@@ -358,11 +344,7 @@
<property name="receives_default">1</property>
<property name="tooltip_text" translatable="1">Redo (<Ctrl><Shift>z)</property>
<property name="action_name">app.redo</property>
- <child>
- <object class="GtkImage">
- <property name="icon_name">edit-redo-symbolic</property>
- </object>
- </child>
+ <property name="icon_name">edit-redo-symbolic</property>
</object>
</child>
<style>
@@ -381,11 +363,7 @@
<property name="receives_default">1</property>
<property name="tooltip_text" translatable="1">Previous message without translation
(<Alt><Page Up>)</property>
<property name="action_name">app.prev_no</property>
- <child>
- <object class="GtkImage">
- <property name="icon_name">go-up-symbolic</property>
- </object>
- </child>
+ <property name="icon_name">go-up-symbolic</property>
</object>
</child>
<child>
@@ -394,11 +372,7 @@
<property name="receives_default">1</property>
<property name="tooltip_text" translatable="1">Next message without translation
(<Alt><Page Down>)</property>
<property name="action_name">app.next_no</property>
- <child>
- <object class="GtkImage">
- <property name="icon_name">go-down-symbolic</property>
- </object>
- </child>
+ <property name="icon_name">go-down-symbolic</property>
</object>
</child>
<style>
@@ -411,15 +385,10 @@
</child>
<child>
<object class="GtkButton">
- <property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="tooltip_text" translatable="1">Toggle fuzzy state (<Ctrl>+u)</property>
<property name="action_name">app.fuzzy</property>
- <child>
- <object class="GtkImage">
- <property name="icon_name">weather-fog-symbolic</property>
- </object>
- </child>
+ <property name="icon_name">weather-fog-symbolic</property>
</object>
</child>
<child>
@@ -428,11 +397,7 @@
<property name="receives_default">1</property>
<property name="popover">order_menu_popover</property>
<property name="tooltip_text" translatable="1">Sort messages by</property>
- <child>
- <object class="GtkImage">
- <property name="icon_name">view-sort-ascending-symbolic</property>
- </object>
- </child>
+ <property name="icon_name">view-sort-ascending-symbolic</property>
<!-- TODO: To be replace in gtk4
<child internal-child="accessible">
@@ -447,11 +412,7 @@
<property name="focusable">1</property>
<property name="receives_default">1</property>
<property name="popover">main_menu_popover</property>
- <child>
- <object class="GtkImage">
- <property name="icon_name">open-menu-symbolic</property>
- </object>
- </child>
+ <property name="icon_name">open-menu-symbolic</property>
<!-- TODO: To be replace in gtk4
<child internal-child="accessible">
<object class="AtkObject" id="main_menu-atkobject">
@@ -466,11 +427,7 @@
<property name="receives_default">1</property>
<property name="tooltip_text" translatable="1">Find (<Ctrl><f>)</property>
<property name="action_name">app.findtoggle</property>
- <child>
- <object class="GtkImage">
- <property name="icon_name">edit-find-symbolic</property>
- </object>
- </child>
+ <property name="icon_name">edit-find-symbolic</property>
</object>
</child>
<child type="end">
@@ -496,11 +453,7 @@
<property name="receives_default">1</property>
<property name="tooltip_text" translatable="1">Save as (<Ctrl><Shift>s)</property>
<property name="action_name">app.saveas</property>
- <child>
- <object class="GtkImage">
- <property name="icon_name">document-save-as-symbolic</property>
- </object>
- </child>
+ <property name="icon_name">document-save-as-symbolic</property>
</object>
</child>
<child>
@@ -509,11 +462,7 @@
<property name="receives_default">1</property>
<property name="tooltip_text" translatable="1">Upload file (<Ctrl>b)</property>
<property name="action_name">app.upload_file</property>
- <child>
- <object class="GtkImage">
- <property name="icon_name">document-send-symbolic</property>
- </object>
- </child>
+ <property name="icon_name">document-send-symbolic</property>
</object>
</child>
<style>
diff --git a/src/gtr-utils.c b/src/gtr-utils.c
index 80f13a8e..2e1f4ab3 100644
--- a/src/gtr-utils.c
+++ b/src/gtr-utils.c
@@ -39,6 +39,7 @@
#include <glib.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
+#include <adwaita.h>
xmlDocPtr
gtr_xml_new_doc (const gchar * name)
@@ -79,9 +80,11 @@ gtr_gtk_button_new_with_icon_name (const gchar * label,
gtk_button_set_image (GTK_BUTTON (button),
gtk_image_new_from_icon_name (icon_name,
GTK_ICON_SIZE_BUTTON));*/
- button = gtk_button_new_from_icon_name (icon_name);
- gtk_button_set_label (GTK_BUTTON(button), label);
- gtk_button_set_use_underline (GTK_BUTTON(button), true);
+ //button = gtk_button_new_from_icon_name (icon_name);
+ button = adw_button_content_new ();
+ adw_button_content_set_label (ADW_BUTTON_CONTENT(button), label);
+ adw_button_content_set_use_underline (ADW_BUTTON_CONTENT(button), true);
+ adw_button_content_set_icon_name (ADW_BUTTON_CONTENT(button), icon_name);
return button;
}
@@ -457,8 +460,9 @@ finally_2:
void
gtr_utils_help_display (GtkWindow * window)
{
- /*gtk_show_uri_on_window (GTK_WINDOW (window), "help:gtranslator",
- gtk_get_current_event_time (), NULL);*/
+ gtk_show_uri (GTK_WINDOW (window), "help:gtranslator",
+ g_get_real_time ());
+ //gtk_get_current_event_time (), NULL);
}
gchar *
diff --git a/src/gtr-window.c b/src/gtr-window.c
index 838153c6..a3472b03 100644
--- a/src/gtr-window.c
+++ b/src/gtr-window.c
@@ -127,7 +127,7 @@ update_undo_state (GtrTab *tab,
*/
static void
gtr_window_update_statusbar_message_count (GtrTab * tab,
- GtrMsg *message,
+ GtrMsg * message,
GtrWindow * window)
{
GtrTab *active_tab;
@@ -609,7 +609,6 @@ gtr_window_create_tab (GtrWindow * window, GtrPo * po)
g_signal_connect (tab, "searchbar-toggled", G_CALLBACK (searchbar_toggled), window);
- //Don't know why this is not setting title
set_window_title (window, TRUE);
return tab;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]