Esempio n. 1
0
        public void SetSchema(ThemeBase theme)
        {
            // Persist settings when rebuilding UI
            string configFile = Path.Combine(Path.GetDirectoryName(Application.ExecutablePath), "DockPanel.temp.config");

            dockPanel.SaveAsXml(configFile);
            CloseAllContents();

            DockPanelTheme = theme;
            EnableVSRenderer(VisualStudioToolStripExtender.VsVersion.Vs2015, theme);

            if (dockPanel.Theme.ColorPalette != null)
            {
                statusBar.BackColor = dockPanel.Theme.ColorPalette.MainWindowStatusBarDefault.Background;
            }

            if (File.Exists(configFile))
            {
                dockPanel.LoadFromXml(configFile, m_deserializeDockContent);
            }

            EnableRenderer(appearanceSetting);
            EnableRenderer(newform);

            newform.MetroTheme       = theme;
            _splashScreen.MetroTheme = theme;
        }
Esempio n. 2
0
 /// <summary>
 /// 设置主题
 /// </summary>
 /// <param name="theme">主题名</param>
 /// <param name="themeVersion">主题版本</param>
 private void SetTheme(ThemeBase theme, VisualStudioToolStripExtender.VsVersion themeVersion)
 {
     this.dockPanel1.Theme = theme;
     visualStudioToolStripExtender1.SetStyle(menuStrip1, themeVersion, theme);
     visualStudioToolStripExtender1.SetStyle(toolStrip1, themeVersion, theme);
     visualStudioToolStripExtender1.SetStyle(statusStrip1, themeVersion, theme);
 }
Esempio n. 3
0
        public AboutDialog(ThemeBase theme)
        {
            InitializeComponent();
            AutoScaleMode = AutoScaleMode.Dpi;

            MetroTheme = theme;
        }
Esempio n. 4
0
 /// <summary>
 /// 设置主题
 /// </summary>
 /// <param name="themeBase"></param>
 private void SetTheme(ThemeBase themeBase)
 {
     dockPanel1.Theme = themeBase;
     visualStudioToolStripExtender1.SetStyle(toolStrip1, VisualStudioToolStripExtender.VsVersion.Vs2015, dockPanel1.Theme);
     visualStudioToolStripExtender1.SetStyle(statusStrip1, VisualStudioToolStripExtender.VsVersion.Vs2015, dockPanel1.Theme);
     statusStrip1.BackColor = dockPanel1.Theme.ColorPalette.MainWindowStatusBarDefault.Background;
 }
Esempio n. 5
0
 public FrmLog(Setting setting, ThemeBase theme)
 {
     InitializeComponent();
     this.tbLog.BackColor = Color.FromArgb(setting.ColorScheme.Log_BackColor);
     this.tbLog.ForeColor = Color.FromArgb(setting.ColorScheme.Log_ForeColor);
     theme.ApplyTo(toolStrip1);
 }
Esempio n. 6
0
 private void SetTheme(VisualStudioToolStripExtender.VsVersion version, ThemeBase theme)
 {
     this.dockPanel.Theme = theme;
     vsToolStripExtender1.SetStyle(this.menuStrip1, version, theme);
     vsToolStripExtender1.SetStyle(this.toolStrip1, version, theme);
     vsToolStripExtender1.SetStyle(this.statusStrip1, version, theme);
 }
Esempio n. 7
0
        /// <summary>
        /// Applies the specific theme
        /// </summary>
        /// <param name="theme"></param>
        public virtual void ApplyTheme(ThemeBase theme)
        {
            contentPanel.Theme = theme;
            if (theme != null)
            {
                var toolstrips = toolStripContainer
                                 .TopToolStripPanel
                                 .Controls
                                 .OfType <ToolStrip>()
                                 .Concat(toolStripContainer
                                         .BottomToolStripPanel
                                         .Controls
                                         .OfType <ToolStrip>())
                                 .Concat(toolStripContainer
                                         .LeftToolStripPanel
                                         .Controls
                                         .OfType <ToolStrip>())
                                 .Concat(toolStripContainer
                                         .RightToolStripPanel
                                         .Controls
                                         .OfType <ToolStrip>());

                foreach (var ts in toolstrips)
                {
                    theme.ApplyTo(ts);
                }
                theme.ApplyTo(menu);
                theme.ApplyTo(status);
                theme.ApplyTo(ctxToolbar);
            }
        }
