static DashboardTheme() { // Palette URL: http://paletton.com/#uid=13I0u0k7UUa3cZA5wXlaiQ5cFL3 Light = new DashboardTheme(primary: Color.FromArgb(248, 248, 255), // 238, 243, 253), // Color.FromArgb(184, 203, 237), primaryLight: Color.FromArgb(207, 221, 245), primaryVeryLight: Color.FromArgb(229, 237, 251), primaryDark: Color.FromArgb(160, 183, 226), primaryVeryDark: Color.FromArgb(137, 163, 212), primaryText: Color.FromArgb(30, 30, 30), secondaryText: Color.DodgerBlue, accentedText: Color.DarkGoldenrod, primaryHeadingText: Color.FromArgb(24, 29, 35), secondaryHeadingText: Color.DimGray, backgroundImage: Properties.Resources.bgblue); // Palette URL: http://paletton.com/#uid=13I0u0k3V4WaYgf7Lb1ac80gJaQ Dark = new DashboardTheme(primary: Color.FromArgb(23, 24, 26), primaryLight: Color.FromArgb(46, 50, 58), primaryVeryLight: Color.FromArgb(59, 69, 86), primaryDark: Color.FromArgb(30, 34, 42), primaryVeryDark: Color.FromArgb(30, 40, 57), primaryText: Color.Silver, secondaryText: Color.LightSkyBlue, accentedText: Color.Goldenrod, primaryHeadingText: Color.White, secondaryHeadingText: Color.Gray, backgroundImage: Properties.Resources.bggrey); }
static DashboardTheme() { // Palette URL: http://paletton.com/#uid=13I0u0k7UUa3cZA5wXlaiQ5cFL3 Light = new DashboardTheme(primary: Color.FromArgb(248, 248, 255), // 238, 243, 253), // Color.FromArgb(184, 203, 237), primaryLight: Color.FromArgb(219, 235, 248), primaryVeryLight: Color.FromArgb(230, 241, 250), primaryDark: Color.FromArgb(172, 208, 239), primaryVeryDark: Color.FromArgb(19, 122, 212), primaryText: Color.FromArgb(30, 30, 30), secondaryText: Color.FromArgb(100, 127, 210), accentedText: Color.DarkGoldenrod, primaryHeadingText: Color.FromArgb(24, 29, 35), secondaryHeadingText: Color.DimGray, backgroundImage: Images.DashboardBackgroundBlue); // Palette URL: http://paletton.com/#uid=13I0u0k3V4WaYgf7Lb1ac80gJaQ Dark = new DashboardTheme(primary: Color.FromArgb(23, 24, 26), primaryLight: Color.FromArgb(46, 50, 58), primaryVeryLight: Color.FromArgb(59, 69, 86), primaryDark: Color.FromArgb(30, 34, 42), primaryVeryDark: Color.FromArgb(30, 40, 57), primaryText: Color.Silver, secondaryText: Color.LightSkyBlue, accentedText: Color.Goldenrod, primaryHeadingText: Color.White, secondaryHeadingText: Color.Gray, backgroundImage: Images.DashboardBackgroundGrey); }
public void RefreshContent() { InitDashboardLayout(); ApplyTheme(); userRepositoriesList.ShowRecentRepositories(); void ApplyTheme() { _selectedTheme = ColorHelper.IsLightTheme() ? DashboardTheme.Light : DashboardTheme.Dark; BackgroundImage = _selectedTheme.BackgroundImage; BackColor = _selectedTheme.Primary; pnlLogo.BackColor = _selectedTheme.PrimaryVeryDark; flpnlStart.BackColor = _selectedTheme.PrimaryLight; flpnlContribute.BackColor = _selectedTheme.PrimaryVeryLight; lblContribute.ForeColor = _selectedTheme.SecondaryHeadingText; userRepositoriesList.BranchNameColor = _selectedTheme.SecondaryText; userRepositoriesList.FavouriteColor = _selectedTheme.AccentedText; userRepositoriesList.ForeColor = _selectedTheme.PrimaryText; userRepositoriesList.HeaderColor = _selectedTheme.SecondaryHeadingText; userRepositoriesList.HeaderBackColor = _selectedTheme.PrimaryDark; userRepositoriesList.HoverColor = _selectedTheme.PrimaryLight; userRepositoriesList.MainBackColor = _selectedTheme.Primary; foreach (var item in flpnlContribute.Controls.OfType <LinkLabel>().Union(flpnlStart.Controls.OfType <LinkLabel>())) { item.LinkColor = _selectedTheme.PrimaryText; } Invalidate(true); } void InitDashboardLayout() { try { pnlLeft.SuspendLayout(); AddLinks(flpnlContribute, panel => { panel.Controls.Add(lblContribute); lblContribute.Font = new Font(AppSettings.Font.FontFamily, AppSettings.Font.SizeInPoints + 5.5f); CreateLink(panel, _develop.Text, Images.Develop.AdaptLightness(), GitHubItem_Click); CreateLink(panel, _donate.Text, Images.DollarSign, DonateItem_Click); CreateLink(panel, _translate.Text, Images.Translate.AdaptLightness(), TranslateItem_Click); var lastControl = CreateLink(panel, _issues.Text, Images.Bug, IssuesItem_Click); return(lastControl); }, (panel, lastControl) => { var height = lastControl.Location.Y + lastControl.Size.Height + panel.Padding.Bottom; panel.Height = height; panel.MinimumSize = new Size(0, height); }); AddLinks(flpnlStart, panel => { CreateLink(panel, _createRepository.Text, Images.RepoCreate, createItem_Click); CreateLink(panel, _openRepository.Text, Images.RepoOpen, openItem_Click); var lastControl = CreateLink(panel, _cloneRepository.Text, Images.CloneRepoGit, cloneItem_Click); foreach (var gitHoster in PluginRegistry.GitHosters) { lastControl = CreateLink(panel, string.Format(_cloneFork.Text, gitHoster.Description), Images.CloneRepoGitHub, (repoSender, eventArgs) => UICommands.StartCloneForkFromHoster(this, gitHoster, GitModuleChanged)); } return(lastControl); }, (panel, lastControl) => { var height = lastControl.Location.Y + lastControl.Size.Height + panel.Padding.Bottom; panel.MinimumSize = new Size(0, height); }); } finally { pnlLeft.ResumeLayout(false); pnlLeft.PerformLayout(); AutoScrollMinSize = new Size(0, pnlLogo.Height + flpnlStart.MinimumSize.Height + flpnlContribute.MinimumSize.Height); } void AddLinks(Panel panel, Func <Panel, Control> addLinks, Action <Panel, Control> onLayout) { panel.SuspendLayout(); panel.Controls.Clear(); var lastControl = addLinks(panel); panel.ResumeLayout(false); panel.PerformLayout(); onLayout(panel, lastControl); } Control CreateLink(Control container, string text, Image icon, EventHandler handler) { var padding24 = DpiUtil.Scale(24); var padding3 = DpiUtil.Scale(3); var linkLabel = new LinkLabel { AutoSize = true, AutoEllipsis = true, Font = AppSettings.Font, Image = DpiUtil.Scale(icon), ImageAlign = ContentAlignment.MiddleLeft, LinkBehavior = LinkBehavior.NeverUnderline, Margin = new Padding(padding3, 0, padding3, DpiUtil.Scale(8)), Padding = new Padding(padding24, padding3, padding3, padding3), TabStop = true, Text = text, TextAlign = ContentAlignment.MiddleLeft }; linkLabel.MouseHover += (s, e) => linkLabel.LinkColor = _selectedTheme.AccentedText; linkLabel.MouseLeave += (s, e) => linkLabel.LinkColor = _selectedTheme.PrimaryText; if (handler != null) { linkLabel.Click += handler; } container.Controls.Add(linkLabel); return(linkLabel); } } }