mirror of https://github.com/PCSX2/pcsx2.git
gsdx linux: don't require to hit enter for Texture Offset text entry
close #1292
This commit is contained in:
parent
b3b1f3ac68
commit
31b32d3b11
|
@ -87,21 +87,13 @@ GtkWidget* CreateComboBoxFromVector(const vector<GSSetting>& s, const char* opt_
|
||||||
return combo_box;
|
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)
|
void CB_EntryActived(GtkEntry *entry, gpointer user_data)
|
||||||
{
|
{
|
||||||
int hex_value = 0;
|
int hex_value = 0;
|
||||||
const gchar *data = gtk_entry_get_text(entry);
|
const gchar *data = gtk_entry_get_text(entry);
|
||||||
sscanf(data,"%X",&hex_value);
|
|
||||||
|
|
||||||
theApp.SetConfig((char*)user_data, hex_value);
|
if (sscanf(data,"%X",&hex_value) == 1)
|
||||||
|
theApp.SetConfig((char*)user_data, hex_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
GtkWidget* CreateTextBox(const char* opt_name)
|
GtkWidget* CreateTextBox(const char* opt_name)
|
||||||
|
@ -116,8 +108,7 @@ GtkWidget* CreateTextBox(const char* opt_name)
|
||||||
g_free(data);
|
g_free(data);
|
||||||
|
|
||||||
g_signal_connect(entry, "activate", G_CALLBACK(CB_EntryActived), const_cast<char*>(opt_name));
|
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, "changed", G_CALLBACK(CB_EntryActived), const_cast<char*>(opt_name));
|
||||||
g_signal_connect(entry, "preedit-changed", G_CALLBACK(CB_PreEntryActived), const_cast<char*>(opt_name));
|
|
||||||
|
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue