Example #1
0
 private void LoadColorTheme(ColorTheme t)
 {
     BackColor                = t.GetColor("room-editor/background");
     ForeColor                = t.GetColor("room-editor/foreground");
     mainFrame.BackColor      = t.GetColor("room-editor/box/background");
     mainFrame.ForeColor      = t.GetColor("room-editor/box/foreground");
     bufferedPanel1.BackColor = mainFrame.BackColor;
     bufferedPanel1.ForeColor = mainFrame.ForeColor;
     btnChangeImage.BackColor = t.GetColor("room-editor/btn-change-image/background");
     btnChangeImage.ForeColor = t.GetColor("room-editor/btn-change-image/foreground");
     btnChangeImage.FlatStyle = (FlatStyle)t.GetInt("room-editor/btn-change-image/flat/style");
     btnChangeImage.FlatAppearance.BorderSize  = t.GetInt("room-editor/btn-change-image/flat/border/size");
     btnChangeImage.FlatAppearance.BorderColor = t.GetColor("room-editor/btn-change-image/flat/border/color");
     btnDelete.BackColor = t.GetColor("room-editor/btn-delete/background");
     btnDelete.ForeColor = t.GetColor("room-editor/btn-delete/foreground");
     btnDelete.FlatStyle = (FlatStyle)t.GetInt("room-editor/btn-delete/flat/style");
     btnDelete.FlatAppearance.BorderSize  = t.GetInt("room-editor/btn-delete/flat/border/size");
     btnDelete.FlatAppearance.BorderColor = t.GetColor("room-editor/btn-delete/flat/border/color");
     btnExport.BackColor = t.GetColor("room-editor/btn-export/background");
     btnExport.ForeColor = t.GetColor("room-editor/btn-export/foreground");
     btnExport.FlatStyle = (FlatStyle)t.GetInt("room-editor/btn-export/flat/style");
     btnExport.FlatAppearance.BorderSize  = t.GetInt("room-editor/btn-export/flat/border/size");
     btnExport.FlatAppearance.BorderColor = t.GetColor("room-editor/btn-export/flat/border/color");
     _editAddressBar.BackColor            = t.GetColor("room-editor/combo-view-type/background");
     _editAddressBar.ForeColor            = t.GetColor("room-editor/combo-view-type/foreground");
     _editAddressBar.DropDownBackColor    = t.GetColor("room-editor/combo-view-type/drop-down/background");
     _editAddressBar.DropDownForeColor    = t.GetColor("room-editor/combo-view-type/drop-down/foreground");
     mainFrame.Controls.Remove(cmbBackgrounds);
     cmbBackgrounds = t.GetComboBox("room-editor/combo-backgrounds", cmbBackgrounds);
     cmbBackgrounds.SelectedIndexChanged += cmbBackgrounds_SelectedIndexChanged;
     mainFrame.Controls.Add(cmbBackgrounds);
 }
Example #2
0
 public void LoadColorTheme(ColorTheme t)
 {
     BackColor             = t.GetColor("project-panel/background");
     projectTree.BackColor = t.GetColor("project-panel/project-tree/background");
     projectTree.ForeColor = t.GetColor("project-panel/project-tree/foreground");
     projectTree.LineColor = t.GetColor("project-panel/project-tree/line");
 }
Example #3
0
 private void LoadColorTheme(ColorTheme t)
 {
     BackColor = t.GetColor("cursor-editor/background");
     ForeColor = t.GetColor("cursor-editor/foreground");
     currentItemGroupBox.BackColor = t.GetColor("cursor-editor/box/background");
     currentItemGroupBox.ForeColor = t.GetColor("cursor-editor/box/foreground");
 }
Example #4
0
 private void LoadColorTheme(ColorTheme t)
 {
     btnNewFrame.BackColor = t.GetColor("view-editor/btn-new-frame/background");
     btnNewFrame.ForeColor = t.GetColor("view-editor/btn-new-frame/foreground");
     btnNewFrame.FlatStyle = (FlatStyle)t.GetInt("view-editor/btn-new-frame/flat/style");
     btnNewFrame.FlatAppearance.BorderSize  = t.GetInt("view-editor/btn-new-frame/flat/border/size");
     btnNewFrame.FlatAppearance.BorderColor = t.GetColor("view-editor/btn-new-frame/flat/border/color");
 }
