diff options
| author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2025-07-26 01:20:22 +0300 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-26 01:20:22 +0300 | 
| commit | 5291fc252aba354e129ec85076348059cae01f3a (patch) | |
| tree | d058d1439b878d190a029cf4c94f7e4ea3d9291e | |
| parent | f80d62e6b202bb49a5b958183508854bae6d868f (diff) | |
#4374 update icon for title bar
| -rw-r--r-- | indra/llwindow/llwindowwin32.cpp | 20 | ||||
| -rw-r--r-- | indra/llwindow/llwindowwin32.h | 3 | ||||
| -rw-r--r-- | indra/newview/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | indra/newview/llappviewerwin32.cpp | 1 | ||||
| -rw-r--r-- | indra/newview/res/ll_icon_small.ico | bin | 0 -> 91010 bytes | |||
| -rw-r--r-- | indra/newview/res/resource.h | 1 | ||||
| -rwxr-xr-x | indra/newview/res/viewerRes.rc | 1 | 
7 files changed, 27 insertions, 0 deletions
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 76d72fe725..68b6de197a 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -113,6 +113,7 @@ static std::thread::id sMainThreadId;  LPWSTR gIconResource = IDI_APPLICATION; +LPWSTR gIconSmallResource = IDI_APPLICATION;  LPDIRECTINPUT8 gDirectInput8;  LLW32MsgCallback gAsyncMsgCallback = NULL; @@ -527,6 +528,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,      mFSAASamples = fsaa_samples;      mIconResource = gIconResource; +    mIconSmallResource = gIconSmallResource;      mOverrideAspectRatio = 0.f;      mNativeAspectRatio = 0.f;      mInputProcessingPaused = false; @@ -860,6 +862,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,      // based on the system's (or user's) default settings.      allowLanguageTextInput(NULL, false);      updateWindowTheme(); +    setCustomIcon();  } @@ -5043,3 +5046,20 @@ void LLWindowWin32::updateWindowTheme()      LL_INFOS("Window") << "Viewer window theme is set to " << (use_dark_mode ? "dark" : "light") << " mode" << LL_ENDL;  } + +void LLWindowWin32::setCustomIcon() +{ +        if (mWindowHandle) +        { +            HICON hDefaultIcon = LoadIcon(mhInstance, mIconResource); +            HICON hSmallIcon   = LoadIcon(mhInstance, mIconSmallResource); +            mWindowThread->post([=]() +                { +                    SendMessage(mWindowHandle, WM_SETICON, ICON_BIG, (LPARAM)hDefaultIcon); +                    SendMessage(mWindowHandle, WM_SETICON, ICON_SMALL, (LPARAM)hSmallIcon); + +                    SetClassLongPtr(mWindowHandle, GCLP_HICON, (LONG_PTR)hDefaultIcon); +                    SetClassLongPtr(mWindowHandle, GCLP_HICONSM, (LONG_PTR)hSmallIcon); +                }); +        } +} diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h index fdaa024363..7196706f87 100644 --- a/indra/llwindow/llwindowwin32.h +++ b/indra/llwindow/llwindowwin32.h @@ -214,6 +214,7 @@ protected:      bool        mCustomGammaSet;      LPWSTR      mIconResource; +    LPWSTR      mIconSmallResource;      bool        mInputProcessingPaused;      // The following variables are for Language Text Input control. @@ -248,6 +249,7 @@ protected:      void updateWindowTheme();      bool isSystemAppDarkMode(); +    void setCustomIcon();      bool mCurrentDarkMode { false };      struct LLWindowWin32Thread; @@ -285,6 +287,7 @@ private:  extern LLW32MsgCallback gAsyncMsgCallback;  extern LPWSTR gIconResource; +extern LPWSTR gIconSmallResource;  S32 OSMessageBoxWin32(const std::string& text, const std::string& caption, U32 type); diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 98151e2f4d..1672efcf33 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -1566,6 +1566,7 @@ if (WINDOWS)          res-sdl/ll_icon.BMP          res/ll_icon.BMP          res/ll_icon.ico +        res/ll_icon_small.ico          res/resource.h          res/toolpickobject.cur          res/toolpickobject2.cur diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp index 6274933586..8477bd3044 100644 --- a/indra/newview/llappviewerwin32.cpp +++ b/indra/newview/llappviewerwin32.cpp @@ -448,6 +448,7 @@ int APIENTRY WINMAIN(HINSTANCE hInstance,      // *FIX: global      gIconResource = MAKEINTRESOURCE(IDI_LL_ICON); +    gIconSmallResource = MAKEINTRESOURCE(IDI_LL_ICON_SMALL);      LLAppViewerWin32* viewer_app_ptr = new LLAppViewerWin32(ll_convert_wide_to_string(pCmdLine).c_str()); diff --git a/indra/newview/res/ll_icon_small.ico b/indra/newview/res/ll_icon_small.ico Binary files differnew file mode 100644 index 0000000000..a3f6877935 --- /dev/null +++ b/indra/newview/res/ll_icon_small.ico diff --git a/indra/newview/res/resource.h b/indra/newview/res/resource.h index e904f4a1a8..1d3289d784 100644 --- a/indra/newview/res/resource.h +++ b/indra/newview/res/resource.h @@ -30,6 +30,7 @@  #define IDREMOVE                        3  #define IDI_LL_ICON                     103  #define IDC_GRABHAND                    104 +#define IDI_LL_ICON_SMALL               105  #define IDC_CURSOR1                     134  #define IDC_CURSOR2                     136  #define IDC_CURSOR3                     147 diff --git a/indra/newview/res/viewerRes.rc b/indra/newview/res/viewerRes.rc index 4ee26a312a..dc2ba5f171 100755 --- a/indra/newview/res/viewerRes.rc +++ b/indra/newview/res/viewerRes.rc @@ -56,6 +56,7 @@ END  // remains consistent on all systems.  IDI_LL_ICON             ICON                    "ll_icon.ico"  IDI_LCD_LL_ICON         ICON                    "icon1.ico" +IDI_LL_ICON_SMALL       ICON                    "ll_icon_small.ico"  /////////////////////////////////////////////////////////////////////////////  //  | 
