Skip to content

Commit

Permalink
Add menu 'Copy Name', fix scrollbar, update to v0.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Mignari committed Aug 8, 2020
1 parent fd973d5 commit 2bccd9e
Show file tree
Hide file tree
Showing 13 changed files with 41 additions and 34 deletions.
3 changes: 2 additions & 1 deletion Source/Controls/ListBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public enum ListBaseLayout

public class ListBase<T> : DarkScrollView
{
private ListBaseLayout m_layout;
private readonly ListBaseLayout m_layout;
private int m_itemSize;
private int m_anchoredItemStart;
private int m_anchoredItemEnd;
Expand Down Expand Up @@ -98,6 +98,7 @@ public int ItemSize
if (value != m_itemSize)
{
m_itemSize = value;
Ticks = value;
UpdateListBox();
}
}
Expand Down
5 changes: 5 additions & 0 deletions Source/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,7 @@ private void ItemsListBoxContextMenu_Opening(object sender, CancelEventArgs e)
itemsListBoxContextMenu.Items.Add("-");
itemsListBoxContextMenu.Items.Add("Copy Server ID");
itemsListBoxContextMenu.Items.Add("Copy Client ID");
itemsListBoxContextMenu.Items.Add("Copy Name");
}
}

Expand All @@ -1051,6 +1052,10 @@ private void ItemsListBoxContextMenu_ItemClicked(object sender, ToolStripItemCli
case "Copy Client ID":
Clipboard.SetText(CurrentServerItem.ClientId.ToString());
break;

case "Copy Name":
Clipboard.SetText(CurrentServerItem.NameXml);
break;
}
}

Expand Down
2 changes: 1 addition & 1 deletion Source/PluginInterface/PluginInterface.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PluginInterface</RootNamespace>
<AssemblyName>PluginInterface</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
Expand Down
4 changes: 2 additions & 2 deletions Source/PluginInterface/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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("0.5.0.0")]
[assembly: AssemblyFileVersion("0.5.0.0")]
[assembly: AssemblyVersion("0.5.1.0")]
[assembly: AssemblyFileVersion("0.5.1.0")]
26 changes: 13 additions & 13 deletions Source/PluginInterface/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Source/PluginOne/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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("0.5.0.0")]
[assembly: AssemblyFileVersion("0.5.0.0")]
[assembly: AssemblyVersion("0.5.1.0")]
[assembly: AssemblyFileVersion("0.5.1.0")]
2 changes: 1 addition & 1 deletion Source/PluginThree/PluginThree.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PluginThree</RootNamespace>
<AssemblyName>PluginThree</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
Expand Down
4 changes: 2 additions & 2 deletions Source/PluginThree/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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("0.5.0.0")]
[assembly: AssemblyFileVersion("0.5.0.0")]
[assembly: AssemblyVersion("0.5.1.0")]
[assembly: AssemblyFileVersion("0.5.1.0")]
2 changes: 1 addition & 1 deletion Source/PluginTwo/PluginTwo.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PluginTwo</RootNamespace>
<AssemblyName>PluginTwo</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
Expand Down
4 changes: 2 additions & 2 deletions Source/PluginTwo/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@
// 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("0.5.0.0")]
[assembly: AssemblyFileVersion("0.5.0.0")]
[assembly: AssemblyVersion("0.5.1.0")]
[assembly: AssemblyFileVersion("0.5.1.0")]
4 changes: 2 additions & 2 deletions Source/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@
// 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("0.5.0.0")]
[assembly: AssemblyFileVersion("0.5.0.0")]
[assembly: AssemblyVersion("0.5.1.0")]
[assembly: AssemblyFileVersion("0.5.1.0")]
3 changes: 0 additions & 3 deletions ThirdParty/DarkUI/Controls/DarkScrollBar.cs
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,7 @@ public void ScrollBy(int offset)
public void ScrollByPhysical(int offsetInPixels)
{
var isVert = _scrollOrientation == DarkScrollOrientation.Vertical;

var thumbPos = isVert ? (_thumbArea.Top - _trackArea.Top) : (_thumbArea.Left - _trackArea.Left);

var newPosition = thumbPos - offsetInPixels;

ScrollToPhysical(newPosition);
Expand Down Expand Up @@ -413,7 +411,6 @@ public void UpdateScrollBar()

// Thumb
UpdateThumb();

Invalidate();
}

Expand Down
12 changes: 8 additions & 4 deletions ThirdParty/DarkUI/Controls/DarkScrollBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ public bool HideScrollBars
}
}

public int Ticks { get; set; }

public bool HorizontalScrollBarHidden
{
get => _horizontalScrollBarHidden;
Expand Down Expand Up @@ -144,6 +146,8 @@ protected DarkScrollBase()
_dragTimer = new Timer();
_dragTimer.Interval = 1;
_dragTimer.Tick += DragTimer_Tick;

Ticks = 1;
}

#endregion
Expand Down Expand Up @@ -343,16 +347,16 @@ protected override void OnMouseWheel(MouseEventArgs e)
if (!horizontal)
{
if (e.Delta > 0)
_vScrollBar.ScrollByPhysical(3);
_vScrollBar.ScrollBy(-Ticks);
else if (e.Delta < 0)
_vScrollBar.ScrollByPhysical(-3);
_vScrollBar.ScrollBy(Ticks);
}
else
{
if (e.Delta > 0)
_hScrollBar.ScrollByPhysical(3);
_hScrollBar.ScrollBy(-Ticks);
else if (e.Delta < 0)
_hScrollBar.ScrollByPhysical(-3);
_hScrollBar.ScrollBy(Ticks);
}
}

Expand Down

0 comments on commit 2bccd9e

Please sign in to comment.