Example #5
0
 private void LoadColorTheme(ColorTheme t)
 {
     panel1.BackColor = t.GetColor("script-editor/background");
     panel1.ForeColor = t.GetColor("script-editor/foreground");
     panel1.Controls.Remove(cmbFunctions);
     cmbFunctions = t.GetComboBox("script-editor/combo-functions", cmbFunctions);
     panel1.Controls.Add(cmbFunctions);
     cmbFunctions.SelectedIndexChanged += cmbFunctions_SelectedIndexChanged;
     cmbFunctions.MouseEnter           += cmbFunctions_MouseEnter;
     cmbFunctions.MouseLeave           += cmbFunctions_MouseLeave;
 }
Example #6
0
 private void LoadColorTheme(ColorTheme t)
 {
     mainGroupBox.BackColor = t.GetColor("view-preview/background");
     mainGroupBox.ForeColor = t.GetColor("view-preview/foreground");
     udLoop.BackColor       = t.GetColor("view-preview/numeric-loop/background");
     udLoop.ForeColor       = t.GetColor("view-preview/numeric-loop/foreground");
     udFrame.BackColor      = t.GetColor("view-preview/numeric-frame/background");
     udFrame.ForeColor      = t.GetColor("view-preview/numeric-frame/foreground");
     udDelay.BackColor      = t.GetColor("view-preview/numeric-delay/background");
     udDelay.ForeColor      = t.GetColor("view-preview/numeric-delay/foreground");
 }
Example #7
0
 private void LoadColorTheme(ColorTheme t)
 {
     BackColor = t.GetColor("inventory-editor/background");
     ForeColor = t.GetColor("inventory-editor/foreground");
     currentItemGroupBox.BackColor = t.GetColor("inventory-editor/current-item-box/background");
     currentItemGroupBox.ForeColor = t.GetColor("inventory-editor/current-item-box/foreground");
     groupBox1.BackColor           = t.GetColor("inventory-editor/left-box/background");
     groupBox1.ForeColor           = t.GetColor("inventory-editor/left-box/foreground");
     groupBox2.BackColor           = t.GetColor("inventory-editor/right-box/background");
     groupBox2.ForeColor           = t.GetColor("inventory-editor/right-box/foreground");
 }
Example #8
0
        public void Load()
        {
            if (!Directory.Exists(DiskDir))
            {
                Directory.CreateDirectory(DiskDir);
            }

            _themes.Clear();
            _themes.Add(ColorThemeStub.DEFAULT);
            Directory.GetFiles(DiskDir, "*.json").ToList().ForEach(f => _themes.Add(new ColorThemeJson(Path.GetFileNameWithoutExtension(f), f)));
            Current = _themes.FirstOrDefault(t => t.Name == Factory.AGSEditor.Settings.ColorTheme) ?? ColorThemeStub.DEFAULT;
        }
Example #9
0
 private void LoadColorTheme(ColorTheme t)
 {
     BackColor = t.GetColor("general-settings/background");
     ForeColor = t.GetColor("general-settings/foreground");
     propertyGrid.BackColor         = t.GetColor("general-settings/property-grid/background");
     propertyGrid.LineColor         = t.GetColor("general-settings/property-grid/line");
     propertyGrid.CategoryForeColor = t.GetColor("general-settings/property-grid/category-fore");
     propertyGrid.ViewBackColor     = t.GetColor("general-settings/property-grid/view/background");
     propertyGrid.ViewForeColor     = t.GetColor("general-settings/property-grid/view/foreground");
     propertyGrid.HelpBackColor     = t.GetColor("general-settings/property-grid/help/background");
     propertyGrid.HelpForeColor     = t.GetColor("general-settings/property-grid/help/foreground");
 }
Example #10
0
 private void LoadColorTheme(ColorTheme t)
 {
     BackColor               = t.GetColor("character-editor/background");
     ForeColor               = t.GetColor("character-editor/foreground");
     groupBox1.BackColor     = t.GetColor("character-editor/box/background");
     groupBox1.ForeColor     = t.GetColor("character-editor/box/foreground");
     btnMakePlayer.BackColor = t.GetColor("character-editor/btn-make/background");
     btnMakePlayer.ForeColor = t.GetColor("character-editor/btn-make/foreground");
     btnMakePlayer.FlatStyle = (FlatStyle)t.GetInt("character-editor/btn-make/flat/style");
     btnMakePlayer.FlatAppearance.BorderSize  = t.GetInt("character-editor/btn-make/flat/border/size");
     btnMakePlayer.FlatAppearance.BorderColor = t.GetColor("character-editor/btn-make/flat/border/color");
 }
