Skip to content

Commit

Permalink
- Added Search Icon in UI
Browse files Browse the repository at this point in the history
- Added Drag & Drop effect & auto-fill after drag
  • Loading branch information
ttodua committed Feb 9, 2021
1 parent f52097f commit 38e853b
Show file tree
Hide file tree
Showing 5 changed files with 453 additions and 400 deletions.
10 changes: 10 additions & 0 deletions WinAuth/AddAuthenticator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -596,9 +596,18 @@ private void secretCodeField_DragEnter(object sender, DragEventArgs e)
e.Effect = DragDropEffects.Copy;
}

private Color initialColor;

private void dragPanel_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Copy;
initialColor = (sender as Panel).BackColor;
(sender as Panel).BackColor = Color.LightGreen;
}

private void dragImagePanel_DragLeave(object sender, EventArgs e)
{
(sender as Panel).BackColor = initialColor;
}

private void dragPanel_DragDrop(object sender, DragEventArgs e)
Expand All @@ -609,6 +618,7 @@ private void dragPanel_DragDrop(object sender, DragEventArgs e)
byte[] imageArray = System.IO.File.ReadAllBytes(filePath);
string base64ImageRepresentation = Convert.ToBase64String(imageArray);
secretCodeField.Text = @"data:image/"+ ext + ";base64," + base64ImageRepresentation;
this.verifyButton_Click(null, null);
}

#endregion
Expand Down
Loading

0 comments on commit 38e853b

Please sign in to comment.