Tried to make active video control tab header bold in main window... needs testing

git-svn-id: https://subtitleedit.googlecode.com/svn/trunk@869 99eadd0c-20b8-1223-b5c4-2a2b2df33de2
This commit is contained in:
niksedk 2011-12-30 18:49:01 +00:00
parent cbd6411ee5
commit aa94a3ec30
3 changed files with 21 additions and 2 deletions

View File

@ -2151,11 +2151,13 @@
this.tabControlButtons.Controls.Add(this.tabPageTranslate);
this.tabControlButtons.Controls.Add(this.tabPageCreate);
this.tabControlButtons.Controls.Add(this.tabPageAdjust);
this.tabControlButtons.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed;
this.tabControlButtons.Location = new System.Drawing.Point(6, 12);
this.tabControlButtons.Name = "tabControlButtons";
this.tabControlButtons.SelectedIndex = 0;
this.tabControlButtons.Size = new System.Drawing.Size(467, 283);
this.tabControlButtons.TabIndex = 0;
this.tabControlButtons.DrawItem += new System.Windows.Forms.DrawItemEventHandler(this.tabControlButtons_DrawItem);
this.tabControlButtons.SelectedIndexChanged += new System.EventHandler(this.tabControl1_SelectedIndexChanged);
//
// tabPageTranslate

View File

@ -9368,11 +9368,12 @@ namespace Nikse.SubtitleEdit.Forms
}
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
{
if (tabControlButtons.SelectedIndex == 0)
{
tabControlButtons.Width = groupBoxTranslateSearch.Left + groupBoxTranslateSearch.Width + 10;
Configuration.Settings.VideoControls.LastActiveTab = "Translate";
}
else if (tabControlButtons.SelectedIndex == 1)
{
@ -12211,5 +12212,21 @@ namespace Nikse.SubtitleEdit.Forms
UpdatePositionAndTotalLength(labelTextAlternateLineTotal, textBoxListViewTextAlternate);
}
private void tabControlButtons_DrawItem(object sender, DrawItemEventArgs e)
{
TabControl tc = (TabControl)sender;
Brush textBrush = new SolidBrush(this.ForeColor);
Font tabFont = new Font(tc.Font, FontStyle.Regular);
if (e.State == DrawItemState.Selected)
{
tabFont = new Font(tc.Font, FontStyle.Bold);
e.Graphics.FillRectangle(new SolidBrush(SystemColors.Window), e.Bounds);
}
Rectangle tabBounds = tc.GetTabRect(e.Index);
var stringFlags = new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center };
e.Graphics.DrawString(tc.TabPages[e.Index].Text, tabFont, textBrush, tabBounds, new StringFormat(stringFlags));
}
}
}

View File

@ -681,7 +681,7 @@
AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAD2
CAAAAk1TRnQBSQFMAgEBAgEAAWgBDgFoAQ4BEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
CAAAAk1TRnQBSQFMAgEBAgEAAZABDgGQAQ4BEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA