Added logic to check if the focus need to be set. Squashed formatting commits.
This commit is contained in:
parent
d1833f6591
commit
45bcb345e8
|
@ -243,9 +243,16 @@ on_entry_key_press_event (GtkWidget *entry,
|
||||||
static void
|
static void
|
||||||
on_entry_realized (GtkWidget *entry,
|
on_entry_realized (GtkWidget *entry,
|
||||||
XedHighlightModeSelector *selector)
|
XedHighlightModeSelector *selector)
|
||||||
|
{
|
||||||
|
if (gtk_widget_is_focus (selector))
|
||||||
{
|
{
|
||||||
gtk_widget_grab_focus (entry);
|
gtk_widget_grab_focus (entry);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gtk_widget_grab_focus (selector);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
on_row_activated (GtkTreeView *tree_view,
|
on_row_activated (GtkTreeView *tree_view,
|
||||||
|
@ -281,7 +288,6 @@ xed_highlight_mode_selector_init (XedHighlightModeSelector *selector)
|
||||||
G_CALLBACK (on_entry_key_press_event), selector);
|
G_CALLBACK (on_entry_key_press_event), selector);
|
||||||
g_signal_connect (selector->entry, "realize",
|
g_signal_connect (selector->entry, "realize",
|
||||||
G_CALLBACK (on_entry_realized), selector);
|
G_CALLBACK (on_entry_realized), selector);
|
||||||
|
|
||||||
g_signal_connect (selector->treeview, "row-activated",
|
g_signal_connect (selector->treeview, "row-activated",
|
||||||
G_CALLBACK (on_row_activated), selector);
|
G_CALLBACK (on_row_activated), selector);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue