mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-19 04:00:19 +00:00
Compare commits
2 Commits
os-emoji-m
...
windows-fo
| Author | SHA1 | Date | |
|---|---|---|---|
| 4112ca8b39 | |||
| 4f1edef667 |
@@ -4053,7 +4053,7 @@ mg_show_win32_emoji_panel (GtkEntry *entry)
|
|||||||
GdkRectangle icon_rect;
|
GdkRectangle icon_rect;
|
||||||
GtkWidget *widget;
|
GtkWidget *widget;
|
||||||
GdkWindow *window;
|
GdkWindow *window;
|
||||||
gint pointer_x, pointer_y;
|
gint origin_x, origin_y;
|
||||||
|
|
||||||
widget = GTK_WIDGET (entry);
|
widget = GTK_WIDGET (entry);
|
||||||
if (gtk_widget_get_realized (widget))
|
if (gtk_widget_get_realized (widget))
|
||||||
@@ -4062,12 +4062,9 @@ mg_show_win32_emoji_panel (GtkEntry *entry)
|
|||||||
if (window)
|
if (window)
|
||||||
{
|
{
|
||||||
gtk_entry_get_icon_area (entry, GTK_ENTRY_ICON_SECONDARY, &icon_rect);
|
gtk_entry_get_icon_area (entry, GTK_ENTRY_ICON_SECONDARY, &icon_rect);
|
||||||
gdk_window_get_root_coords (window,
|
gdk_window_get_origin (window, &origin_x, &origin_y);
|
||||||
icon_rect.x + (icon_rect.width / 2),
|
SetCursorPos (origin_x + icon_rect.x + (icon_rect.width / 2),
|
||||||
icon_rect.y,
|
origin_y + icon_rect.y + (icon_rect.height / 2));
|
||||||
&pointer_x,
|
|
||||||
&pointer_y);
|
|
||||||
SetCursorPos (pointer_x, pointer_y);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -46,6 +46,8 @@
|
|||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#include "../common/fe.h"
|
#include "../common/fe.h"
|
||||||
|
#include <windows.h>
|
||||||
|
#include <commdlg.h>
|
||||||
#endif
|
#endif
|
||||||
#include "sexy-spell-entry.h"
|
#include "sexy-spell-entry.h"
|
||||||
|
|
||||||
@@ -1236,6 +1238,34 @@ setup_browsefolder_cb (GtkWidget *button, GtkEntry *entry)
|
|||||||
static void
|
static void
|
||||||
setup_browsefont_cb (GtkWidget *button, GtkWidget *entry)
|
setup_browsefont_cb (GtkWidget *button, GtkWidget *entry)
|
||||||
{
|
{
|
||||||
|
#ifdef WIN32
|
||||||
|
CHOOSEFONTW choose_font;
|
||||||
|
LOGFONTW log_font;
|
||||||
|
gunichar2 utf16_name[LF_FACESIZE];
|
||||||
|
gchar *font_name;
|
||||||
|
gchar font_spec[FONTNAMELEN + 1];
|
||||||
|
gint point_size;
|
||||||
|
|
||||||
|
memset (&choose_font, 0, sizeof (choose_font));
|
||||||
|
memset (&log_font, 0, sizeof (log_font));
|
||||||
|
|
||||||
|
choose_font.lStructSize = sizeof (choose_font);
|
||||||
|
choose_font.Flags = CF_SCREENFONTS | CF_FORCEFONTEXIST | CF_INITTOLOGFONTSTRUCT;
|
||||||
|
choose_font.lpLogFont = &log_font;
|
||||||
|
|
||||||
|
if (ChooseFontW (&choose_font))
|
||||||
|
{
|
||||||
|
memcpy (utf16_name, log_font.lfFaceName, sizeof (utf16_name));
|
||||||
|
font_name = g_utf16_to_utf8 (utf16_name, -1, NULL, NULL, NULL);
|
||||||
|
if (font_name && font_name[0])
|
||||||
|
{
|
||||||
|
point_size = choose_font.iPointSize > 0 ? choose_font.iPointSize / 10 : 11;
|
||||||
|
g_snprintf (font_spec, sizeof (font_spec), "%s %d", font_name, point_size);
|
||||||
|
gtk_entry_set_text (GTK_ENTRY (entry), font_spec);
|
||||||
|
}
|
||||||
|
g_free (font_name);
|
||||||
|
}
|
||||||
|
#else
|
||||||
GtkWidget *dialog;
|
GtkWidget *dialog;
|
||||||
const char *font_name;
|
const char *font_name;
|
||||||
|
|
||||||
@@ -1253,6 +1283,7 @@ setup_browsefont_cb (GtkWidget *button, GtkWidget *entry)
|
|||||||
G_CALLBACK (setup_fontchooser_response), entry);
|
G_CALLBACK (setup_fontchooser_response), entry);
|
||||||
|
|
||||||
gtk_widget_show (dialog);
|
gtk_widget_show (dialog);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|||||||
Reference in New Issue
Block a user