Removed some redundant icons
Made touch scale the edit pencil icon.
This commit is contained in:
parent
0953cb6e51
commit
1afeb5166a
8 changed files with 81 additions and 13 deletions
|
|
@ -84,7 +84,7 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
void client_DownloadDataCompleted(object sender, DownloadDataCompletedEventArgs e)
|
||||
{
|
||||
try // if we get a bad result we can get a target ivocation exception. In that case just don't show anything
|
||||
try // if we get a bad result we can get a target invocation exception. In that case just don't show anything
|
||||
{
|
||||
byte[] raw = e.Result;
|
||||
Stream stream = new MemoryStream(raw);
|
||||
|
|
@ -95,7 +95,7 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
// The image sampler we use is a 2x2 filter so we need to scale by a max of 1/2 if we want to get good results.
|
||||
// So we scale as many times as we need to to get the Image to be the right size.
|
||||
// If this were going to be a non-uniform scale we could do the x and y separatly to get better results.
|
||||
// If this were going to be a non-uniform scale we could do the x and y separately to get better results.
|
||||
ImageBuffer halfImage = new ImageBuffer(unScaledImage.Width / 2, unScaledImage.Height / 2, 32, scalingBlender);
|
||||
halfImage.NewGraphics2D().Render(unScaledImage, 0, 0, 0, halfImage.Width / (double)unScaledImage.Width, halfImage.Height / (double)unScaledImage.Height);
|
||||
unScaledImage = halfImage;
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ either expressed or implied, of the FreeBSD Project.
|
|||
*/
|
||||
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.Agg.Image;
|
||||
using MatterHackers.Agg.ImageProcessing;
|
||||
using MatterHackers.Agg.PlatformAbstract;
|
||||
using MatterHackers.Agg.UI;
|
||||
|
|
@ -72,10 +73,51 @@ namespace MatterHackers.MatterControl
|
|||
disabledImageName = normalImageName;
|
||||
}
|
||||
|
||||
Agg.Image.ImageBuffer normalImage = StaticData.Instance.LoadIcon(normalImageName);
|
||||
Agg.Image.ImageBuffer pressedImage = StaticData.Instance.LoadIcon(pressedImageName);
|
||||
Agg.Image.ImageBuffer hoverImage = StaticData.Instance.LoadIcon(hoverImageName);
|
||||
Agg.Image.ImageBuffer disabledImage = StaticData.Instance.LoadIcon(disabledImageName);
|
||||
ImageBuffer normalImage = StaticData.Instance.LoadIcon(normalImageName);
|
||||
ImageBuffer pressedImage = StaticData.Instance.LoadIcon(pressedImageName);
|
||||
ImageBuffer hoverImage = StaticData.Instance.LoadIcon(hoverImageName);
|
||||
ImageBuffer disabledImage = StaticData.Instance.LoadIcon(disabledImageName);
|
||||
|
||||
if (!ActiveTheme.Instance.IsDarkTheme && invertImageColor)
|
||||
{
|
||||
InvertLightness.DoInvertLightness(normalImage);
|
||||
InvertLightness.DoInvertLightness(pressedImage);
|
||||
InvertLightness.DoInvertLightness(hoverImage);
|
||||
InvertLightness.DoInvertLightness(disabledImage);
|
||||
}
|
||||
|
||||
if (ActiveTheme.Instance.IsTouchScreen)
|
||||
{
|
||||
//normalImage.NewGraphics2D().Line(0, 0, normalImage.Width, normalImage.Height, RGBA_Bytes.Violet);
|
||||
RoundedRect rect = new RoundedRect(pressedImage.GetBounds(), 0);
|
||||
pressedImage.NewGraphics2D().Render(new Stroke(rect, 3), ActiveTheme.Instance.PrimaryTextColor);
|
||||
}
|
||||
|
||||
ButtonViewStates buttonViewWidget = new ButtonViewStates(
|
||||
new ImageWidget(normalImage),
|
||||
new ImageWidget(hoverImage),
|
||||
new ImageWidget(pressedImage),
|
||||
new ImageWidget(disabledImage)
|
||||
);
|
||||
|
||||
//Create button based on view container widget
|
||||
Button imageButton = new Button(0, 0, buttonViewWidget);
|
||||
imageButton.Margin = new BorderDouble(0);
|
||||
imageButton.Padding = new BorderDouble(0);
|
||||
return imageButton;
|
||||
}
|
||||
|
||||
public Button Generate(ImageBuffer normalImage, ImageBuffer hoverImage, ImageBuffer pressedImage = null, ImageBuffer disabledImage = null)
|
||||
{
|
||||
if (pressedImage == null)
|
||||
{
|
||||
pressedImage = hoverImage;
|
||||
}
|
||||
|
||||
if (disabledImage == null)
|
||||
{
|
||||
disabledImage = normalImage;
|
||||
}
|
||||
|
||||
if (!ActiveTheme.Instance.IsDarkTheme && invertImageColor)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ using MatterHackers.Agg.ImageProcessing;
|
|||
using MatterHackers.Agg.PlatformAbstract;
|
||||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.Agg.VertexSource;
|
||||
using MatterHackers.ImageProcessing;
|
||||
using MatterHackers.VectorMath;
|
||||
using System;
|
||||
|
||||
|
|
@ -201,7 +202,13 @@ namespace MatterHackers.MatterControl
|
|||
|
||||
public Button GenerateEditButton()
|
||||
{
|
||||
Button editButton = new Button(0, 0, new ButtonViewThreeImage(LoadUpButtonImage("icon_edit_white.png"), LoadUpButtonImage("icon_edit_gray.png"), LoadUpButtonImage("icon_edit_black.png")));
|
||||
ImageBuffer normalImage = StaticData.Instance.LoadIcon("icon_edit_white_32x32.png");
|
||||
int iconSize = (int)(16 * TextWidget.GlobalPointSizeScaleRatio);
|
||||
normalImage = ImageBuffer.CreateScaledImage(normalImage, iconSize, iconSize);
|
||||
|
||||
Button editButton = new Button(0, 0, new ButtonViewThreeImage(normalImage,
|
||||
WhiteToColor.CreateWhiteToColor(normalImage, RGBA_Bytes.Gray),
|
||||
WhiteToColor.CreateWhiteToColor(normalImage, RGBA_Bytes.Black)));
|
||||
editButton.Margin = new BorderDouble(2, 2, 2, 0);
|
||||
editButton.VAnchor = Agg.UI.VAnchor.ParentTop;
|
||||
return editButton;
|
||||
|
|
@ -211,7 +218,13 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
FlowLayoutWidget groupLableAndEditControl = new FlowLayoutWidget();
|
||||
|
||||
editButton = new Button(0, 0, new ButtonViewThreeImage(LoadUpButtonImage("icon_edit_white.png"), LoadUpButtonImage("icon_edit_gray.png"), LoadUpButtonImage("icon_edit_black.png")));
|
||||
ImageBuffer normalImage = StaticData.Instance.LoadIcon("icon_edit_white_32x32.png");
|
||||
int iconSize = (int)(16 * TextWidget.GlobalPointSizeScaleRatio);
|
||||
normalImage = ImageBuffer.CreateScaledImage(normalImage, iconSize, iconSize);
|
||||
|
||||
editButton = new Button(0, 0, new ButtonViewThreeImage(normalImage,
|
||||
WhiteToColor.CreateWhiteToColor(normalImage, RGBA_Bytes.Gray),
|
||||
WhiteToColor.CreateWhiteToColor(normalImage, RGBA_Bytes.Black)));
|
||||
editButton.Margin = new BorderDouble(2, 2, 2, 0);
|
||||
editButton.VAnchor = Agg.UI.VAnchor.ParentBottom;
|
||||
textWidget.VAnchor = Agg.UI.VAnchor.ParentBottom;
|
||||
|
|
@ -225,7 +238,13 @@ namespace MatterHackers.MatterControl
|
|||
{
|
||||
FlowLayoutWidget groupLableAndEditControl = new FlowLayoutWidget();
|
||||
|
||||
editButton = new Button(0, 0, new ButtonViewThreeImage(LoadUpButtonImage("icon_edit_white.png"), LoadUpButtonImage("icon_edit_gray.png"), LoadUpButtonImage("icon_edit_black.png")));
|
||||
ImageBuffer normalImage = StaticData.Instance.LoadIcon("icon_edit_white_32x32.png");
|
||||
int iconSize = (int)(16 * TextWidget.GlobalPointSizeScaleRatio);
|
||||
normalImage = ImageBuffer.CreateScaledImage(normalImage, iconSize, iconSize);
|
||||
|
||||
editButton = new Button(0, 0, new ButtonViewThreeImage(normalImage,
|
||||
WhiteToColor.CreateWhiteToColor(normalImage, RGBA_Bytes.Gray),
|
||||
WhiteToColor.CreateWhiteToColor(normalImage, RGBA_Bytes.Black)));
|
||||
editButton.Margin = new BorderDouble(2, 2, 2, 0);
|
||||
editButton.VAnchor = Agg.UI.VAnchor.ParentBottom;
|
||||
TextWidget textLabel = new TextWidget(label, textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 12);
|
||||
|
|
|
|||
|
|
@ -29,7 +29,10 @@ either expressed or implied, of the FreeBSD Project.
|
|||
//#define DO_IN_PLACE_EDIT
|
||||
|
||||
using MatterHackers.Agg;
|
||||
using MatterHackers.Agg.Image;
|
||||
using MatterHackers.Agg.PlatformAbstract;
|
||||
using MatterHackers.Agg.UI;
|
||||
using MatterHackers.ImageProcessing;
|
||||
using MatterHackers.Localizations;
|
||||
using MatterHackers.MatterControl.CustomWidgets;
|
||||
using MatterHackers.VectorMath;
|
||||
|
|
@ -93,7 +96,11 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
container.HAnchor = HAnchor.ParentLeftRight;
|
||||
container.Padding = new BorderDouble(6, 0);
|
||||
|
||||
editButton = imageButtonFactory.Generate("icon_edit_white.png", "icon_edit_gray.png");
|
||||
ImageBuffer normalImage = StaticData.Instance.LoadIcon("icon_edit_white_32x32.png");
|
||||
int iconSize = (int)(16 * TextWidget.GlobalPointSizeScaleRatio);
|
||||
normalImage = ImageBuffer.CreateScaledImage(normalImage, iconSize, iconSize);
|
||||
|
||||
editButton = imageButtonFactory.Generate(normalImage, WhiteToColor.CreateWhiteToColor(normalImage, RGBA_Bytes.Gray));
|
||||
|
||||
editButton.VAnchor = VAnchor.ParentCenter;
|
||||
editButton.Margin = new BorderDouble(right: 6);
|
||||
|
|
@ -252,7 +259,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
{
|
||||
dropDownList.SelectedValue = ActivePrinterProfile.Instance.GetMaterialSetting(presetIndex).ToString();
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Print(e.Message);
|
||||
GuiWidget.BreakInDebugger();
|
||||
|
|
@ -265,7 +272,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
{
|
||||
dropDownList.SelectedValue = ActivePrinterProfile.Instance.ActiveQualitySettingsID.ToString();
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Print(e.Message);
|
||||
GuiWidget.BreakInDebugger();
|
||||
|
|
@ -323,7 +330,7 @@ namespace MatterHackers.MatterControl.SlicerConfiguration
|
|||
{
|
||||
SelectedLabel = MatterSliceInfo.DisplayName;
|
||||
}
|
||||
catch(Exception e)
|
||||
catch (Exception e)
|
||||
{
|
||||
Debug.Print(e.Message);
|
||||
GuiWidget.BreakInDebugger();
|
||||
|
|
|
|||
Binary file not shown.
|
Before Width: | Height: | Size: 455 B |
Binary file not shown.
|
Before Width: | Height: | Size: 334 B |
Binary file not shown.
|
Before Width: | Height: | Size: 442 B |
BIN
StaticData/Icons/icon_edit_white_32x32.png
Normal file
BIN
StaticData/Icons/icon_edit_white_32x32.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 586 B |
Loading…
Add table
Add a link
Reference in a new issue