Esempio n. 8
0
        public SplashScreen()
        {
            InitializeComponent();
            AutoScaleMode = AutoScaleMode.Dpi;

            MetroTheme = new BlueTheme();
        }
Esempio n. 9
0
        public AboutDialog()
        {
            InitializeComponent();
            AutoScaleMode = AutoScaleMode.Dpi;

            MetroTheme = new BlueTheme();
        }
        public override void Open(DockPanel panel, ThemeBase theme)
        {
            _view = new View(theme);

            _subtitles = GetSubtitles();
            _view.LoadData(_subtitles.Where(x => !string.IsNullOrWhiteSpace(x.Text)).ToList());
            _view.Show(panel, DockState.Document);
        }
        public override void Open(DockPanel panel, ThemeBase theme)
        {
            _view = new TextView(theme);

            _text = GetText();
            _view.LoadData(_text);
            _view.Show(panel, DockState.Document);
        }
Esempio n. 12
0
        public override void Open(DockPanel panel, ThemeBase theme)
        {
            _ftView     = new FontTableView(theme);
            _charWidths = GetFontTable();
            _ftView.LoadFontTable(_charWidths);
            _ftView.Show(panel, DockState.Document);

            base.Open(panel, theme);
        }
Esempio n. 13
0
        public override void Open(DockPanel panel, ThemeBase theme)
        {
            _view = new GridView(theme);
            _view.AutoAdjustSizes += ViewOnAutoAdjustSizes;

            _subtitles = GetSubtitles();
            _view.LoadData(_subtitles.Where(x => !string.IsNullOrEmpty(x.Text)).ToList());
            _view.Show(panel, DockState.Document);
        }
Esempio n. 14
0
        public override void Open(DockPanel panel, ThemeBase theme)
        {
            _view = new View(theme);

            _data = GetData();

            _view.LoadData(_data);
            _view.Show(panel, DockState.Document);
        }
 public ThemeInfo(string themeName, ThemeBase inTheme, string inURI, VisualStudioToolStripExtender.VsVersion inVersion)
 {
     _name        = themeName;
     _theme       = inTheme;
     _URI         = inURI;
     _version     = inVersion;
     IsThemeBase  = false;
     IsExtendable = false;
 }
Esempio n. 16
0
        public FrmLyrics(Setting setting, ThemeBase theme)
        {
            InitializeComponent();
            rtbLyrics.BackColor = Color.FromArgb(setting.ColorScheme.Log_BackColor);
            rtbLyrics.ForeColor = Color.FromArgb(setting.ColorScheme.Log_ForeColor);
            culColor            = Color.FromArgb(setting.ColorScheme.Log_ForeColor);

            this.setting        = setting;
            rtbLyrics.GotFocus += RichTextBox1_GotFocus;
        }
Esempio n. 17
0
        public override void Open(DockPanel panel, ThemeBase theme)
        {
            _view = new ImageView(theme);
            _view.NewImageLoaded += FormOnNewImageLoaded;
            _view.SaveImage      += FormOnSaveImage;
            _view.SetFileFilter(Filter);

            UpdateFormImage();
            _view.Show(panel, DockState.Document);
        }
Esempio n. 18
0
        public override void Open(DockPanel panel, ThemeBase theme)
        {
            _view = new FontView(theme);
            _view.NewFontLoaded += FormOnNewFontLoaded;
            _view.SaveFont      += FormOnSaveFont;
            _view.SetFileFilter(Filter);

            UpdateFormLabel();
            _view.Show(panel, DockState.Document);
        }
        public ExportProjectForm(ThemeBase theme, IList <TranslationFileContainer> containers) : this()
        {
            dockPanel1.Theme = theme;

            lbItems.Items.Clear();
            foreach (var container in containers)
            {
                lbItems.Items.Add(container, container.Files.Any(x => x.HasChanges));
            }
        }
Esempio n. 20
0
        /// <summary>
        /// Applies the given theme to this workbench
        /// </summary>
        /// <param name="theme">The theme to apply</param>
        public override void ApplyTheme(ThemeBase theme)
        {
            base.ApplyTheme(theme);
            var exp = _siteExp as SiteExplorer;

            if (exp != null && theme != null)
            {
                exp.AcceptTheme(theme);
            }
        }
