Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
gtranslator
Commits
ab01ab4c
Commit
ab01ab4c
authored
May 11, 2022
by
Daniel Garcia Moreno
Browse files
Grab focus on msg just when clicking
Fix
#158
parent
e697c1b3
Pipeline
#397007
passed with stages
in 3 minutes and 31 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/gtr-actions-search.c
View file @
ab01ab4c
...
...
@@ -204,7 +204,7 @@ find_in_list (GtrWindow * window,
found
=
run_search
(
GTR_VIEW
(
viewsaux
->
data
),
found
);
if
(
found
)
{
gtr_tab_message_go_to
(
tab
,
l
->
data
,
FALS
E
,
GTR_TAB_MOVE_NONE
);
gtr_tab_message_go_to
(
tab
,
l
->
data
,
TRU
E
,
GTR_TAB_MOVE_NONE
);
run_search
(
GTR_VIEW
(
viewsaux
->
data
),
aux
);
return
TRUE
;
}
...
...
@@ -303,7 +303,7 @@ do_find (GtrSearchBar * dialog, GtrWindow * window, gboolean search_backwards)
restore_last_searched_data
(
dialog
,
tab
);
if
(
!
found
&&
current_msg
)
gtr_tab_message_go_to
(
tab
,
current_msg
->
data
,
FALS
E
,
GTR_TAB_MOVE_NONE
);
gtr_tab_message_go_to
(
tab
,
current_msg
->
data
,
TRU
E
,
GTR_TAB_MOVE_NONE
);
gtr_search_bar_set_found
(
dialog
,
found
);
}
...
...
src/gtr-tab.c
View file @
ab01ab4c
...
...
@@ -261,6 +261,15 @@ show_hide_revealer (GtkWidget *widget, GdkEvent *ev, GtrTab *tab)
return
TRUE
;
}
static
gboolean
msg_grab_focus
(
GtrTab
*
tab
)
{
GtrTabPrivate
*
priv
;
priv
=
gtr_tab_get_instance_private
(
tab
);
gtk_widget_grab_focus
(
priv
->
trans_msgstr
[
0
]);
return
FALSE
;
}
static
void
install_autosave_timeout
(
GtrTab
*
tab
)
{
...
...
@@ -1182,7 +1191,9 @@ gtr_tab_get_all_views (GtrTab * tab, gboolean original, gboolean translated)
**/
void
gtr_tab_message_go_to
(
GtrTab
*
tab
,
GtrMsg
*
to_go
,
gboolean
searching
,
GtrTabMove
move
)
GtrMsg
*
to_go
,
gboolean
searching
,
GtrTabMove
move
)
{
static
gboolean
first_msg
=
TRUE
;
GtrTabPrivate
*
priv
;
...
...
@@ -1254,8 +1265,15 @@ gtr_tab_message_go_to (GtrTab * tab,
* Emitting showed-message signal
*/
if
(
!
searching
)
g_signal_emit
(
G_OBJECT
(
tab
),
signals
[
SHOWED_MESSAGE
],
0
,
GTR_MSG
(
to_go
));
{
g_signal_emit
(
G_OBJECT
(
tab
),
signals
[
SHOWED_MESSAGE
],
0
,
GTR_MSG
(
to_go
));
// Grabbing the focus in the GtrView to edit the message
// This is done in the idle add to avoid the focus grab from the
// message-table
g_idle_add
((
GSourceFunc
)
msg_grab_focus
,
tab
);
}
}
/**
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment