private void ImageSetup() { var t = (int)Math.Round(48 * _gradientLibraryImageScale * ScalingTools.GetScaleFactor()); _imageSize = new Size(t, t); _newFontSize = new Font(Font.FontFamily.Name, (int)(7 * _gradientLibraryTextScale), Font.Style); short sideGap = (short)(_imageSize.Width + (5 * ScalingTools.GetScaleFactor())); short topGap = (short)(_imageSize.Height + 5 + ScalingTools.MeasureHeight(_newFontSize, "Test") * 2); ListViewItem_SetSpacing(listViewGradients, sideGap, topGap); }
public Form_ToolPalette(TimelineControl timelineControl) { InitializeComponent(); TimelineControl = timelineControl; Icon = Resources.Icon_Vixen3; ThemeUpdateControls.UpdateControls(this); toolStripColors.Renderer = new ThemeToolStripRenderer(); toolStripCurves.Renderer = new ThemeToolStripRenderer(); toolStripGradients.Renderer = new ThemeToolStripRenderer(); var t = (int)(48 * ScalingTools.GetScaleFactor()); _imageSize = new Size(t, t); int iconSize = (int)(16 * ScalingTools.GetScaleFactor()); toolStripCurves.ImageScalingSize = new Size(iconSize, iconSize); toolStripGradients.ImageScalingSize = new Size(iconSize, iconSize); toolStripColors.ImageScalingSize = new Size(iconSize, iconSize); toolStripButtonEditColor.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonEditColor.Image = Tools.GetIcon(Resources.configuration, iconSize); toolStripButtonNewColor.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonNewColor.Image = Tools.GetIcon(Resources.addItem, iconSize); toolStripButtonDeleteColor.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonDeleteColor.Image = Tools.GetIcon(Resources.delete_32, iconSize); toolStripButtonExportColors.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonExportColors.Image = Tools.GetIcon(Resources.folder_go, iconSize); toolStripButtonImportColors.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonImportColors.Image = Tools.GetIcon(Resources.folder_open, iconSize); toolStripButtonEditCurve.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonEditCurve.Image = Tools.GetIcon(Resources.configuration, iconSize); toolStripButtonNewCurve.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonNewCurve.Image = Tools.GetIcon(Resources.addItem, iconSize); toolStripButtonDeleteCurve.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonDeleteCurve.Image = Tools.GetIcon(Resources.delete_32, iconSize); toolStripButtonExportCurves.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonExportCurves.Image = Tools.GetIcon(Resources.folder_go, iconSize); toolStripButtonImportCurves.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonImportCurves.Image = Tools.GetIcon(Resources.folder_open, iconSize); toolStripButtonEditGradient.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonEditGradient.Image = Tools.GetIcon(Resources.configuration, iconSize); toolStripButtonNewGradient.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonNewGradient.Image = Tools.GetIcon(Resources.addItem, iconSize); toolStripButtonDeleteGradient.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonDeleteGradient.Image = Tools.GetIcon(Resources.delete_32, iconSize); toolStripButtonExportGradients.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonExportGradients.Image = Tools.GetIcon(Resources.folder_go, iconSize); toolStripButtonImportGradients.DisplayStyle = ToolStripItemDisplayStyle.Image; toolStripButtonImportGradients.Image = Tools.GetIcon(Resources.folder_open, iconSize); short sideGap = (short)(_imageSize.Width + (5 * ScalingTools.GetScaleFactor())); short topGap = (short)(_imageSize.Width + ScalingTools.MeasureHeight(Font, "Test") * 2); ListViewItem_SetSpacing(listViewColors, sideGap, sideGap); ListViewItem_SetSpacing(listViewCurves, sideGap, topGap); ListViewItem_SetSpacing(listViewGradients, sideGap, topGap); listViewColors.AllowDrop = true; listViewCurves.AllowDrop = true; listViewGradients.AllowDrop = true; ForeColor = ThemeColorTable.ForeColor; BackColor = ThemeColorTable.BackgroundColor; ThemeUpdateControls.UpdateControls(this); foreach (Control tab in tabControlEX1.TabPages) { tab.BackColor = ThemeColorTable.BackgroundColor; tab.ForeColor = ThemeColorTable.ForeColor; } tabControlEX1.SelectedTabColor = ThemeColorTable.BackgroundColor; tabControlEX1.TabColor = ThemeColorTable.BackgroundColor; tabControlEX1.SelectedTab = tabPageEX1; tabControlEX1.SizeMode = TabSizeMode.Fixed; SizeF size = ScalingTools.MeasureString(Font, "Gradientsss"); tabControlEX1.ItemSize = size.ToSize(); //Over-ride the auto theme listview back color listViewColors.BackColor = ThemeColorTable.BackgroundColor; listViewCurves.BackColor = ThemeColorTable.BackgroundColor; listViewGradients.BackColor = ThemeColorTable.BackgroundColor; }
private void LoadAvailableEffects() { int imageSize = (int)(18 * ScalingTools.GetScaleFactor()); effectTreeImages.ImageSize = new Size(imageSize, imageSize); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form_Effects)); effectTreeImages.ImageStream = ((ImageListStreamer)(resources.GetObject("effectTreeImages.ImageStream"))); effectTreeImages.TransparentColor = treeEffects.BackColor; effectTreeImages.Images.SetKeyName(0, "rightarrow.png"); effectTreeImages.Images.SetKeyName(1, "downarrow.png"); treeEffects.ItemHeight = (int)ScalingTools.MeasureHeight(treeEffects.Font, "My Text"); foreach ( IEffectModuleDescriptor effectDesriptor in ApplicationServices.GetModuleDescriptors <IEffectModuleInstance>().Cast <IEffectModuleDescriptor>()) { // Add the effects to the tree // Set default to basic to get rid of annoying possible null reference warning. if (effectDesriptor.EffectName == "Nutcracker") { continue; } TreeNode parentNode = treeEffects.Nodes["treeBasic"]; switch (effectDesriptor.EffectGroup) { case EffectGroups.Basic: parentNode = treeEffects.Nodes["treeBasic"]; break; case EffectGroups.Pixel: parentNode = treeEffects.Nodes["treeAdvanced"]; break; case EffectGroups.Device: parentNode = treeEffects.Nodes["treeDevice"]; break; } TreeNode node = new TreeNode(effectDesriptor.EffectName) { Tag = effectDesriptor.TypeId }; node.ForeColor = ThemeColorTable.ForeColor; parentNode.Nodes.Add(node); // Set the image Image image = effectDesriptor.GetRepresentativeImage(48, 48); if (image != null) { effectTreeImages.Images.Add(effectDesriptor.EffectName, image); node.ImageIndex = effectTreeImages.Images.Count - 1; node.SelectedImageIndex = node.ImageIndex; } else { SetNodeImage(node, "blank.png"); } if (treeEffects.Nodes.Count > 0) { treeEffects.CollapseAll(); treeEffects.Nodes[0].Expand(); treeEffects.Nodes[1].Expand(); } treeEffects.Nodes[0].EnsureVisible(); } }