Esempio n. 21
0
        public void ThemeHelperUnitTest()
        {
            ThemeBase[] themes = new ThemeBase[] {
                new VS2015DarkTheme(),
                new VS2015BlueTheme(),
                new VS2015LightTheme(),
            };
            ThemeBase firstTheme = themes[0];
            Color     color;

            foreach (var property in firstTheme.ColorPalette.GetType().GetProperties().OrderBy(p => p.Name))
            {
                if (property.PropertyType.Name == "Color")
                {
                    Console.WriteLine($"{property.Name} {{");
                    foreach (var theme in themes)
                    {
                        color = (Color)property.GetValue(theme.ColorPalette);
                        Console.WriteLine($"\t{theme.GetType().Name}: rgba({color.R}, {color.G}, {color.B}, 1.0);");
                    }
                    Console.WriteLine("}");
                }
                else
                {
                    Console.WriteLine($"{property.Name} {{");

                    foreach (var childProperty in property.PropertyType?
                             .GetProperties()?.Where(p => p.PropertyType.Name == "Color") ??
                             Enumerable.Empty <PropertyInfo>())
                    {
                        foreach (var theme in themes)
                        {
                            try
                            {
                                var value = property.GetValue(theme.ColorPalette);
                                if (value != null)
                                {
                                    color = (Color)childProperty.GetValue(value);
                                    Console.WriteLine($"\t{theme.GetType().Name}-{childProperty.Name}: rgba({color.R}, {color.G}, {color.B}, 1.0);");
                                }
                            }
                            catch (Exception ex)
                            {
                                Console.WriteLine($"{theme.GetType().Name}-{childProperty.Name} 错误:{ex.Message}");
                            }
                        }

                        Console.WriteLine("");
                    }

                    Console.WriteLine("}");
                }
            }
        }
Esempio n. 22
0
 private void EnableVSRenderer(VisualStudioToolStripExtender.VsVersion version,
                               ThemeBase theme)
 {
     visualStudioToolStripExtender1.SetStyle(mainMenu, version, theme);
     visualStudioToolStripExtender1.SetStyle(toolBar, version, theme);
     visualStudioToolStripExtender1.SetStyle(dcmTreeWindow.ToolBar, version, theme);
     visualStudioToolStripExtender1.SetStyle(dcmTreeWindow.TreeContextMenuStrip, version, theme);
     visualStudioToolStripExtender1.SetStyle(dcmRawWindow.ToolBar, version, theme);
     visualStudioToolStripExtender1.SetStyle(dcmParsingWindow.ToolBar, version, theme);
     visualStudioToolStripExtender1.SetStyle(dcmVdfWindow.ToolBar, version, theme);
     visualStudioToolStripExtender1.SetStyle(dcmVdfWindow.TreeViewContextMenu, version, theme);
     visualStudioToolStripExtender1.SetStyle(statusBar, version, theme);
 }
Esempio n. 23
0
        public override void Open(DockPanel panel, ThemeBase theme)
        {
            _patchView = new PatchView(theme);
            _patches   = GetPatches();
            _patchView.LoadPatches(_patches);
            _patchView.Show(panel, DockState.Document);

            _ftView = new FontTableView(theme);
            _data   = GetFontTable();
            _ftView.LoadFontTable(_data);
            _ftView.Show(panel, DockState.Document);

            base.Open(panel, theme);
        }
Esempio n. 24
0
        public static IconTheme GetIconTheme(this ThemeBase theme)
        {
            switch (theme)
            {
            case ThemeBase.Dark:
                return(new IconTheme("Dark", Color.FromRgb(16, 16, 17)));

            case ThemeBase.Light:
                return(new IconTheme("Light", Color.FromRgb(245, 245, 245)));

            default:
                return(default(IconTheme));
            }
        }
Esempio n. 25
0
        /// <summary>
        /// Get a text editor highlighting theme associated with the given WPF Theme Name.
        /// </summary>
        /// <param name="themeName"></param>
        /// <returns></returns>
        public HighlightingThemes GetTextEditorHighlighting(string themeName)
        {
            // Is this WPF theme configured with a highlighting theme???
            ThemeBase cfg = null;

            this.mTextEditorThemes.TryGetValue(themeName, out cfg);

            if (cfg != null)
            {
                return(cfg.HighlightingStyles);
            }

            return(null);
        }