Example #11
0
 private void LoadColorTheme(ColorTheme t)
 {
     BackColor = t.GetColor("font-editor/background");
     ForeColor = t.GetColor("font-editor/foreground");
     currentItemGroupBox.BackColor            = t.GetColor("font-editor/box/background");
     currentItemGroupBox.ForeColor            = t.GetColor("font-editor/box/foreground");
     btnImportFont.BackColor                  = t.GetColor("font-editor/btn-import/background");
     btnImportFont.ForeColor                  = t.GetColor("font-editor/btn-import/foreground");
     btnImportFont.FlatStyle                  = (FlatStyle)t.GetInt("font-editor/btn-import/flat/style");
     btnImportFont.FlatAppearance.BorderSize  = t.GetInt("font-editor/btn-import/flat/border/size");
     btnImportFont.FlatAppearance.BorderColor = t.GetColor("font-editor/btn-import/flat/border/color");
 }
Example #12
0
 private void LoadColorTheme(ColorTheme t)
 {
     BackColor                = t.GetColor("welcome/background");
     ForeColor                = t.GetColor("welcome/foreground");
     panel1.BackColor         = t.GetColor("welcome/panel1/background");
     panel1.ForeColor         = t.GetColor("welcome/panel1/foreground");
     panel2.BackColor         = t.GetColor("welcome/panel2/background");
     panel2.ForeColor         = t.GetColor("welcome/panel2/foreground");
     pnlTipOfTheDay.BackColor = t.GetColor("welcome/pnlTipOfTheDay/background");
     pnlTipOfTheDay.ForeColor = t.GetColor("welcome/pnlTipOfTheDay/foreground");
     pnlRight.BackColor       = t.GetColor("welcome/pnlRight/background");
     pnlRight.ForeColor       = t.GetColor("welcome/pnlRight/foreground");
 }
Example #13
0
 private void LoadColorTheme(ColorTheme t)
 {
     Controls.Remove(propertyObjectCombo);
     propertyObjectCombo = t.GetComboBox("properties-panel/combobox", propertyObjectCombo);
     Controls.Add(propertyObjectCombo);
     propertiesGrid.BackColor         = t.GetColor("properties-panel/grid/background");
     propertiesGrid.ViewBackColor     = t.GetColor("properties-panel/grid/view/background");
     propertiesGrid.ViewForeColor     = t.GetColor("properties-panel/grid/view/foreground");
     propertiesGrid.LineColor         = t.GetColor("properties-panel/grid/line");
     propertiesGrid.CategoryForeColor = t.GetColor("properties-panel/grid/category");
     propertiesGrid.HelpBackColor     = t.GetColor("properties-panel/grid/help/background");
     propertiesGrid.HelpForeColor     = t.GetColor("properties-panel/grid/help/foreground");
 }
Example #14
0
        private void cmbColorTheme_SelectedIndexChanged(object sender, EventArgs e)
        {
            ColorTheme newColorTheme = (ColorTheme)cmbColorTheme.SelectedItem;

            if (newColorTheme == null)
            {
                return;
            }

            if (_settings.ColorTheme != newColorTheme.Name)
            {
                _settings.ColorTheme = newColorTheme.Name;
            }
        }
Example #15
0
 public ToolStripColorTable(ColorTheme theme, string root)
 {
     ToolStripGradientBegin       = theme.GetColor(root + "/gradient/begin");
     ToolStripGradientMiddle      = theme.GetColor(root + "/gradient/middle");
     ToolStripGradientEnd         = theme.GetColor(root + "/gradient/end");
     ToolStripBorder              = theme.GetColor(root + "/border");
     SeparatorLight               = theme.GetColor(root + "/separator");
     OverflowButtonGradientBegin  = theme.GetColor(root + "/overflow-gradient/begin");
     OverflowButtonGradientMiddle = theme.GetColor(root + "/overflow-gradient/middle");
     OverflowButtonGradientEnd    = theme.GetColor(root + "/overflow-gradient/end");
     ButtonSelectedGradientBegin  = theme.GetColor(root + "/selected-gradient/begin");
     ButtonSelectedGradientEnd    = theme.GetColor(root + "/selected-gradient/end");
     GripLight = theme.GetColor(root + "/grip/light");
     GripDark  = theme.GetColor(root + "/grip/dark");
 }
