mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-19 04:00:19 +00:00
Compare commits
3 Commits
master
...
os-emoji-m
| Author | SHA1 | Date | |
|---|---|---|---|
| 60cc85b943 | |||
| 4d140fc051 | |||
| 64dcee10eb |
@@ -461,6 +461,8 @@ static void mg_create_entry (session *sess, GtkWidget *box);
|
|||||||
static void mg_create_search (session *sess, GtkWidget *box);
|
static void mg_create_search (session *sess, GtkWidget *box);
|
||||||
#ifdef G_OS_WIN32
|
#ifdef G_OS_WIN32
|
||||||
static GdkFilterReturn mg_win32_filter (GdkXEvent *xevent, GdkEvent *event, gpointer data);
|
static GdkFilterReturn mg_win32_filter (GdkXEvent *xevent, GdkEvent *event, gpointer data);
|
||||||
|
static void mg_show_win32_emoji_panel (GtkEntry *entry);
|
||||||
|
static void mg_inputbox_icon_press (GtkEntry *entry, GtkEntryIconPosition icon_pos, GdkEvent *event, gpointer user_data);
|
||||||
#endif
|
#endif
|
||||||
static void mg_link_irctab (session *sess, int focus);
|
static void mg_link_irctab (session *sess, int focus);
|
||||||
|
|
||||||
@@ -4027,7 +4029,13 @@ mg_create_entry (session *sess, GtkWidget *box)
|
|||||||
if (prefs.hex_gui_input_style)
|
if (prefs.hex_gui_input_style)
|
||||||
mg_apply_entry_style (entry);
|
mg_apply_entry_style (entry);
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
g_object_set (G_OBJECT (entry), "show-emoji-icon", FALSE, NULL);
|
||||||
|
gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry), GTK_ENTRY_ICON_PRIMARY, NULL);
|
||||||
|
g_signal_connect (G_OBJECT (entry), "icon-press", G_CALLBACK (mg_inputbox_icon_press), NULL);
|
||||||
|
#else
|
||||||
g_object_set (G_OBJECT (entry), "show-emoji-icon", TRUE, NULL);
|
g_object_set (G_OBJECT (entry), "show-emoji-icon", TRUE, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (gtk_entry_get_icon_storage_type (GTK_ENTRY (entry), GTK_ENTRY_ICON_SECONDARY) == GTK_IMAGE_EMPTY)
|
if (gtk_entry_get_icon_storage_type (GTK_ENTRY (entry), GTK_ENTRY_ICON_SECONDARY) == GTK_IMAGE_EMPTY)
|
||||||
{
|
{
|
||||||
@@ -4037,6 +4045,62 @@ mg_create_entry (session *sess, GtkWidget *box)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef G_OS_WIN32
|
||||||
|
static void
|
||||||
|
mg_show_win32_emoji_panel (GtkEntry *entry)
|
||||||
|
{
|
||||||
|
INPUT input[4];
|
||||||
|
GdkRectangle icon_rect;
|
||||||
|
GtkWidget *widget;
|
||||||
|
GdkWindow *window;
|
||||||
|
gint pointer_x, pointer_y;
|
||||||
|
|
||||||
|
widget = GTK_WIDGET (entry);
|
||||||
|
if (gtk_widget_get_realized (widget))
|
||||||
|
{
|
||||||
|
window = gtk_widget_get_window (widget);
|
||||||
|
if (window)
|
||||||
|
{
|
||||||
|
gtk_entry_get_icon_area (entry, GTK_ENTRY_ICON_SECONDARY, &icon_rect);
|
||||||
|
gdk_window_get_root_coords (window,
|
||||||
|
icon_rect.x + (icon_rect.width / 2),
|
||||||
|
icon_rect.y,
|
||||||
|
&pointer_x,
|
||||||
|
&pointer_y);
|
||||||
|
SetCursorPos (pointer_x, pointer_y);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
ZeroMemory (input, sizeof (input));
|
||||||
|
|
||||||
|
input[0].type = INPUT_KEYBOARD;
|
||||||
|
input[0].ki.wVk = VK_LWIN;
|
||||||
|
input[1].type = INPUT_KEYBOARD;
|
||||||
|
input[1].ki.wVk = VK_OEM_PERIOD;
|
||||||
|
input[2].type = INPUT_KEYBOARD;
|
||||||
|
input[2].ki.wVk = VK_OEM_PERIOD;
|
||||||
|
input[2].ki.dwFlags = KEYEVENTF_KEYUP;
|
||||||
|
input[3].type = INPUT_KEYBOARD;
|
||||||
|
input[3].ki.wVk = VK_LWIN;
|
||||||
|
input[3].ki.dwFlags = KEYEVENTF_KEYUP;
|
||||||
|
|
||||||
|
SendInput ((UINT) G_N_ELEMENTS (input), input, sizeof (INPUT));
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
mg_inputbox_icon_press (GtkEntry *entry, GtkEntryIconPosition icon_pos, GdkEvent *event, gpointer user_data)
|
||||||
|
{
|
||||||
|
(void) event;
|
||||||
|
(void) user_data;
|
||||||
|
|
||||||
|
if (icon_pos != GTK_ENTRY_ICON_SECONDARY)
|
||||||
|
return;
|
||||||
|
|
||||||
|
g_signal_stop_emission_by_name (entry, "icon-press");
|
||||||
|
mg_show_win32_emoji_panel (entry);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static void
|
static void
|
||||||
mg_switch_tab_cb (chanview *cv, chan *ch, int tag, gpointer ud)
|
mg_switch_tab_cb (chanview *cv, chan *ch, int tag, gpointer ud)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user