Esempio n. 26
0
        public NewProjectSettings(ThemeBase theme, IList <Core.Entities.IGame> games) : this()
        {
            dockPanel1.Theme = theme;

            _games = games.OrderBy(x => x.Name).ToList();

            foreach (var game in _games)
            {
                var projectId = game.Id;
                imlGame.Images.Add(projectId, game.Icon);
                lvGame.Items.Add(projectId, game.Name, projectId);
            }

            lvGame.Items[0].Selected = true;
        }
Esempio n. 27
0
        /// <inheritdoc />
        public SingleViewPerspective()
        {
            iDockPanel = new PerspectiveDockPanel {
                Margin = new Padding(0)
            };

            // Apply current theme
            ThemeBase theme = GetTheme();

            theme.ApplyTo(iDockPanel);
            theme.ApplyTo(iDockPanel);
            theme.ApplyToToolStripManager();

            // ReSharper disable once VirtualMemberCallInConstructor
            ConfigureDockPanel(iDockPanel);
        }
            public VS2012PaneIndicator(ThemeBase theme)
            {
                _bitmapPaneDiamond             = theme.ImageService.Dockindicator_PaneDiamond;
                _bitmapPaneDiamondLeft         = theme.ImageService.Dockindicator_PaneDiamond_Fill;
                _bitmapPaneDiamondRight        = theme.ImageService.Dockindicator_PaneDiamond_Fill;
                _bitmapPaneDiamondTop          = theme.ImageService.Dockindicator_PaneDiamond_Fill;
                _bitmapPaneDiamondBottom       = theme.ImageService.Dockindicator_PaneDiamond_Fill;
                _bitmapPaneDiamondFill         = theme.ImageService.Dockindicator_PaneDiamond_Fill;
                _bitmapPaneDiamondHotSpot      = theme.ImageService.Dockindicator_PaneDiamond_Hotspot;
                _bitmapPaneDiamondHotSpotIndex = theme.ImageService.DockIndicator_PaneDiamond_HotspotIndex;
                _displayingGraphicsPath        = DrawHelper.CalculateGraphicsPathFromBitmap(_bitmapPaneDiamond);

                SizeMode = PictureBoxSizeMode.AutoSize;
                Image    = _bitmapPaneDiamond;
                Region   = new Region(DisplayingGraphicsPath);
            }
Esempio n. 29
0
        public override void SetTheme(ThemeBase theme)
        {
            base.SetTheme(theme);

            var txtback = SystemColors.Window;
            var indback = Color.WhiteSmoke;

            if (theme is VS2015DarkTheme)
            {
                txtback = theme.ColorPalette.MainWindowActive.Background;
                indback = theme.ColorPalette.MainWindowActive.Background;
            }

            ProjectManifestTextBox.BackColor       = txtback;
            ProjectManifestTextBox.IndentBackColor = indback;
        }
            public VS2012PanelIndicator(DockStyle dockStyle, ThemeBase theme)
            {
                _imagePanelLeft         = theme.ImageService.DockIndicator_PanelLeft;
                _imagePanelRight        = theme.ImageService.DockIndicator_PanelRight;
                _imagePanelTop          = theme.ImageService.DockIndicator_PanelTop;
                _imagePanelBottom       = theme.ImageService.DockIndicator_PanelBottom;
                _imagePanelFill         = theme.ImageService.DockIndicator_PanelFill;
                _imagePanelLeftActive   = theme.ImageService.DockIndicator_PanelLeft;
                _imagePanelRightActive  = theme.ImageService.DockIndicator_PanelRight;
                _imagePanelTopActive    = theme.ImageService.DockIndicator_PanelTop;
                _imagePanelBottomActive = theme.ImageService.DockIndicator_PanelBottom;
                _imagePanelFillActive   = theme.ImageService.DockIndicator_PanelFill;

                DockStyle = dockStyle;
                SizeMode  = PictureBoxSizeMode.AutoSize;
                Image     = ImageInactive;
            }