Add new layout - thx Flitskikker :)

See #7482
This commit is contained in:
niksedk 2023-10-09 17:03:59 +02:00
parent 4ef9987512
commit 1ffdb2dc18
7 changed files with 117 additions and 26 deletions

View File

@ -42,6 +42,7 @@
this.buttonOk = new System.Windows.Forms.Button();
this.button12 = new System.Windows.Forms.Button();
this.button9 = new System.Windows.Forms.Button();
this.button10 = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// button1
@ -226,7 +227,7 @@
this.button12.Name = "button12";
this.button12.Size = new System.Drawing.Size(195, 147);
this.button12.TabIndex = 15;
this.button12.Text = "10";
this.button12.Text = "12";
this.button12.UseVisualStyleBackColor = true;
this.button12.Click += new System.EventHandler(this.button12_Click);
this.button12.Enter += new System.EventHandler(this.button12_Enter);
@ -238,7 +239,7 @@
this.button9.FlatAppearance.BorderSize = 0;
this.button9.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button9.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button9.Image = global::Nikse.SubtitleEdit.Properties.Resources.L91;
this.button9.Image = global::Nikse.SubtitleEdit.Properties.Resources.L9;
this.button9.Location = new System.Drawing.Point(13, 313);
this.button9.Name = "button9";
this.button9.Size = new System.Drawing.Size(195, 147);
@ -250,11 +251,28 @@
this.button9.MouseEnter += new System.EventHandler(this.button9_MouseEnter);
this.button9.MouseLeave += new System.EventHandler(this.button9_MouseLeave);
//
// button10
//
this.button10.FlatAppearance.BorderSize = 0;
this.button10.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button10.Font = new System.Drawing.Font("Microsoft Sans Serif", 20F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.button10.Image = global::Nikse.SubtitleEdit.Properties.Resources.L10;
this.button10.Location = new System.Drawing.Point(218, 313);
this.button10.Name = "button10";
this.button10.Size = new System.Drawing.Size(195, 147);
this.button10.TabIndex = 93;
this.button10.Text = "10";
this.button10.UseVisualStyleBackColor = true;
this.button10.Click += new System.EventHandler(this.button10_Click);
this.button10.MouseEnter += new System.EventHandler(this.button10_MouseEnter);
this.button10.MouseLeave += new System.EventHandler(this.button10_MouseLeave);
//
// LayoutPicker
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(838, 511);
this.Controls.Add(this.button10);
this.Controls.Add(this.button9);
this.Controls.Add(this.button12);
this.Controls.Add(this.buttonOk);
@ -299,5 +317,6 @@
private System.Windows.Forms.Button buttonOk;
private System.Windows.Forms.Button button12;
private System.Windows.Forms.Button button9;
private System.Windows.Forms.Button button10;
}
}

View File

@ -67,7 +67,7 @@ namespace Nikse.SubtitleEdit.Forms
_gray7 = GrayScale(Properties.Resources.L7, initialLayout == 6);
_gray8 = GrayScale(Properties.Resources.L8, initialLayout == 7);
_gray9 = GrayScale(Properties.Resources.L9, initialLayout == 8);
_gray10 = GrayScale(Properties.Resources.L9, initialLayout == 9);
_gray10 = GrayScale(Properties.Resources.L10, initialLayout == 9);
_gray11 = GrayScale(Properties.Resources.L9, initialLayout == 10);
_gray12 = GrayScale(Properties.Resources.L12, initialLayout == 11);
@ -80,6 +80,7 @@ namespace Nikse.SubtitleEdit.Forms
button7.Image = _gray7;
button8.Image = _gray8;
button9.Image = _gray9;
button10.Image = _gray10;
button12.Image = _gray12;
button1.Font = new Font(button1.Font.FontFamily, 28);
@ -91,6 +92,7 @@ namespace Nikse.SubtitleEdit.Forms
button7.Font = new Font(button1.Font.FontFamily, 28);
button8.Font = new Font(button1.Font.FontFamily, 28);
button9.Font = new Font(button1.Font.FontFamily, 28);
button10.Font = new Font(button1.Font.FontFamily, 28);
button12.Font = new Font(button1.Font.FontFamily, 28);
}
@ -190,6 +192,12 @@ namespace Nikse.SubtitleEdit.Forms
DialogResult = DialogResult.OK;
}
private void button10_Click(object sender, EventArgs e)
{
_layout = 9;
DialogResult = DialogResult.OK;
}
private void button12_Click(object sender, EventArgs e)
{
_layout = 9;
@ -286,6 +294,16 @@ namespace Nikse.SubtitleEdit.Forms
button9.Image = _gray9;
}
private void button10_MouseEnter(object sender, EventArgs e)
{
button10.Image = Properties.Resources.L10;
}
private void button10_MouseLeave(object sender, EventArgs e)
{
button9.Image = _gray10;
}
private void button12_MouseEnter(object sender, EventArgs e)
{
button12.Image = Properties.Resources.L12;
@ -483,5 +501,7 @@ namespace Nikse.SubtitleEdit.Forms
{
ShowVideoControls = checkBoxHideVideoControls.Checked;
}
}
}

