Update settings tab design
This commit is contained in:
parent
8c06dfbca8
commit
556f519413
7 changed files with 2321 additions and 1462 deletions
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms;
|
||||
// using Bunifu.UI.WinForms;
|
||||
|
||||
|
@ -10,14 +11,48 @@ namespace XeroBrowser
|
|||
public FrmSettings()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
tabControl1.DrawMode = TabDrawMode.OwnerDrawFixed;
|
||||
tabControl1.Padding = new Point(15, 8);
|
||||
tabControl1.Appearance = TabAppearance.FlatButtons;
|
||||
tabControl1.ItemSize = new Size(0, 34);
|
||||
tabControl1.SizeMode = TabSizeMode.Fixed;
|
||||
}
|
||||
|
||||
private void tabControl1_DrawItem(object sender, DrawItemEventArgs e)
|
||||
{
|
||||
TabControl tabControl = (TabControl)sender;
|
||||
TabPage tabPage = tabControl.TabPages[e.Index];
|
||||
|
||||
// Set the background color of the tab
|
||||
using (Brush brush = new SolidBrush(Color.FromArgb(224, 224, 224)))
|
||||
{
|
||||
e.Graphics.FillRectangle(brush, e.Bounds);
|
||||
}
|
||||
|
||||
// Draw the icon for the tab, if available
|
||||
if (tabPage.ImageIndex >= 0)
|
||||
{
|
||||
Image icon = tabControl.ImageList.Images[tabPage.ImageIndex];
|
||||
Rectangle iconRect = new Rectangle(e.Bounds.X + 6, e.Bounds.Y + 6, 20, 20);
|
||||
e.Graphics.DrawImage(icon, iconRect);
|
||||
}
|
||||
|
||||
// Draw the text for the tab
|
||||
using (Brush brush = new SolidBrush(Color.Black))
|
||||
{
|
||||
Font font = new Font("Segoe UI", 9, FontStyle.Regular);
|
||||
StringFormat format = new StringFormat();
|
||||
format.Alignment = StringAlignment.Center;
|
||||
format.LineAlignment = StringAlignment.Center;
|
||||
Rectangle textRect = new Rectangle(e.Bounds.X + 28, e.Bounds.Y, e.Bounds.Width - 28, e.Bounds.Height);
|
||||
e.Graphics.DrawString(tabPage.Text, font, brush, textRect, format);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void bunifuDropdown1_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void bunifuButton22_Click(object sender, EventArgs e)
|
||||
|
@ -29,5 +64,31 @@ namespace XeroBrowser
|
|||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void bunifuTextBox1_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
bunifuRadioButton2.Checked = true;
|
||||
bunifuRadioButton1.Checked = false;
|
||||
}
|
||||
|
||||
private void btnBrowser_Click(object sender, EventArgs e)
|
||||
{
|
||||
tabControl1.SelectedIndex = 0;
|
||||
}
|
||||
|
||||
private void btnPrivacy_Click(object sender, EventArgs e)
|
||||
{
|
||||
tabControl1.SelectedIndex = 1;
|
||||
}
|
||||
|
||||
private void Appearance_Click(object sender, EventArgs e)
|
||||
{
|
||||
tabControl1.SelectedIndex = 2;
|
||||
}
|
||||
|
||||
private void btnBehavior_Click(object sender, EventArgs e)
|
||||
{
|
||||
tabControl1.SelectedIndex = 3;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue