*/}}
Browse Source

Windows adaptation wip

YimingWu 1 year ago
parent
commit
e562f71113
7 changed files with 137 additions and 57 deletions
  1. 3 3
      la_data.c
  2. 18 39
      la_kernel.c
  3. 42 0
      la_util.c
  4. 15 0
      la_util.h
  5. 56 12
      resources/la_operators.c
  6. 2 2
      resources/la_templates.c
  7. 1 1
      resources/la_widgets.c

+ 3 - 3
la_data.c

@@ -2108,7 +2108,7 @@ int laValidateProperties(){
 
 void la_GetWorkingDirectoryInternal(){
     char mbuf[2048]; getcwd(mbuf,2048);
-    int len=strlen(mbuf);if(mbuf[len]!='/'){ mbuf[len]='/'; mbuf[len+1]=0; }
+    int len=strlen(mbuf);if(mbuf[len]!=LA_PATH_SEP){ mbuf[len]=LA_PATH_SEP; mbuf[len+1]=0; }
     strSafeSet(&MAIN.WorkingDirectory, mbuf);
 }
 
@@ -3488,7 +3488,7 @@ laManagedUDF* la_FindManagedUDF(char* FileName){
 laManagedUDF* la_EnsureManagedUDF(char* FileName, int PutAtTop){
     laManagedUDF* m;
     if(!(m=la_FindManagedUDF(FileName))){
-        m=memAcquire(sizeof(laManagedUDF)); strSafeSet(&m->BaseName, strGetLastSegment(FileName,'/'));
+        m=memAcquire(sizeof(laManagedUDF)); strSafeSet(&m->BaseName, strGetLastSegment(FileName,LA_PATH_SEP));
         if(PutAtTop) lstPushItem(&MAIN.ManagedUDFs, m); else lstAppendItem(&MAIN.ManagedUDFs, m);
     }
     return m;
@@ -3743,7 +3743,7 @@ void laRefreshUDFResourcesIn(char* rootpath){
 #ifdef __linux__
     char Final[2048];
     int len=strlen(rootpath);
-    if (rootpath[len - 1] != '/') strcat(rootpath, "/");
+    if (rootpath[len - 1] != LA_PATH_SEP) strcat(rootpath, LA_PATH_SEPSTR);
 
     struct dirent **NameList=0;
     int NumFiles=scandir(rootpath,&NameList,0,alphasort);

+ 18 - 39
la_kernel.c

@@ -277,7 +277,7 @@ void la_SetupPxlFormat(HDC hdc, int* nRegularFormat, int* nMSFormat) {
     }
     SetPixelFormat(hdc, *nRegularFormat, &cpfd);
 };
-void la_SetupGLEnviornment(laWindow* window, HWND hwnd) {
+void la_SetupGLEnviornment(laWindow* window, HWND hwnd, int Sync) {
     GLint Attrib[] = { WGL_CONTEXT_MAJOR_VERSION_ARB, MAIN.GLMajor,
                   WGL_CONTEXT_MINOR_VERSION_ARB, MAIN.GLMinor,
         WGL_CONTEXT_PROFILE_MASK_ARB,WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB,
@@ -298,6 +298,9 @@ void la_SetupGLEnviornment(laWindow* window, HWND hwnd) {
     //wglShareLists(hglrc, MAIN.glc);
     wglMakeCurrent(hdc, hglrc);
 
+    //int sync = Sync ? 1 : 0; wglSwapIntervalEXT(sync);
+    wglSwapIntervalEXT(-1);
+
     window->win = hwnd; window->glc = hglrc; window->hdc = hdc;
 };
 SYSWINDOW la_CreateWindowWin32(int x, int y, int w, int h, char* title, int SyncToVBlank, SYSGLCONTEXT* r_glc) {
@@ -325,7 +328,7 @@ int la_CreateSystemWindow(laWindow *window, int SyncToVBlank){
     window->win = hwnd;
 
 #ifdef _WIN32
-    la_SetupGLEnviornment(window, hwnd);
+    la_SetupGLEnviornment(window, hwnd, SyncToVBlank);
     RECT rc; GetClientRect(window->win, &rc);
     window->CW = rc.right - rc.left;
     window->CH = rc.bottom - rc.top;
@@ -344,6 +347,9 @@ int la_DestroySystemWindow(laWindow* wnd){
 #ifdef __linux__
     la_DestroySystemWindowX11(wnd);
 #endif
+#ifdef _WIN32
+    la_DestroySystemWindowWin32(wnd);
+#endif
 }
 
 void la_DestroyWindow(laWindow *wnd){
@@ -621,6 +627,8 @@ int laGetReadyWith(int GLMajor, int GLMinor, int BufferSamples){
 
     MAIN.GLMajor = GLMajor; MAIN.GLMinor = GLMinor; MAIN.BufferSamples = BufferSamples;
 
+    SetProcessDPIAware();
+
     GLenum err;
     PIXELFORMATDESCRIPTOR pfd;
     HINSTANCE* hinst = &MAIN.hinstance;
@@ -644,28 +652,6 @@ int laGetReadyWith(int GLMajor, int GLMinor, int BufferSamples){
         return 0;
     }
 
-    wglMakeCurrent(0, 0);
-    wglDeleteContext(MAIN.glc);
-    ReleaseDC(hwnd, hdc);
-    DestroyWindow(hwnd);
-
-    int a, b;
-    hwnd = CreateWindowEx(WS_EX_ACCEPTFILES, LA_GUI_WNDCLASS_NAME,
-        "Temp Window For Accessing GLEW!",
-        WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, 0, 0, 100, 100,
-        0, 0, *hinst, 0);
-    hdc = GetDC(hwnd);
-    la_SetupPxlFormat(hdc, &a, &b);
-    GLint Attrib[] = { WGL_CONTEXT_MAJOR_VERSION_ARB, MAIN.GLMajor,
-        WGL_CONTEXT_MINOR_VERSION_ARB, MAIN.GLMinor,
-        WGL_CONTEXT_PROFILE_MASK_ARB, WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB, 0};
-    hglrc = wglCreateContextAttribsARB(hdc, 0, Attrib);
-
-    if (!hglrc) SEND_PANIC_ERROR("Can't Create Opengl Context!\n", );
-    MAIN.glc = hglrc;
-    MAIN.hdc = hdc;
-    wglMakeCurrent(hdc, hglrc);
-
 #endif
 
     la_GetWorkingDirectoryInternal();
@@ -6536,9 +6522,7 @@ LRESULT CALLBACK LA_WindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
     case WM_MOUSEWHEEL:
         if ((wheelmark = HIWORD(wparam)) > 0) WheelDir = LA_MOUSEUP;
         else if ((wheelmark = HIWORD(wparam)) < 0) WheelDir = LA_MOUSEDOWN;
-
         la_SendMouseEvent(hwnd, WheelDir|LA_KEY_MOUSE_SCROLL, PARAM_2_FROM(lparam));
-
         break;
 
     case WM_SYSCOMMAND:
@@ -6573,15 +6557,15 @@ LRESULT CALLBACK LA_WindowProc(HWND hwnd, UINT message, WPARAM wparam, LPARAM lp
 
     case WM_CHAR:
         buf[0] = wparam;
-        la_SendInputEvent(hwnd, buf);
+        //la_SendInputEvent(hwnd, buf);
         break;
 
     case WM_SHOWWINDOW:
         //SendCommandEvent(hwnd, EVT_WND_SIZE_FINISH);
         break;
 
-    case WM_DESTROY:
-        la_OnWindowDestroy(hwnd);
+    case WM_CLOSE:
+        if (!la_OnWindowDestroy(hwnd)) return 0; return 1;
         break;
     default:
         return DefWindowProc(hwnd, message, wparam, lparam);
@@ -6875,14 +6859,11 @@ int la_ProcessSysMessage(){
     return 1;
 #endif //linux
 #ifdef _WIN32
-    MSG msg;
-    int Processed = 0;
-    if (PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE) != 0)
-        Processed = 1;
+    MSG msg; int Processed = 0;
+    if (PeekMessage(&msg, 0, 0, 0, PM_NOREMOVE) != 0) Processed = 1;
 
     while (PeekMessage(&msg, 0, 0, 0, PM_REMOVE)) {
-        TranslateMessage(&msg);
-        DispatchMessage(&msg);
+        TranslateMessage(&msg); DispatchMessage(&msg);
     };
 #endif
 };
@@ -6965,10 +6946,8 @@ void laMainLoop(){
         Pause = (1.0 / MAIN.TopFramerate - TimeInterval);
 
         if (Pause > 0){
-#ifdef __linux__
-            int ms = Pause * 1000000.0;
-            usleep(ms);
-#endif
+            int us = Pause * 1000000.0;
+            usleep(us);
         }
 
         MAIN.TimeAccum += (MAIN.LastFrameTime = Pause+TimeInterval);

+ 42 - 0
la_util.c

@@ -65,9 +65,18 @@ void laRecordTime(laTimeRecorder *tr){
 #ifdef __linux__
     clock_gettime(CLOCK_REALTIME, &tr->ts);
 #endif
+#ifdef _WIN32
+    QueryPerformanceCounter(&tr->tm);
+#endif
 }
 real laTimeElapsedSecondsf(laTimeRecorder *End, laTimeRecorder *Begin){
+#ifdef __linux__
     real sec=End->ts.tv_sec-Begin->ts.tv_sec; sec+=((End->ts.tv_nsec-Begin->ts.tv_nsec)/1e9);
+#endif
+#ifdef _WIN32
+    LARGE_INTEGER perfCnt; QueryPerformanceFrequency(&perfCnt);
+    real sec = ((real)(End->tm.QuadPart - Begin->tm.QuadPart))/ perfCnt.QuadPart;
+#endif
     return sec;
 }
 
@@ -2150,3 +2159,36 @@ void laOpenInternetLink(char *url){
     //
     //return;
 }
+
+#ifdef _WIN32
+void usleep(unsigned int usec){
+    HANDLE timer;
+    LARGE_INTEGER ft;
+
+    static int init = 0;
+
+    if (init == 0){
+        init = 1;
+        const HINSTANCE ntdll = LoadLibrary("ntdll.dll");
+        if (ntdll != NULL){
+            typedef long(NTAPI* pNtQueryTimerResolution)(unsigned long* MinimumResolution, unsigned long* MaximumResolution, unsigned long* CurrentResolution);
+            typedef long(NTAPI* pNtSetTimerResolution)(unsigned long RequestedResolution, char SetResolution, unsigned long* ActualResolution);
+            pNtQueryTimerResolution NtQueryTimerResolution = (pNtQueryTimerResolution)GetProcAddress(ntdll, "NtQueryTimerResolution");
+            pNtSetTimerResolution   NtSetTimerResolution = (pNtSetTimerResolution)GetProcAddress(ntdll, "NtSetTimerResolution");
+            if (NtQueryTimerResolution != NULL && NtSetTimerResolution != NULL){
+                unsigned long minimum, maximum, current;
+                NtQueryTimerResolution(&minimum, &maximum, &current);
+                NtSetTimerResolution(maximum, (char)1, &current);
+            }
+            FreeLibrary(ntdll);
+        }
+    }
+
+    ft.QuadPart = -(10 * (__int64)usec);
+
+    timer = CreateWaitableTimer(NULL, TRUE, NULL);
+    SetWaitableTimer(timer, &ft, 0, NULL, NULL, 0);
+    WaitForSingleObject(timer, INFINITE);
+    CloseHandle(timer);
+}
+#endif

+ 15 - 0
la_util.h

@@ -63,6 +63,14 @@ struct _##a
 #define lengthof(a) \
 (sizeof(a)/sizeof(a[0]))
 
+#ifdef _WIN32
+#define LA_PATH_SEP '\\'
+#define LA_PATH_SEPSTR "\\"
+#else
+#define LA_PATH_SEP '/'
+#define LA_PATH_SEPSTR "/"
+#endif
+
 #define DBL_TRIANGLE_LIM 1e-11
 #define DBL_EDGE_LIM 1e-9
 
@@ -357,7 +365,12 @@ STRUCTURE(laAVLTreeReal64) {
 };
 
 STRUCTURE(laTimeRecorder) {
+#ifdef __linux__
 	struct timespec ts;
+#endif
+#ifdef _WIN32
+	LARGE_INTEGER tm;
+#endif
 };
 
 STRUCTURE(laTranslationNode) {
@@ -675,3 +688,5 @@ void laOpenInternetLink(char* url);
 
 #define SEND_PANIC_ERROR(msg) \
 	{printf(msg); exit(0);}
+
+void usleep(unsigned int usec);

+ 56 - 12
resources/la_operators.c

@@ -194,9 +194,8 @@ void la_FileBrowserRebuildList(laFileBrowser *fb){
     long long TotalSpace = 0;
     real Ratio = 0;
 
-    if (fb->Path[len - 1] != L'/') strcat(fb->Path, "/");
-
 #ifdef __linux__
+    if (fb->Path[len - 1] != L'/') strcat(fb->Path, "/");
     struct dirent **NameList=0;
     int NumFiles=scandir(fb->Path,&NameList,0,alphasort);
 
@@ -237,19 +236,62 @@ void la_FileBrowserRebuildList(laFileBrowser *fb){
     }
     for (int i = 0; i < NumFiles; i++) { free(NameList[i]); } free(NameList);
 #endif
+#ifdef _WIN32
+    WIN32_FIND_DATA FindFileData;
+    HANDLE hFind;
+    SYSTEMTIME stUTC, stLocal;
+    strCopyFull(Lookup, fb->Path);
+    if (Lookup[len - 1] != L'\\') strcat(Lookup, "\\*.*"); else strcat(Lookup, "*.*");
+    hFind = FindFirstFile(Lookup, &FindFileData);
+
+    while (fi = lstPopItem(&fb->FileList)) memFree(fi);
+
+    if (hFind == INVALID_HANDLE_VALUE){ return; }
+
+    while (1) {
+        if (FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
+            if (FindFileData.cFileName[0] != '.') {
+                fi = memAcquireSimple(sizeof(laFileItem));
+                strcpy(fi->Name, FindFileData.cFileName);
+                fi->IsFolder = 1;
+                fi->Type = LA_FILETYPE_FOLDER;
+                lstAppendItem(&fb->FileList, fi);
+            }
+        }elif(!fb->SelectFolder) {
+            fi = memAcquireSimple(sizeof(laFileItem));
+            strCopyFull(fi->Name, FindFileData.cFileName);
+            fi->Size = FindFileData.nFileSizeLow;
+            fi->Type = la_DetectFileItemType(fi);
+
+            FileTimeToSystemTime(&(FindFileData.ftLastWriteTime), &stUTC);
+            SystemTimeToTzSpecificLocalTime(NULL, &stUTC, &stLocal);
+
+            fi->TimeModified.Year = stLocal.wYear;
+            fi->TimeModified.Month = stLocal.wMonth;
+            fi->TimeModified.Day = stLocal.wDay;
+            fi->TimeModified.Hour = stLocal.wHour;
+            fi->TimeModified.Minute = stLocal.wMinute;
+            fi->TimeModified.Second = stLocal.wSecond;
+
+            lstAppendItem(&Files, fi);
+            //lstAppendItem(&fb->FileList, fi);
+        }
+        if (!FindNextFile(hFind, &FindFileData))
+            break;
+    }
+#endif
 
     lstCombineLists(&fb->FileList, &Files);
 
     while (dl = lstPopItem(&fb->Disks)) memFree(dl);
 
-    NumDisks = GetLogicalDriveStrings(256, DiskLabels) / 4;
-
 #ifdef _WIN32
+    NumDisks = GetLogicalDriveStrings(256, DiskLabels) / 4;
     while (*pd){
         char Name[3] = "*:";
         Name[0] = *pd;
         if (GetDiskFreeSpaceEx(Name, &FreeAvailable, &TotalSpace, &FreeSpace_UNUSED)){
-            dl = memAcquireSimple(sizeof(laDiskItem));
+            dl = memAcquire(sizeof(laDiskItem));
             dl->ID = *pd;
             dl->Total_GB = (real)TotalSpace / 1073741824.0f;   //B->GB
             dl->Free_GB = (real)FreeAvailable / 1073741824.0f; //B->GB
@@ -278,6 +320,7 @@ laFileBrowser *la_FileBrowserInit(laOperator *a){
     if ((arg=strGetArgumentString(a->ExtraInstructionsP, "filter_type"))){ sscanf(arg,"%d",&fb->FilterType); }
     if ((arg=strGetArgumentString(a->ExtraInstructionsP, "use_type"))){ sscanf(arg,"%d",&fb->UseType); }
 
+#ifdef __linux__
     char BookmarkPath[1024];
     strcat(strcpy(BookmarkPath, getenv("HOME")), "/.config/gtk-3.0/bookmarks");
     FILE* f=fopen(BookmarkPath, "r");
@@ -289,6 +332,7 @@ laFileBrowser *la_FileBrowserInit(laOperator *a){
         }
         fclose(f);
     }
+#endif
 
     la_FileBrowserRebuildList(fb);
     fb->FileName[0] = 0;
@@ -300,7 +344,7 @@ void laset_FileBrowserSelectFile(laFileBrowser *fb, laFileItem *fi, int State){
     if (fb->Active == fi){
         if (fi->IsFolder){
             len = strlen(fb->Path);
-            if (fb->Path[len - 1] != L'/') strcat(fb->Path, "/");
+            if (fb->Path[len - 1] != LA_PATH_SEP) strcat(fb->Path, LA_PATH_SEPSTR);
             strcat(fb->Path, fi->Name);
             la_FileBrowserRebuildList(fb);
             fb->FileName[0] = 0;
@@ -317,7 +361,7 @@ void la_FileBrowserGetFullPath(laFileBrowser *fb,char* buf){
     buf[0]=0; int plen;
     if (!fb->SelectFolder && fb->FileName[0] == L'\0') return;
     plen = strlen(fb->Path);
-    if (fb->Path[plen - 1] != L'/') strcat(fb->Path, "/");
+    if (fb->Path[plen - 1] != LA_PATH_SEP) strcat(fb->Path, LA_PATH_SEPSTR);
     strCopyFull(buf, fb->Path);
     strcat(buf, fb->FileName);
 }
@@ -336,7 +380,7 @@ void *laget_FileBrowserActiveFile(laFileBrowser *fb){
 void laget_FileBrowserDiskID(laDiskItem *di, char *result){
     result[0] = di->ID;
     result[1] = L':';
-    result[2] = L'/';
+    result[2] = LA_PATH_SEP;
     result[3] = L'\0';
 }
 void *laset_FileBrowserActiveDisk(laFileBrowser *fb, laDiskItem *di, int UNUSED_State){
@@ -388,7 +432,7 @@ void la_FileBrowserUpLevel(laFileBrowser *fb){
     char *LastP = 0;
     int Count = 0;
     for (p; *p; p++){
-        if (*p && *p == L'/' && p[1]!=0){
+        if (*p && *p == LA_PATH_SEP && p[1]!=0){
             LastP = p;
             Count++;
         }
@@ -605,7 +649,7 @@ int OPMOD_ManagedSaveNewFile(laOperator *a, laEvent *e){
                     return LA_FINISHED;
                 }
                 laManagedUDF* m=MAIN.DummyManageUDF;
-                m->udf = laPrepareUDF(path); strSafeSet(&m->BaseName, strGetLastSegment(path,'/'));
+                m->udf = laPrepareUDF(path); strSafeSet(&m->BaseName, strGetLastSegment(path,LA_PATH_SEP));
                 m->udf->Managed=1;
                 la_MakeDummyManagedUDF();
                 laNotifyUsers("la.managed_udfs"); laNotifyUsers("la.managed_props");
@@ -2120,7 +2164,7 @@ void la_RegisterBuiltinOperators(){
     laAddStringProperty(pc, "path", "Path", "Directort Path", 0, 0, 0, "/", 0, offsetof(laFileBrowser, Path), 0, 0, laset_FileBrowserPath, 0, LA_UDF_LOCAL);
     laAddStringProperty(pc, "file_name", "File Name", "File Name", 0, 0, 0, 0, 0, offsetof(laFileBrowser, FileName), 0, 0, laset_FileBrowserFileName, 0, LA_UDF_LOCAL);
     laAddSubGroup(pc, "file_list", "File List", "List Of Files And Directories Under A Specific Path", "file_item",0,0,laui_FileBrowserFileItem, -1, 0, laget_FileBrowserActiveFile, 0, 0, 0, laset_FileBrowserSelectFile, offsetof(laFileBrowser, FileList), 0);
-    laAddSubGroup(pc, "disk_list", "Disk List", "List Of All Logical Drives (In Windows)", "disk_item",0, 0, 0, offsetof(laFileBrowser, RootDisk), 0, 0, 0, 0, 0, laset_FileBrowserActiveDisk, offsetof(laFileBrowser, Disks), 0);
+    laAddSubGroup(pc, "disk_list", "Disk List", "List Of All Logical Drives (In Windows)", "disk_item",0, 0, 0, -1, 0, 0, 0, 0, 0, laset_FileBrowserActiveDisk, offsetof(laFileBrowser, Disks), 0);
     laAddSubGroup(pc, "bookmarks", "Bookmarks", "Bookmarked directories in GTK3", "bookmarked_folder",0, 0, 0, -1, 0, 0, 0, laset_FileBrowserBookmark, 0, 0, offsetof(laFileBrowser, Bookmarks), 0);
     laAddSubGroup(pc, "available_extensions", "Available Extensions", "List of all available extensions", "la_extension_type",0, 0, 0, 0, laget_FileBrowserAcceptedExtensionsFrist, 0, laget_FileBrowserAcceptedExtensionsNext,laset_FileBrowserExtension,0,0,0,0);
     laAddIntProperty(pc,"use_type","Use Type","Use file type",0,0,0,0,0,0,0,0,offsetof(laFileBrowser,UseType),0,0,0,0,0,0,0,0,0,0,LA_READ_ONLY);
@@ -2130,7 +2174,7 @@ void la_RegisterBuiltinOperators(){
     }
     laAddOperatorProperty(pc, "folder_up", "Up", "Select Upper Folder Level In File Browsers", "LA_file_dialog_up", L'🢰', 0);
     laAddOperatorProperty(pc, "confirm", "Confirm", "Confirm selection", "LA_file_dialog_confirm", L'✔', 0);
-    p = laAddPropertyContainer("disk_item", "Disk Item", "A Logical Drive (In Windows)", 0, laui_FileBrowserDiskItem, 0, 0, 0, 0);{
+    p = laAddPropertyContainer("disk_item", "Disk Item", "A Logical Drive (In Windows)", 0, laui_FileBrowserDiskItem, 0, 0, 0, 1);{
         laAddStringProperty(p, "id", "ID", "Disk Identifier", 0, 0, 0, 0, 0, 0, 0, laget_FileBrowserDiskID, 0, 0, 0);
         laAddFloatProperty(p, "total_gb", "Total", "Disk Total Compacity In Gigabytes", 0, 0, "GB", 0, 0, 0, 0, 0, offsetof(laDiskItem, Total_GB), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,LA_READ_ONLY);
         laAddFloatProperty(p, "free_gb", "Free", "Disk Free Space Size In Gigabytes", 0, 0, "GB", 0, 0, 0, 0, 0, offsetof(laDiskItem, Free_GB), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,LA_READ_ONLY);

+ 2 - 2
resources/la_templates.c

@@ -948,8 +948,8 @@ void laui_FileBrowserDiskItem(laUiList *uil, laPropPack *This, laPropPack *OP_UN
     //laShowColumnAdjuster(uil, c);
 
     laShowItemFull(uil, cl, This, "id", LA_WIDGET_STRING_PLAIN, 0, 0, 0);
-    laShowItem(uil, crl, This, "total_gb");
-    laShowItem(uil, crr, This, "free_gb");
+    laShowItem(uil, crl, This, "total_gb")->Flags |= LA_UI_FLAGS_NO_DECAL;
+    laShowItem(uil, crr, This, "free_gb")->Flags |= LA_UI_FLAGS_NO_DECAL;
 }
 void laui_FileBrowserFileList(laUiList *uil, laPropPack *THIS_UNUSED, laPropPack *Operator, laColumn *UNUSED, int context){
     laColumn *col = laFirstColumn(uil), *c, *cl, *cr, *crl, *crr, *cll, *clr, *clrl, *clrr, *clrrl, *clrrr, *ulc;

+ 1 - 1
resources/la_widgets.c

@@ -831,7 +831,7 @@ void la_EnumSelectorDraw(laUiItem *ui, int h){
                 tnsDrawStringAuto(buf, laThemeColor(bt, LA_BT_TEXT|ExtraState), _L+bt->LM+(HasIcon?LA_RH:0), _R-bt->RM, _U, UseFlags);
             }
             if (!IsExpand && !IsVertical && !IconOnly && !IsCycle && !NoEvent){
-                tnsDrawIcon(L'🔻', laThemeColor(bt, LA_BT_TEXT|ExtraState), _R-LA_RH, _R, _U, ui->Flags);
+                tnsDrawIcon(U'🔻', laThemeColor(bt, LA_BT_TEXT|ExtraState), _R-LA_RH, _R, _U, ui->Flags);
             }
         }
     }