Skip to content

Commit

Permalink
Toolbar icons fix on the Upload page
Browse files Browse the repository at this point in the history
  • Loading branch information
zenden2k committed Jun 4, 2024
1 parent c9a7d60 commit df2691b
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 13 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ Dist/serverchecker
.vscode/
.idea/
/Dist/Packages/
/Dist/Releases/
/Dist/Build_Release_Temp/
/Dist/Libs/
6 changes: 5 additions & 1 deletion Source/Gui/Controls/ImageView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ CImageViewWindow::~CImageViewWindow()
LRESULT CImageViewWindow::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
RECT rc = {380, 37, 636, 240};
Img.Create(m_hWnd, rc);
Img.Create(m_hWnd, rc, 0, WS_CHILD | WS_VISIBLE);
Img.HideParent = true;
SetFocus();
return 0; // Let the system set the focus
}

LRESULT CImageViewWindow::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) {
return 0;
}

LRESULT CImageViewWindow::OnClickedOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled)
{
return ShowWindow(SW_HIDE);
Expand Down
2 changes: 2 additions & 0 deletions Source/Gui/Controls/ImageView.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ class CImageViewWindow :

BEGIN_MSG_MAP(CImageView)
MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
MESSAGE_HANDLER(WM_TIMER, OnTimer)
MSG_WM_KILLFOCUS(OnKillFocus)
MSG_WM_ACTIVATE(OnActivate)
Expand All @@ -62,6 +63,7 @@ class CImageViewWindow :
// LRESULT CommandHandler(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
// LRESULT NotifyHandler(int idCtrl, LPNMHDR pnmh, BOOL& bHandled);
LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
LRESULT OnClickedOK(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& bHandled);
LRESULT OnTimer(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
CMyImage Img;
Expand Down
3 changes: 3 additions & 0 deletions Source/Gui/Controls/ThumbsView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -509,6 +509,9 @@ LRESULT CThumbsView::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bH
StopBackgroundThread(true);
// Call DeleteAllItems to avoid memory leaks in list view control
DeleteAllItems();
if (ImageView) {
ImageView.DestroyWindow();
}
return 0;
}

Expand Down
1 change: 0 additions & 1 deletion Source/Gui/Dialogs/MainDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ class CMainDlg : public CDialogImpl<CMainDlg>,public CThreadImpl<CMainDlg>,publi
int getSelectedFiles(std::vector<CString>& fileNames);
//CUploader Uploader;
CListViewCtrl lv;
CMyImage image;
CAtlArray<CFileListItem> FileList;
bool OnShow() override;
bool OnHide() override;
Expand Down
9 changes: 4 additions & 5 deletions Source/Gui/Dialogs/UploadDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,6 @@ void CUploadDlg::onShortenUrlChanged(bool shortenUrl) {

void CUploadDlg::createToolbar()
{

DWORD rtlStyle = ServiceLocator::instance()->translator()->isRTL() ? ILC_MIRROR | ILC_PERITEMMIRROR : 0;
const int iconWidth = GetSystemMetrics(SM_CXSMICON);
const int iconHeight = GetSystemMetrics(SM_CYSMICON);
Expand All @@ -404,12 +403,12 @@ void CUploadDlg::createToolbar()
return toolbarImageList_.AddIcon(icon);
};

if (GuiTools::Is32BPP()) {
//if (GuiTools::Is32BPP()) {
toolbarImageList_.Create(iconWidth, iconHeight, ILC_COLOR32 | rtlStyle, 0, 6);
}
else {
//}
/*else {
toolbarImageList_.Create(iconWidth, iconHeight, ILC_COLOR32 | ILC_MASK | rtlStyle, 0, 6);
}
}*/

RECT placeholderRect = GuiTools::GetDialogItemRect(m_hWnd, IDC_TOOLBARPLACEHOLDER);
RECT rc = { 0, 0, 100, 24 };
Expand Down
6 changes: 3 additions & 3 deletions Source/Gui/Dialogs/WelcomeDlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ LRESULT CWelcomeDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
{
alf.lfWeight = FW_BOLD;

NewFont=CreateFontIndirect(&alf);
NewFont.CreateFontIndirect(&alf);

SendDlgItemMessage(IDC_SELECTOPTION,WM_SETFONT,(WPARAM)(HFONT)NewFont,MAKELPARAM(false, 0));

alf.lfHeight = - MulDiv(13, dc.GetDeviceCaps(LOGPIXELSY), 72);
NewFont = CreateFontIndirect(&alf);
SendDlgItemMessage(IDC_TITLE,WM_SETFONT,(WPARAM)(HFONT)NewFont,MAKELPARAM(false, 0));
font2_.CreateFontIndirect(&alf);
SendDlgItemMessage(IDC_TITLE,WM_SETFONT,(WPARAM)(HFONT)font2_,MAKELPARAM(false, 0));
}

ShowNext(false);
Expand Down
2 changes: 1 addition & 1 deletion Source/Gui/Dialogs/WelcomeDlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class CWelcomeDlg :
private:
CMyImage LeftImage;
CMyImage LogoImage;
CFont NewFont;
CFont NewFont, font2_;
std::unique_ptr<Gdiplus::Bitmap> createLeftImage();
};

Expand Down
4 changes: 2 additions & 2 deletions Source/Gui/GuiTools.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ namespace GuiTools
void GetCheck(HWND dlg, int id, bool& check);
bool GetCheck(HWND dlg, int id);
void SetCheck(HWND dlg, int id, bool check);
HFONT MakeLabelBold(HWND Label);
[[nodiscard]] HFONT MakeLabelBold(HWND Label);
void EnableNextN(HWND Control, int n, bool Enable);
bool InsertMenu(HMENU hMenu, int pos, UINT id, LPCTSTR szTitle, HBITMAP bm = 0);
void FillRectGradient(HDC hdc, const RECT& FillRect, COLORREF start, COLORREF finish, bool Horizontal);
Expand All @@ -52,7 +52,7 @@ namespace GuiTools
HFONT MakeFontUnderLine(HFONT font);
HFONT MakeFontBold(HFONT font);
HFONT MakeFontSmaller(HFONT font);
HFONT MakeLabelItalic(HWND Label);
[[nodiscard]] HFONT MakeLabelItalic(HWND Label);

int GetFontSize(int nFontHeight);
int GetFontHeight(int nFontSize);
Expand Down
Binary file modified Source/res/icon_log.ico
Binary file not shown.
Binary file modified Source/res/icon_upload.ico
Binary file not shown.

0 comments on commit df2691b

Please sign in to comment.