gsdx linux: don't require to hit enter for Texture Offset text entry

close #1292
This commit is contained in:
Gregory Hainaut 2016-11-08 20:27:42 +01:00
parent b3b1f3ac68
commit 31b32d3b11
1 changed files with 3 additions and 12 deletions

View File

@ -87,20 +87,12 @@ GtkWidget* CreateComboBoxFromVector(const vector<GSSetting>& s, const char* opt_
return combo_box;
}
void CB_PreEntryActived(GtkEntry *entry, gchar* preedit, gpointer user_data)
{
int hex_value = 0;
sscanf(preedit,"%X",&hex_value);
theApp.SetConfig((char*)user_data, hex_value);
}
void CB_EntryActived(GtkEntry *entry, gpointer user_data)
{
int hex_value = 0;
const gchar *data = gtk_entry_get_text(entry);
sscanf(data,"%X",&hex_value);
if (sscanf(data,"%X",&hex_value) == 1)
theApp.SetConfig((char*)user_data, hex_value);
}
@ -116,8 +108,7 @@ GtkWidget* CreateTextBox(const char* opt_name)
g_free(data);
g_signal_connect(entry, "activate", G_CALLBACK(CB_EntryActived), const_cast<char*>(opt_name));
// Note it doesn't seem to work as expected
g_signal_connect(entry, "preedit-changed", G_CALLBACK(CB_PreEntryActived), const_cast<char*>(opt_name));
g_signal_connect(entry, "changed", G_CALLBACK(CB_EntryActived), const_cast<char*>(opt_name));
return entry;
}