Example #16
0
 private void LoadColorTheme(ColorTheme t)
 {
     BackColor = t.GetColor("dialog-editor/background");
     ForeColor = t.GetColor("dialog-editor/foreground");
     btnDeleteOption.BackColor = t.GetColor("dialog-editor/btn-delete-option/background");
     btnDeleteOption.ForeColor = t.GetColor("dialog-editor/btn-delete-option/foreground");
     btnDeleteOption.FlatStyle = (FlatStyle)t.GetInt("dialog-editor/btn-delete-option/flat/style");
     btnDeleteOption.FlatAppearance.BorderSize  = t.GetInt("dialog-editor/btn-delete-option/flat/border/size");
     btnDeleteOption.FlatAppearance.BorderColor = t.GetColor("dialog-editor/btn-delete-option/flat/border/color");
     btnNewOption.BackColor = t.GetColor("dialog-editor/btn-new-option/background");
     btnNewOption.ForeColor = t.GetColor("dialog-editor/btn-new-option/foreground");
     btnNewOption.FlatStyle = (FlatStyle)t.GetInt("dialog-editor/btn-new-option/flat/style");
     btnNewOption.FlatAppearance.BorderSize  = t.GetInt("dialog-editor/btn-new-option/flat/border/size");
     btnNewOption.FlatAppearance.BorderColor = t.GetColor("dialog-editor/btn-new-option/flat/border/color");
 }
Example #17
0
 public void Init()
 {
     try
     {
         Current.Init();
     }
     catch (Exception e)
     {
         Factory.GUIController.ShowMessage(
             $"Something went wrong when loading color theme {Current.Name}. The editor " +
             $"will set the color them back to the default them and continue as normal. " +
             $"See stack trace for more details.\n\n{e}",
             MessageBoxIcon.Warning);
         Current = ColorThemeStub.DEFAULT;
     }
 }
Example #18
0
        public void LoadColorTheme(ColorTheme t)
        {
            BackColor = t.GetColor("lip-sync-editor/background");
            ForeColor = t.GetColor("lip-sync-editor/foreground");

            foreach (Control control in Controls)
            {
                TextBox textBox = control as TextBox;

                if (textBox != null)
                {
                    textBox.BackColor   = t.GetColor("lip-sync-editor/text-boxes/background");
                    textBox.ForeColor   = t.GetColor("lip-sync-editor/text-boxes/foreground");
                    textBox.BorderStyle = (BorderStyle)t.GetInt("lip-sync-editor/text-boxes/border-style");
                }
            }
        }
Example #19
0
        public ComboBoxCustom(ColorTheme theme, string root, ComboBox original)
        {
            _theme = theme;
            _root  = root;

            Dock              = original.Dock;
            DropDownStyle     = original.DropDownStyle;
            FormattingEnabled = original.FormattingEnabled;
            Location          = original.Location;
            MaxDropDownItems  = original.MaxDropDownItems;
            Name              = original.Name;
            Size              = original.Size;
            TabIndex          = original.TabIndex;

            foreach (var i in original.Items)
            {
                Items.Add(i);
            }
        }
Example #20
0
 private void LoadColorTheme(ColorTheme t)
 {
     lvwResults.BackColor = t.GetColor("find-results-panel/background");
     lvwResults.ForeColor = t.GetColor("find-results-panel/foreground");
     lvwResults.OwnerDraw = t.GetBool("find-results-panel/owner-draw");
     lvwResults.GridLines = t.GetBool("find-results-panel/grid-lines");
     lvwResults.Layout   += (s, a) =>
     {
         lvwResults.Columns[lvwResults.Columns.Count - 1].Width = t.GetInt("find-results-panel/last-column-width");
     };
     lvwResults.DrawItem         += (s, a) => a.DrawDefault = t.GetBool("find-results-panel/draw-item");
     lvwResults.DrawSubItem      += (s, a) => a.DrawDefault = t.GetBool("find-results-panel/draw-sub-item");
     lvwResults.DrawColumnHeader += (s, a) =>
     {
         a.Graphics.FillRectangle(new SolidBrush(t.GetColor("find-results-panel/column-header/background")), a.Bounds);
         a.Graphics.DrawString(a.Header.Text, lvwResults.Font, new SolidBrush(t.GetColor("find-results-panel/column-header/foreground")), a.Bounds.X + 5, a.Bounds.Y + a.Bounds.Size.Height / 5);
         a.Graphics.DrawRectangle(new Pen(new SolidBrush(t.GetColor("find-results-panel/column-header/border"))), a.Bounds.X - 1, a.Bounds.Y - 1, a.Bounds.Size.Width, a.Bounds.Size.Height);
     };
 }
