Skip to content

Commit

Permalink
امکان فعال شدن مصرعها با Tab
Browse files Browse the repository at this point in the history
  • Loading branch information
hrmoh committed Nov 12, 2018
1 parent aa97cc8 commit c48898f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions ganjoor/Main User Control/GanjoorViewer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -526,6 +526,7 @@ private int ShowPoem(GanjoorPoem poem, bool keepTrack, string highlightWord)
else
{
lblVerse = new HighlightLabel();
lblVerse.TabStop = true;
lblVerse.BackColor = Color.Transparent;
lblVerse.AutoSize = true;
if (CenteredView)
Expand Down
15 changes: 15 additions & 0 deletions ganjoor/Main User Control/HighlightLabel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class HighlightLabel : Label
public HighlightLabel() :
this(string.Empty, Settings.Default.HighlightColor)
{
SetStyle(ControlStyles.Selectable, true);
}
public HighlightLabel(string keyword, Color highlightColor)
{
Expand All @@ -25,6 +26,15 @@ public HighlightLabel(string keyword, Color highlightColor)
public Color HighlightColor { set; get; }
#endregion
#region Paint
protected override void OnEnter(EventArgs e)
{
Invalidate();
}

protected override void OnLeave(EventArgs e)
{
Invalidate();
}
protected override void OnPaint(PaintEventArgs e)
{

Expand Down Expand Up @@ -83,6 +93,11 @@ protected override void OnPaint(PaintEventArgs e)
}
}
base.OnPaint(e);
if (Focused)
{
e.Graphics.DrawRectangle(Pens.Black, e.ClipRectangle);
}

}
#endregion
}
Expand Down
4 changes: 2 additions & 2 deletions ganjoor/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.84.*")]
[assembly: AssemblyFileVersion("2.84.0.0")]
[assembly: AssemblyVersion("2.85.*")]
[assembly: AssemblyFileVersion("2.85.0.0")]
[assembly: NeutralResourcesLanguageAttribute("fa-IR")]

0 comments on commit c48898f

Please sign in to comment.