Skip to content

Commit 54bf826

Browse files
committed
Added new DataGridView control.
1 parent 04aa77c commit 54bf826

File tree

13 files changed

+1062
-36
lines changed

13 files changed

+1062
-36
lines changed

Source/Clients/NostalgicPlayer/FavoriteSongSystemWindow/FavoriteSongSystemForm.Designer.cs

Lines changed: 2 additions & 19 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Source/Clients/NostalgicPlayer/FavoriteSongSystemWindow/FavoriteSongSystemForm.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ public FavoriteSongSystemForm(IMainWindowApi mainWindow, ModuleDatabase database
8383
});
8484

8585
// Add items to the combo controls
86-
showComboBox.Items.AddRange(new object[]
87-
{
86+
showComboBox.Items.AddRange(
87+
[
8888
Resources.IDS_FAVORITE_SHOW_TOP10,
8989
Resources.IDS_FAVORITE_SHOW_TOP50,
9090
Resources.IDS_FAVORITE_SHOW_TOP100,
@@ -93,7 +93,7 @@ public FavoriteSongSystemForm(IMainWindowApi mainWindow, ModuleDatabase database
9393
Resources.IDS_FAVORITE_SHOW_BOTTOM50,
9494
Resources.IDS_FAVORITE_SHOW_BOTTOM100,
9595
Resources.IDS_FAVORITE_SHOW_BOTTOMX
96-
});
96+
]);
9797

9898
showComboBox.SelectedIndex = (int)settings.Show;
9999
otherNumberTextBox.Text = settings.ShowOther.ToString();
@@ -187,12 +187,12 @@ public void RefreshWindow()
187187
if (ArchivePath.IsArchivePath(fileName))
188188
fileName = ArchivePath.GetEntryName(fileName);
189189

190-
row.Cells.AddRange(new DataGridViewCell[]
191-
{
190+
row.Cells.AddRange(
191+
[
192192
new KryptonDataGridViewTextBoxCell { Value = pos },
193193
new KryptonDataGridViewTextBoxCell { Value = fileName },
194194
new KryptonDataGridViewTextBoxCell { Value = pair.Value.ListenCount }
195-
});
195+
]);
196196

197197
row.Tag = pair.Key;
198198

@@ -271,7 +271,7 @@ private void FavoriteDataGridView_SelectionChanged(object sender, EventArgs e)
271271
private void FavoriteDataGridView_DoubleClick(object sender, EventArgs e)
272272
{
273273
if (favoriteDataGridView.SelectedRows.Count > 0)
274-
mainWindowApi.AddFilesToModuleList(new[] { favoriteDataGridView.SelectedRows[0].Tag as string });
274+
mainWindowApi.AddFilesToModuleList([ favoriteDataGridView.SelectedRows[0].Tag as string ]);
275275
}
276276

277277

Source/NostalgicPlayer.Controls/Buttons/NostalgicButton.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ public FontConfiguration UseFont
8181
/********************************************************************/
8282
protected override void OnHandleCreated(EventArgs e)
8383
{
84-
base.OnHandleCreated(e);
85-
8684
if (DesignMode)
8785
SetTheme(ThemeManagerFactory.GetThemeManager().CurrentTheme);
86+
87+
base.OnHandleCreated(e);
8888
}
8989
#endregion
9090

Source/NostalgicPlayer.Controls/Forms/NostalgicForm.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,15 +98,15 @@ protected override void OnHandleCreated(EventArgs e)
9898
{
9999
InitializeTheme();
100100

101-
base.OnHandleCreated(e);
102-
103101
isActive = ActiveForm == this;
104102

105103
SetFormProperties();
106104

107105
CalculateTitleHeight();
108106
ApplyWindowRegion();
109107
RefreshNonClientArea();
108+
109+
base.OnHandleCreated(e);
110110
}
111111
#endregion
112112

@@ -924,7 +924,7 @@ private int DrawIcon(Graphics g)
924924
/********************************************************************/
925925
private void DrawTitle(Graphics g, int left, int right)
926926
{
927-
Rectangle rect = new Rectangle(left, FrameBorderThickness + ((titleBarHeight - titleBarFontSize) / 2), right - left, titleBarFontSize);
927+
Rectangle rect = new Rectangle(left, FrameBorderThickness + ((titleBarHeight - titleBarFontSize) / 2) - 1, right - left, titleBarFontSize);
928928

929929
Color titleColor = isActive ? colors.ActivatedWindowTitleColor : colors.DeactivatedWindowTitleColor;
930930

Source/NostalgicPlayer.Controls/Lists/NostalgicComboBox.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,12 @@ public FontConfiguration UseFont
9797
/********************************************************************/
9898
protected override void OnHandleCreated(EventArgs e)
9999
{
100-
base.OnHandleCreated(e);
101-
102100
if (DesignMode)
103101
SetTheme(ThemeManagerFactory.GetThemeManager().CurrentTheme);
104102

105103
UpdateFont();
104+
105+
base.OnHandleCreated(e);
106106
}
107107
#endregion
108108

@@ -117,6 +117,7 @@ public void SetTheme(ITheme theme)
117117
colors = theme.ComboBoxColors;
118118
fonts = theme.StandardFonts;
119119

120+
UpdateFont();
120121
Invalidate();
121122
}
122123
#endregion
@@ -437,7 +438,7 @@ private void DrawText(Graphics g, Rectangle rect, StateColors stateColors)
437438

438439
string text = GetItemText(SelectedItem);
439440

440-
TextFormatFlags flags = TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine | TextFormatFlags.EndEllipsis;
441+
TextFormatFlags flags = TextFormatFlags.Left | TextFormatFlags.VerticalCenter | TextFormatFlags.SingleLine | TextFormatFlags.EndEllipsis | TextFormatFlags.NoPrefix;
441442
Rectangle drawRect = new Rectangle(rect.X, rect.Y, rect.Width - DropDownButtonWidth - PaddingBetweenTextAndButton, rect.Height);
442443
TextRenderer.DrawText(g, text, font, drawRect, stateColors.TextColor, flags);
443444
}

0 commit comments

Comments
 (0)