Example #21
0
        private void LoadColorTheme(ColorTheme t)
        {
            BackColor = t.GetColor("background");
            mainContainer.DockBackColor = t.GetColor("main-container/dock-background");
            mainContainer.BackColor     = t.GetColor("main-container/background");
            mainContainer.ForeColor     = t.GetColor("main-container/foreground");
            mainContainer.Skin.AutoHideStripSkin.TabGradient.StartColor       = t.GetColor("main-container/skin/auto-hide/tab-gradient/start");
            mainContainer.Skin.AutoHideStripSkin.TabGradient.EndColor         = t.GetColor("main-container/skin/auto-hide/tab-gradient/end");
            mainContainer.Skin.AutoHideStripSkin.TabGradient.TextColor        = t.GetColor("main-container/skin/auto-hide/tab-gradient/text");
            mainContainer.Skin.AutoHideStripSkin.DockStripGradient.StartColor = t.GetColor("main-container/skin/auto-hide/dock-strip-gradient/start");
            mainContainer.Skin.AutoHideStripSkin.DockStripGradient.EndColor   = t.GetColor("main-container/skin/auto-hide/dock-strip-gradient/end");
            mainContainer.Skin.DockPaneStripSkin.DocumentGradient.DockStripGradient.StartColor         = t.GetColor("main-container/skin/dock-pane/document-gradient/dock-strip-gradient/start");
            mainContainer.Skin.DockPaneStripSkin.DocumentGradient.DockStripGradient.EndColor           = t.GetColor("main-container/skin/dock-pane/document-gradient/dock-strip-gradient/end");
            mainContainer.Skin.DockPaneStripSkin.DocumentGradient.ActiveTabGradient.StartColor         = t.GetColor("main-container/skin/dock-pane/document-gradient/active-tab-gradient/start");
            mainContainer.Skin.DockPaneStripSkin.DocumentGradient.ActiveTabGradient.EndColor           = t.GetColor("main-container/skin/dock-pane/document-gradient/active-tab-gradient/end");
            mainContainer.Skin.DockPaneStripSkin.DocumentGradient.ActiveTabGradient.TextColor          = t.GetColor("main-container/skin/dock-pane/document-gradient/active-tab-gradient/text");
            mainContainer.Skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.StartColor       = t.GetColor("main-container/skin/dock-pane/document-gradient/inactive-tab-gradient/start");
            mainContainer.Skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.EndColor         = t.GetColor("main-container/skin/dock-pane/document-gradient/inactive-tab-gradient/end");
            mainContainer.Skin.DockPaneStripSkin.DocumentGradient.InactiveTabGradient.TextColor        = t.GetColor("main-container/skin/dock-pane/document-gradient/inactive-tab-gradient/text");
            mainContainer.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.StartColor   = t.GetColor("main-container/skin/dock-pane/tool-window/active-caption-gradient/start");
            mainContainer.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.EndColor     = t.GetColor("main-container/skin/dock-pane/tool-window/active-caption-gradient/end");
            mainContainer.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveCaptionGradient.TextColor    = t.GetColor("main-container/skin/dock-pane/tool-window/active-caption-gradient/text");
            mainContainer.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.StartColor = t.GetColor("main-container/skin/dock-pane/tool-window/inactive-caption-gradient/start");
            mainContainer.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.EndColor   = t.GetColor("main-container/skin/dock-pane/tool-window/inactive-caption-gradient/end");
            mainContainer.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveCaptionGradient.TextColor  = t.GetColor("main-container/skin/dock-pane/tool-window/inactive-caption-gradient/text");
            mainContainer.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveTabGradient.StartColor       = t.GetColor("main-container/skin/dock-pane/tool-window/active-tab-gradient/start");
            mainContainer.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveTabGradient.EndColor         = t.GetColor("main-container/skin/dock-pane/tool-window/active-tab-gradient/end");
            mainContainer.Skin.DockPaneStripSkin.ToolWindowGradient.ActiveTabGradient.TextColor        = t.GetColor("main-container/skin/dock-pane/tool-window/active-tab-gradient/text");
            mainContainer.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveTabGradient.StartColor     = t.GetColor("main-container/skin/dock-pane/tool-window/inactive-tab-gradient/start");
            mainContainer.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveTabGradient.EndColor       = t.GetColor("main-container/skin/dock-pane/tool-window/inactive-tab-gradient/end");
            mainContainer.Skin.DockPaneStripSkin.ToolWindowGradient.InactiveTabGradient.TextColor      = t.GetColor("main-container/skin/dock-pane/tool-window/inactive-tab-gradient/text");
            mainContainer.Skin.DockPaneStripSkin.ToolWindowGradient.DockStripGradient.StartColor       = t.GetColor("main-container/skin/dock-pane/tool-window/dock-strip-gradient/start");
            mainContainer.Skin.DockPaneStripSkin.ToolWindowGradient.DockStripGradient.EndColor         = t.GetColor("main-container/skin/dock-pane/tool-window/dock-strip-gradient/end");

            mainMenu.BackColor = t.GetColor("main-menu/background");
            mainMenu.Renderer  = t.GetMainMenuRenderer("main-menu");
            mainMenu.Renderer.RenderItemText  += (s, a) => a.ToolStrip.ForeColor = t.GetColor("main-menu/foreground");
            mainMenu.Renderer.RenderItemCheck += (s, a) => a.Graphics.DrawImage(t.GetImage("main-menu/check/foreground", a.Image), a.ImageRectangle);
            toolStrip.BackColor   = t.GetColor("tool-bar/background");
            toolStrip.Renderer    = t.GetToolStripRenderer("tool-bar");
            statusStrip.BackColor = t.GetColor("status-strip/background");
        }
