mirror of
https://github.com/ShareX/ShareX.git
synced 2024-09-30 01:07:21 +13:00
Always show encode progress bar
This commit is contained in:
parent
db7ea69ffe
commit
a1418be676
2 changed files with 12 additions and 8 deletions
|
@ -160,7 +160,7 @@ private void InitializeComponent()
|
|||
this.btnEncode.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.btnEncode.Location = new System.Drawing.Point(16, 272);
|
||||
this.btnEncode.Name = "btnEncode";
|
||||
this.btnEncode.Size = new System.Drawing.Size(424, 32);
|
||||
this.btnEncode.Size = new System.Drawing.Size(184, 32);
|
||||
this.btnEncode.TabIndex = 17;
|
||||
this.btnEncode.Text = "Start encoding";
|
||||
this.btnEncode.UseVisualStyleBackColor = true;
|
||||
|
@ -266,11 +266,12 @@ private void InitializeComponent()
|
|||
//
|
||||
this.pbProgress.Font = new System.Drawing.Font("Arial", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
|
||||
this.pbProgress.ForeColor = System.Drawing.Color.White;
|
||||
this.pbProgress.Location = new System.Drawing.Point(16, 272);
|
||||
this.pbProgress.Location = new System.Drawing.Point(208, 272);
|
||||
this.pbProgress.Name = "pbProgress";
|
||||
this.pbProgress.ShowPercentageText = true;
|
||||
this.pbProgress.Size = new System.Drawing.Size(424, 32);
|
||||
this.pbProgress.Size = new System.Drawing.Size(232, 32);
|
||||
this.pbProgress.TabIndex = 19;
|
||||
this.pbProgress.Text = null;
|
||||
//
|
||||
// VideoConverterForm
|
||||
//
|
||||
|
|
|
@ -207,13 +207,16 @@ private async void btnEncode_Click(object sender, EventArgs e)
|
|||
UpdateOptions();
|
||||
|
||||
pbProgress.Value = 0;
|
||||
pbProgress.Visible = true;
|
||||
btnEncode.Visible = false;
|
||||
btnEncode.Enabled = false;
|
||||
|
||||
await StartEncodingAsync();
|
||||
bool result = await StartEncodingAsync();
|
||||
|
||||
btnEncode.Visible = true;
|
||||
pbProgress.Visible = false;
|
||||
if (result)
|
||||
{
|
||||
pbProgress.Value = 100;
|
||||
}
|
||||
|
||||
btnEncode.Enabled = true;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue