diff options
author | George Hazan <george.hazan@gmail.com> | 2015-05-11 17:13:29 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-05-11 17:13:29 +0000 |
commit | 9418930c2d211feca1ddeaafa160c3d8ca9a581a (patch) | |
tree | 827695e66cc8403f295c56f68fd39c07b38f9543 /plugins/Dropbox/src/dropbox_icons.cpp | |
parent | e8ab90ab839ce55a399280f1920e1afd0fb28424 (diff) |
- protocol icon is used in all menus & buttons;
- code formatting
git-svn-id: http://svn.miranda-ng.org/main/trunk@13551 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src/dropbox_icons.cpp')
-rw-r--r-- | plugins/Dropbox/src/dropbox_icons.cpp | 49 |
1 files changed, 19 insertions, 30 deletions
diff --git a/plugins/Dropbox/src/dropbox_icons.cpp b/plugins/Dropbox/src/dropbox_icons.cpp index 97bb2e4884..881c41e7db 100644 --- a/plugins/Dropbox/src/dropbox_icons.cpp +++ b/plugins/Dropbox/src/dropbox_icons.cpp @@ -1,40 +1,29 @@ #include "stdafx.h"
-void CDropbox::InitializeIcons()
+static IconItem iconList[] =
{
- wchar_t filePath[MAX_PATH];
- GetModuleFileName(g_hInstance, filePath, MAX_PATH);
+ { LPGEN("Protocol icon"), "main", IDI_DROPBOX }
+};
- wchar_t sectionName[100];
- mir_sntprintf(
- sectionName,
- SIZEOF(sectionName),
- _T("%s/%s"),
- LPGENT("Protocols"),
- LPGENT(MODULE));
+void InitializeIcons()
+{
+ Icon_Register(g_hInstance, "Protocols/" MODULE, iconList, SIZEOF(iconList), MODULE);
+}
- char settingName[100];
- mir_snprintf(
- settingName,
- SIZEOF(settingName),
- "%s_%s",
- MODULE,
- "main");
+HANDLE GetIconHandle(int iconId)
+{
+ for (unsigned i = 0; i < SIZEOF(iconList); i++)
+ if (iconList[i].defIconID == iconId)
+ return iconList[i].hIcolib;
- SKINICONDESC sid = { 0 };
- sid.cbSize = sizeof(SKINICONDESC);
- sid.flags = SIDF_ALL_TCHAR;
- sid.ptszDefaultFile = filePath;
- sid.pszName = settingName;
- sid.ptszSection = sectionName;
- sid.ptszDescription = LPGENT("Protocol icon");
- sid.iDefaultIndex = -IDI_DROPBOX;
- /*HANDLE hIcon = */Skin_AddIcon(&sid);
+ return NULL;
}
-HICON CDropbox::LoadIconEx(const char *name, bool big)
+HICON LoadIconEx(int iconId, bool big)
{
- char szSettingName[100];
- mir_snprintf(szSettingName, SIZEOF(szSettingName), "%s_%s", MODULE, name);
- return Skin_GetIcon(szSettingName, big);
+ for (int i = 0; i < SIZEOF(iconList); i++)
+ if (iconList[i].defIconID == iconId)
+ return Skin_GetIconByHandle(iconList[i].hIcolib, big);
+
+ return NULL;
}
|