Example #22
0
 public MainMenuColorTable(ColorTheme theme, string root)
 {
     MenuBorder                    = theme.GetColor(root + "/border");
     CheckBackground               = theme.GetColor(root + "/check/background");
     ButtonSelectedBorder          = theme.GetColor(root + "/check/border");
     ImageMarginGradientBegin      = theme.GetColor(root + "/margin/gradient/begin");
     ImageMarginGradientMiddle     = theme.GetColor(root + "/margin/gradient/middle");
     ImageMarginGradientEnd        = theme.GetColor(root + "/margin/gradient/end");
     MenuItemBorder                = theme.GetColor(root + "/item/border");
     ToolStripDropDownBackground   = theme.GetColor(root + "/background-dropdown");
     MenuItemSelected              = theme.GetColor(root + "/item/selected");
     MenuItemSelectedGradientBegin = theme.GetColor(root + "/selected/gradient/begin");
     MenuItemSelectedGradientEnd   = theme.GetColor(root + "/selected/gradient/end");
     MenuItemPressedGradientBegin  = theme.GetColor(root + "/pressed/gradient/begin");
     MenuItemPressedGradientMiddle = theme.GetColor(root + "/pressed/gradient/middle");
     MenuItemPressedGradientEnd    = theme.GetColor(root + "/pressed/gradient/end");
     SeparatorDark                 = theme.GetColor(root + "/separator");
     CheckSelectedBackground       = theme.GetColor(root + "/check/selected");
     CheckPressedBackground        = theme.GetColor(root + "/check/pressed");
 }
Example #23
0
 public void Apply(Action <ColorTheme> apply)
 {
     if (!IsCurrentDefault)
     {
         try
         {
             apply.Invoke(Current);
         }
         catch (Exception e)
         {
             Factory.GUIController.ShowMessage(
                 $"Something went wrong when trying to apply color theme {Current}. " +
                 $"The editor will set the color theme back to the default theme and continue " +
                 $"as normal, however it may not look right until the next time you restart " +
                 $"the editor. See stack trace for more details.\n\n{e}",
                 MessageBoxIcon.Warning);
             Current = ColorThemeStub.DEFAULT;
         }
     }
 }
