mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-16 17:09:28 +08:00
261 korean fonts (#273)
* fix: linting * chore: bump version * fix: unicode text for Windows
This commit is contained in:
parent
0819207e33
commit
85a64914aa
@ -1,4 +1,4 @@
|
||||
package cmd
|
||||
|
||||
// Version - Wails version
|
||||
const Version = "v0.18.9-pre"
|
||||
const Version = "v0.18.7-pre"
|
||||
|
@ -13,7 +13,7 @@ package webview
|
||||
#cgo linux openbsd freebsd CFLAGS: -DWEBVIEW_GTK=1 -Wno-deprecated-declarations
|
||||
#cgo linux openbsd freebsd pkg-config: gtk+-3.0 webkit2gtk-4.0
|
||||
|
||||
#cgo windows CFLAGS: -DWEBVIEW_WINAPI=1 -std=c99
|
||||
#cgo windows CFLAGS: -DWEBVIEW_WINAPI=1 -std=c99 -DUNICODE=1
|
||||
#cgo windows LDFLAGS: -lole32 -lcomctl32 -loleaut32 -luuid -lgdi32
|
||||
|
||||
#cgo darwin CFLAGS: -DWEBVIEW_COCOA=1 -x objective-c
|
||||
|
@ -1038,7 +1038,7 @@ struct webview_priv
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
static const TCHAR *classname = "WebView";
|
||||
static const TCHAR *classname = TEXT("WebView");
|
||||
static const SAFEARRAYBOUND ArrayBound = {1, 0};
|
||||
|
||||
static IOleClientSiteVtbl MyIOleClientSiteTable = {
|
||||
@ -1227,7 +1227,7 @@ struct webview_priv
|
||||
}
|
||||
VariantInit(&myURL);
|
||||
myURL.vt = VT_BSTR;
|
||||
#ifndef UNICODE
|
||||
// #ifndef UNICODE
|
||||
{
|
||||
wchar_t *buffer = webview_to_utf16(webPageName);
|
||||
if (buffer == NULL)
|
||||
@ -1237,9 +1237,9 @@ struct webview_priv
|
||||
myURL.bstrVal = SysAllocString(buffer);
|
||||
GlobalFree(buffer);
|
||||
}
|
||||
#else
|
||||
myURL.bstrVal = SysAllocString(webPageName);
|
||||
#endif
|
||||
// #else
|
||||
// myURL.bstrVal = SysAllocString(webPageName);
|
||||
// #endif
|
||||
if (!myURL.bstrVal)
|
||||
{
|
||||
badalloc:
|
||||
@ -1277,7 +1277,7 @@ struct webview_priv
|
||||
if (!SafeArrayAccessData(sfArray, (void **)&pVar))
|
||||
{
|
||||
pVar->vt = VT_BSTR;
|
||||
#ifndef UNICODE
|
||||
// #ifndef UNICODE
|
||||
{
|
||||
wchar_t *buffer = webview_to_utf16(url);
|
||||
if (buffer == NULL)
|
||||
@ -1287,9 +1287,9 @@ struct webview_priv
|
||||
bstr = SysAllocString(buffer);
|
||||
GlobalFree(buffer);
|
||||
}
|
||||
#else
|
||||
bstr = SysAllocString(string);
|
||||
#endif
|
||||
// #else
|
||||
// bstr = SysAllocString(url);
|
||||
// #endif
|
||||
if ((pVar->bstrVal = bstr))
|
||||
{
|
||||
htmlDoc2->lpVtbl->write(htmlDoc2, sfArray);
|
||||
@ -1404,6 +1404,7 @@ struct webview_priv
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
ZeroMemory(&wc, sizeof(WNDCLASSEX));
|
||||
wc.cbSize = sizeof(WNDCLASSEX);
|
||||
wc.hInstance = hInstance;
|
||||
@ -1431,10 +1432,24 @@ struct webview_priv
|
||||
rect.bottom = rect.bottom - rect.top + top;
|
||||
rect.top = top;
|
||||
|
||||
#ifdef UNICODE
|
||||
wchar_t *u16title = webview_to_utf16(w->title);
|
||||
if (u16title == NULL)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
w->priv.hwnd =
|
||||
CreateWindowEx(0, classname, u16title, style, rect.left, rect.top,
|
||||
rect.right - rect.left, rect.bottom - rect.top,
|
||||
HWND_DESKTOP, NULL, hInstance, (void *)w);
|
||||
#else
|
||||
w->priv.hwnd =
|
||||
CreateWindowEx(0, classname, w->title, style, rect.left, rect.top,
|
||||
rect.right - rect.left, rect.bottom - rect.top,
|
||||
HWND_DESKTOP, NULL, hInstance, (void *)w);
|
||||
#endif
|
||||
|
||||
if (w->priv.hwnd == 0)
|
||||
{
|
||||
OleUninitialize();
|
||||
@ -1445,7 +1460,14 @@ struct webview_priv
|
||||
|
||||
DisplayHTMLPage(w);
|
||||
|
||||
#ifdef UNICODE
|
||||
SetWindowText(w->priv.hwnd, u16title);
|
||||
GlobalFree(u16title);
|
||||
#else
|
||||
SetWindowText(w->priv.hwnd, w->title);
|
||||
#endif
|
||||
|
||||
|
||||
ShowWindow(w->priv.hwnd, SW_SHOWDEFAULT);
|
||||
UpdateWindow(w->priv.hwnd);
|
||||
SetFocus(w->priv.hwnd);
|
||||
|
Loading…
Reference in New Issue
Block a user