Skip to content

Commit 38b028a

Browse files
committed
settings:opt.show.row.numbers
1 parent d0de87b commit 38b028a

File tree

3 files changed

+33
-5
lines changed

3 files changed

+33
-5
lines changed

CsvQuery/Forms/QueryWindow.Designer.cs

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

CsvQuery/Forms/QueryWindow.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,31 @@ public QueryWindow()
5353

5454
private void OnSettingsChanged(object sender, SettingsChangedEventArgs e)
5555
{
56+
if (e.Changed.Contains(nameof(Settings.UseNppStyling)))
57+
{
58+
this.ApplyStyling(e.NewSettings.UseNppStyling);
59+
}
60+
61+
if (e.Changed.Contains(nameof(Settings.ShowRowNumbers)))
62+
{
63+
this.contextmenuShowRowNumbers.Checked = e.NewSettings.ShowRowNumbers;
64+
this.dataGrid.RowHeadersVisible = this.contextmenuShowRowNumbers.Checked;
65+
this.FormatDataGrid();
66+
}
67+
68+
/*
5669
if (!e.Changed.Contains(nameof(Settings.UseNppStyling)))
5770
return;
5871
this.ApplyStyling(e.NewSettings.UseNppStyling);
72+
*/
73+
}
74+
75+
/// <summary>
76+
/// Applies show row numbers
77+
/// </summary>
78+
public void ApplyShowRowNumbers(bool show)
79+
{
80+
5981
}
6082

6183
/// <summary>
@@ -457,6 +479,7 @@ private void OnContextmenuSelectAll(object sender, EventArgs e)
457479
private void OnContextmenuShowRowNumbers(object sender, EventArgs e)
458480
{
459481
this.contextmenuShowRowNumbers.Checked = this.dataGrid.RowHeadersVisible = !this.dataGrid.RowHeadersVisible;
482+
Main.Settings.ShowRowNumbers = this.contextmenuShowRowNumbers.Checked;
460483
this.FormatDataGrid();
461484
}
462485

CsvQuery/PluginInfrastructure/SettingsBase.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,13 @@ public void ShowDialog()
149149
{
150150
// We bind a copy of this object and only apply it after they click "Ok"
151151
var copy = (Settings) MemberwiseClone();
152-
152+
153+
int ClientWidth = 800;
154+
var ClientHeight = 600;
153155
var dialog = new Form
154156
{
155157
Text = "Settings",
156-
ClientSize = new Size(300, 300),
158+
ClientSize = new Size(ClientWidth, ClientHeight),
157159
MinimumSize = new Size(250, 250),
158160
ShowIcon = false,
159161
AutoScaleMode = AutoScaleMode.Font,
@@ -166,7 +168,7 @@ public void ShowDialog()
166168
Text = "&Cancel",
167169
Anchor = AnchorStyles.Bottom | AnchorStyles.Right,
168170
Size = new Size(75, 23),
169-
Location = new Point(300 - 75 - 13, 300 - 23 - 13),
171+
Location = new Point(ClientWidth - 75 - 13, ClientHeight - 23 - 13),
170172
UseVisualStyleBackColor = true
171173
},
172174
new Button
@@ -175,15 +177,15 @@ public void ShowDialog()
175177
Text = "&Ok",
176178
Anchor = AnchorStyles.Bottom | AnchorStyles.Right,
177179
Size = new Size(75, 23),
178-
Location = new Point(300 - 75 - 13 - 81, 300 - 23 - 13),
180+
Location = new Point(ClientWidth - 75 - 13 - 81, ClientHeight - 23 - 13),
179181
UseVisualStyleBackColor = true
180182
},
181183
new PropertyGrid
182184
{
183185
Name = "Grid",
184186
Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right,
185187
Location = new Point(13, 13),
186-
Size = new Size(300 - 13 - 13, 300 - 55),
188+
Size = new Size(ClientWidth - 13 - 13, ClientHeight - 55),
187189
AutoScaleMode = AutoScaleMode.Font,
188190
AutoScaleDimensions = new SizeF(6F,13F),
189191
SelectedObject = copy

0 commit comments

Comments
 (0)