Example #24
0
 private void LoadColorTheme(ColorTheme t)
 {
     BackColor           = t.GetColor("global-variables-editor/background");
     ForeColor           = t.GetColor("global-variables-editor/foreground");
     mainFrame.BackColor = t.GetColor("global-variables-editor/box/background");
     mainFrame.ForeColor = t.GetColor("global-variables-editor/box/foreground");
     lvwWords.BackColor  = t.GetColor("global-variables-editor/list/background");
     lvwWords.ForeColor  = t.GetColor("global-variables-editor/list/foreground");
     lvwWords.OwnerDraw  = t.GetBool("global-variables-editor/list/owner-draw");
     lvwWords.GridLines  = t.GetBool("global-variables-editor/list/grid-lines");
     lvwWords.Layout    += (s, a) =>
     {
         lvwWords.Columns[lvwWords.Columns.Count - 1].Width = t.GetInt("global-variables-editor/list/last-column-width");
     };
     lvwWords.DrawItem         += (s, a) => a.DrawDefault = t.GetBool("global-variables-editor/list/draw-item");
     lvwWords.DrawSubItem      += (s, a) => a.DrawDefault = t.GetBool("global-variables-editor/list/draw-sub-item");
     lvwWords.DrawColumnHeader += (s, a) =>
     {
         a.Graphics.FillRectangle(new SolidBrush(t.GetColor("global-variables-editor/list/column-header/background")), a.Bounds);
         a.Graphics.DrawString(a.Header.Text, lvwWords.Font, new SolidBrush(t.GetColor("global-variables-editor/list/column-header/foreground")), a.Bounds.X + 5, a.Bounds.Y + a.Bounds.Size.Height / 5);
         a.Graphics.DrawRectangle(new Pen(new SolidBrush(t.GetColor("global-variables-editor/list/column-header/border"))), a.Bounds.X - 1, a.Bounds.Y - 1, a.Bounds.Size.Width, a.Bounds.Size.Height);
     };
 }
Example #25
0
        private void LoadColorTheme(ColorTheme t)
        {
            BackColor                = t.GetColor("welcome/background");
            ForeColor                = t.GetColor("welcome/foreground");
            panel1.BackColor         = t.GetColor("welcome/panel1/background");
            panel1.ForeColor         = t.GetColor("welcome/panel1/foreground");
            panel2.BackColor         = t.GetColor("welcome/panel2/background");
            panel2.ForeColor         = t.GetColor("welcome/panel2/foreground");
            pnlTipOfTheDay.BackColor = t.GetColor("welcome/pnlTipOfTheDay/background");
            pnlTipOfTheDay.ForeColor = t.GetColor("welcome/pnlTipOfTheDay/foreground");
            pnlRight.BackColor       = t.GetColor("welcome/pnlRight/background");
            pnlRight.ForeColor       = t.GetColor("welcome/pnlRight/foreground");

            // [ivan-mogilko] had to do this try/catch hack for new entries
            // because ColorTheme methods do not have fallback mechanism atm
            try
            {
                Color linkColor = t.GetColor("welcome/panel2/link");
                foreach (LinkLabel link in panel2.Controls.OfType <LinkLabel>())
                {
                    link.LinkColor = linkColor;
                }
                linkColor = t.GetColor("welcome/pnlTipOfTheDay/link");
                foreach (LinkLabel link in pnlTipOfTheDay.Controls.OfType <LinkLabel>())
                {
                    link.LinkColor = linkColor;
                }
                linkColor = t.GetColor("welcome/pnlRight/link");
                foreach (LinkLabel link in pnlRight.Controls.OfType <LinkLabel>())
                {
                    link.LinkColor = linkColor;
                }
            }
            catch (Exception)
            {
            }
        }