View File

@ -11,7 +11,7 @@ namespace Nikse.SubtitleEdit.Logic
{
public static class LayoutManager
{
public const int LayoutNoVideo = 9;
public const int LayoutNoVideo = 10;
public static SplitContainer MainSplitContainer;
public static void SetLayout(int layout, Form form, Control videoPlayer, SubtitleListView subtitleListView, GroupBox groupBoxWaveform, GroupBox groupBoxEdit, SplitterEventHandler splitMoved)
@ -50,9 +50,12 @@ namespace Nikse.SubtitleEdit.Logic
case 8:
SetLayout8(form, videoPlayer, subtitleListView, groupBoxWaveform, groupBoxEdit, splitMoved);
break;
case LayoutNoVideo:
case 9:
SetLayout9(form, videoPlayer, subtitleListView, groupBoxWaveform, groupBoxEdit, splitMoved);
break;
case LayoutNoVideo:
SetLayout10(form, videoPlayer, subtitleListView, groupBoxWaveform, groupBoxEdit, splitMoved);
break;
}
}
@ -476,8 +479,56 @@ namespace Nikse.SubtitleEdit.Logic
spLeftTop.SplitterMoved += splitMoved;
}
// no video or waveform
// video left, waveform + text right, list view bottom
private static void SetLayout9(Form form, Control videoPlayerContainer, SubtitleListView subtitleListView, GroupBox groupBoxWaveform, GroupBox groupBoxEdit, SplitterEventHandler splitMoved)
{
var spMain = new SplitContainer();
MainSplitContainer = spMain;
spMain.Orientation = Orientation.Horizontal;
subtitleListView.Parent?.Controls.Remove(subtitleListView);
spMain.Panel2.Controls.Add(subtitleListView);
subtitleListView.Dock = DockStyle.Fill;
var spLeftTop = new SplitContainer();
spLeftTop.Orientation = Orientation.Vertical;
spMain.Panel1.Controls.Add(spLeftTop);
spLeftTop.Dock = DockStyle.Fill;
videoPlayerContainer.Parent?.Controls.Remove(videoPlayerContainer);
spLeftTop.Panel1.Controls.Add(videoPlayerContainer);
videoPlayerContainer.Dock = DockStyle.Fill;
var spLeftBottom = new SplitContainer();
spLeftBottom.Orientation = Orientation.Horizontal;
spLeftTop.Panel2.Controls.Add(spLeftBottom);
spLeftBottom.Dock = DockStyle.Fill;
var ge = groupBoxWaveform;
ge.Parent?.Controls.Remove(ge);
spLeftBottom.Panel1.Controls.Add(ge);
ge.Dock = DockStyle.Fill;
var gv = groupBoxEdit;
gv.Parent?.Controls.Remove(gv);
spLeftBottom.Panel2.Controls.Add(gv);
gv.Dock = DockStyle.Fill;
form.Controls.Add(spMain);
spMain.Dock = DockStyle.Fill;
spMain.BringToFront();
// auto size
spMain.SplitterDistance = form.Height / 2;
spLeftTop.SplitterDistance = form.Width / 2;
spLeftBottom.SplitterDistance = Math.Max(10, spLeftBottom.Height - 125);
spMain.SplitterMoved += splitMoved;
spLeftTop.SplitterMoved += splitMoved;
spLeftBottom.SplitterMoved += splitMoved;
}
// no video or waveform
private static void SetLayout10(Form form, Control videoPlayerContainer, SubtitleListView subtitleListView, GroupBox groupBoxWaveform, GroupBox groupBoxEdit, SplitterEventHandler splitMoved)
{
videoPlayerContainer.Parent?.Controls.Remove(videoPlayerContainer);
groupBoxWaveform.Parent?.Controls.Remove(groupBoxWaveform);

View File

@ -170,6 +170,16 @@ namespace Nikse.SubtitleEdit.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap L10 {
get {
object obj = ResourceManager.GetObject("L10", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
@ -260,16 +270,6 @@ namespace Nikse.SubtitleEdit.Properties {
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
public static System.Drawing.Bitmap L91 {
get {
object obj = ResourceManager.GetObject("L91", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>

View File

@ -118,9 +118,6 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="L2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\L2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="L3" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\L3.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
@ -154,8 +151,8 @@
<data name="Error" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Error.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="L8" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\L8.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="L2" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\L2.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="bookmark22dark" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\bookmark22dark.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
@ -184,25 +181,28 @@
<data name="L4" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\L4.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="L12" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\L12.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Donate" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Icons\Donate.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="SEIcon" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\SE.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="L8" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\L8.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="L7" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\L7.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="L91" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\L9.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Help32" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Help32.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Information" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Information.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="L12" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\L12.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
<data name="L10" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\L10.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>

BIN
src/ui/Resources/L10.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

View File

@ -2563,6 +2563,7 @@
<None Include="Resources\L7.png" />
<None Include="Resources\L9.png" />
<None Include="Resources\L12.png" />
<None Include="Resources\L10.png" />
<Content Include="Resources\TesseractDictionaries.xml">
<SubType>Designer</SubType>
</Content>