Skip to content

Commit

Permalink
Bug 1494: Colored session icon does not display on high DPI
Browse files Browse the repository at this point in the history
https://winscp.net/tracker/1494

Source commit: 61e90461f357f4a858ea2c0dfdc0c4a07ae91bbc
  • Loading branch information
martinprikryl committed Jan 28, 2018
1 parent df9767f commit 15db506
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions source/forms/Login.cpp
Expand Up @@ -140,6 +140,8 @@ void __fastcall TLoginDialog::InitControls()
CenterButtonImage(LoginButton);

SelectScaledImageList(SessionImageList);
// have to recreate the site images
UpdateNodeImages();
SelectScaledImageList(ActionImageList);

// Generate button images.
Expand Down Expand Up @@ -319,6 +321,19 @@ TTreeNode * __fastcall TLoginDialog::AddSession(TSessionData * Data)
return Node;
}
//---------------------------------------------------------------------------
void __fastcall TLoginDialog::UpdateNodeImages()
{
TTreeNode * Node = SessionTree->Items->GetFirstNode();
while (Node != NULL)
{
if (IsSiteNode(Node))
{
UpdateNodeImage(Node);
}
Node = Node->GetNext();
}
}
//---------------------------------------------------------------------------
void __fastcall TLoginDialog::UpdateNodeImage(TTreeNode * Node)
{
SetNodeImage(Node, GetSessionImageIndex(GetNodeSession(Node)));
Expand Down
1 change: 1 addition & 0 deletions source/forms/Login.h
Expand Up @@ -377,6 +377,7 @@ class TLoginDialog : public TForm
bool __fastcall IsCloneToNewSiteDefault();
bool __fastcall IsDefaultResult(TModalResult Result);
void __fastcall UpdateNodeImage(TTreeNode * Node);
void __fastcall UpdateNodeImages();
int __fastcall GetSessionImageIndex(TSessionData * Data);
void __fastcall SetNodeImage(TTreeNode * Node, int ImageIndex);
void __fastcall CancelEditing();
Expand Down

0 comments on commit 15db506

Please sign in to comment.