Example #26
0
 private void LoadColorTheme(ColorTheme t)
 {
     BackColor = t.GetColor("audio-editor/background");
     ForeColor = t.GetColor("audio-editor/foreground");
     grpAudioType.BackColor              = t.GetColor("audio-editor/audio-type/background");
     grpAudioType.ForeColor              = t.GetColor("audio-editor/audio-type/foreground");
     grpAudioClip.BackColor              = t.GetColor("audio-editor/audio-clip-box/background");
     grpAudioClip.ForeColor              = t.GetColor("audio-editor/audio-clip-box/foreground");
     btnPlay.BackColor                   = t.GetColor("audio-editor/btn-play/background");
     btnPlay.ForeColor                   = t.GetColor("audio-editor/btn-play/foreground");
     btnPlay.FlatStyle                   = (FlatStyle)t.GetInt("audio-editor/btn-play/flat/style");
     btnPlay.FlatAppearance.BorderSize   = t.GetInt("audio-editor/btn-play/flat/border/size");
     btnPlay.FlatAppearance.BorderColor  = t.GetColor("audio-editor/btn-play/flat/border/color");
     btnPause.BackColor                  = t.GetColor("audio-editor/btn-pause/background");
     btnPause.ForeColor                  = t.GetColor("audio-editor/btn-pause/foreground");
     btnPause.FlatStyle                  = (FlatStyle)t.GetInt("audio-editor/btn-pause/flat/style");
     btnPause.FlatAppearance.BorderSize  = t.GetInt("audio-editor/btn-pause/flat/border/size");
     btnPause.FlatAppearance.BorderColor = t.GetColor("audio-editor/btn-pause/flat/border/color");
     btnStop.BackColor                   = t.GetColor("audio-editor/btn-stop/background");
     btnStop.ForeColor                   = t.GetColor("audio-editor/btn-stop/foreground");
     btnStop.FlatStyle                   = (FlatStyle)t.GetInt("audio-editor/btn-stop/flat/style");
     btnStop.FlatAppearance.BorderSize   = t.GetInt("audio-editor/btn-stop/flat/border/size");
     btnStop.FlatAppearance.BorderColor  = t.GetColor("audio-editor/btn-stop/flat/border/color");
 }
Example #27
0
        private void LoadColorTheme(ColorTheme t)
        {
            BackColor = t.GetColor("palette/background");
            ForeColor = t.GetColor("palette/foreground");
            colourFinderPage.BackColor  = t.GetColor("palette/color-finder/background");
            colourFinderPage.ForeColor  = t.GetColor("palette/color-finder/foreground");
            palettePage.BackColor       = t.GetColor("palette/palette-page/background");
            palettePage.ForeColor       = t.GetColor("palette/palette-page/foreground");
            groupBox1.BackColor         = t.GetColor("palette/color-finder/background");
            groupBox1.ForeColor         = t.GetColor("palette/color-finder/foreground");
            txtColourNumber.BackColor   = t.GetColor("palette/color-finder/color-number-box/background");
            txtColourNumber.ForeColor   = t.GetColor("palette/color-finder/color-number-box/foreground");
            txtColourNumber.BorderStyle = (BorderStyle)t.GetInt("palette/color-finder/color-number-box/border-style");
            btnColorDialog.BackColor    = t.GetColor("palette/color-finder/btn-color-dialog/background");
            btnColorDialog.ForeColor    = t.GetColor("palette/color-finder/btn-color-dialog/foreground");
            btnColorDialog.FlatStyle    = (FlatStyle)t.GetInt("palette/color-finder/btn-color-dialog/flat/style");
            btnColorDialog.FlatAppearance.BorderSize  = t.GetInt("palette/color-finder/btn-color-dialog/flat/border/size");
            btnColorDialog.FlatAppearance.BorderColor = t.GetColor("palette/color-finder/btn-color-dialog/flat/border/color");
            groupBox2.BackColor  = t.GetColor("palette/palette-page/background");
            groupBox2.ForeColor  = t.GetColor("palette/palette-page/foreground");
            tabControl.DrawMode  = (TabDrawMode)t.GetInt("palette/draw-mode");
            tabControl.DrawItem += (s, a) =>
            {
                if (a.Index == tabControl.SelectedIndex)
                {
                    a.Graphics.FillRectangle(new SolidBrush(t.GetColor("palette/draw-item/background/selected")), a.Bounds);
                }
                else
                {
                    a.Graphics.Clear(t.GetColor("palette/draw-item/background/not-selected"));
                }

                TabPage tab = tabControl.TabPages[a.Index];
                a.Graphics.DrawString(tab.Text, tab.Font, new SolidBrush(t.GetColor("palette/draw-item/foreground")), a.Bounds.X, a.Bounds.Y + 5);
            };
        }
Example #28
0
 private void LoadColorTheme(ColorTheme t)
 {
     BackColor = t.GetColor("gui-editor/background");
     ForeColor = t.GetColor("gui-editor/foreground");
 }