Remove extra scaling, special styling, for touchscreen

- Issue MatterHackers/MCCentral#2334
Create folder is not open to right size
This commit is contained in:
John Lewin 2017-12-11 21:09:40 -08:00
parent 19811da81d
commit ebea5a5bdb
9 changed files with 24 additions and 65 deletions

View file

@ -73,14 +73,6 @@ namespace MatterHackers.MatterControl
container.AnchorAll();
GuiWidget.TouchScreenMode = UserSettings.Instance.IsTouchScreen;
if (!UserSettings.Instance.IsTouchScreen)
{
#if false // !__ANDROID__
// The application menu bar, which is suppressed on Android
var menuRow = new ApplicationMenuRow();
container.AddChild(menuRow);
#endif
}
container.AddChild(new HorizontalLine(alpha:50));

View file

@ -225,13 +225,11 @@ namespace MatterHackers.MatterControl
NormalFillColor = Color.Gray
});
int viewControlsButtonHeight = (UserSettings.Instance.IsTouchScreen) ? 40 : 0;
this.ViewControlsButtonFactory = new TextImageButtonFactory(new ButtonFactoryOptions(commonOptions)
{
DisabledTextColor = theme.PrimaryTextColor,
FixedHeight = viewControlsButtonHeight,
FixedWidth = viewControlsButtonHeight,
FixedHeight = 0,
FixedWidth = 0,
AllowThemeToAdjustImage = false,
CheckedBorderColor = Color.White
});
@ -256,16 +254,9 @@ namespace MatterHackers.MatterControl
});
#region PartPreviewWidget
if (UserSettings.Instance.IsTouchScreen)
{
sideBarButtonWidth = 180;
shortButtonHeight = 40;
}
else
{
sideBarButtonWidth = 138;
shortButtonHeight = 30;
}
sideBarButtonWidth = 138;
shortButtonHeight = 30;
WhiteButtonFactory = new TextImageButtonFactory(new ButtonFactoryOptions(commonOptions)
{
@ -465,10 +456,6 @@ namespace MatterHackers.MatterControl
public SolidSlider CreateSolidSlider(GuiWidget wordOptionContainer, string header, double min = 0, double max = .5)
{
double scrollBarWidth = 10;
if (UserSettings.Instance.IsTouchScreen)
{
scrollBarWidth = 20;
}
wordOptionContainer.AddChild(new TextWidget(header, textColor: ActiveTheme.Instance.PrimaryTextColor)
{

View file

@ -35,7 +35,6 @@ namespace MatterHackers.MatterControl
{
public class InstructionsPage : WizardControlPage
{
double extraTextScaling = 1;
protected FlowLayoutWidget topToBottomControls;
protected PrinterConfig printer { get; }
@ -45,15 +44,10 @@ namespace MatterHackers.MatterControl
{
this.printer = printer;
if (UserSettings.Instance.IsTouchScreen)
{
extraTextScaling = 1.33333;
}
topToBottomControls = new FlowLayoutWidget(FlowDirection.TopToBottom);
topToBottomControls.Padding = new BorderDouble(3);
topToBottomControls.HAnchor |= Agg.UI.HAnchor.Left;
topToBottomControls.VAnchor |= Agg.UI.VAnchor.Top;
topToBottomControls.HAnchor |= HAnchor.Left;
topToBottomControls.VAnchor |= VAnchor.Top;
AddTextField(instructionsText, 10);
@ -70,9 +64,12 @@ namespace MatterHackers.MatterControl
EnglishTextWrapping wrapper = new EnglishTextWrapping(12);
string wrappedInstructions = wrapper.InsertCRs(instructionsText, 400);
string wrappedInstructionsTabsToSpaces = wrappedInstructions.Replace("\t", " ");
TextWidget instructionsWidget = new TextWidget(wrappedInstructionsTabsToSpaces, textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 12 * extraTextScaling);
instructionsWidget.HAnchor = Agg.UI.HAnchor.Left;
topToBottomControls.AddChild(instructionsWidget);
topToBottomControls.AddChild(
new TextWidget(wrappedInstructionsTabsToSpaces, textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 12 * GuiWidget.DeviceScale)
{
HAnchor = HAnchor.Left
});
}
}
}

View file

@ -60,8 +60,6 @@ namespace MatterHackers.MatterControl
private TextWidget messageContainer;
private Action<bool> responseCallback;
private double extraTextScaling = (UserSettings.Instance.IsTouchScreen) ? 1.33333 : 1;
public MessageBoxPage(Action<bool> callback, string message, string caption, MessageType messageType, GuiWidget[] extraWidgetsToAdd, double width, double height, string yesOk, string noCancel, ThemeConfig theme)
: base((noCancel == "") ? "No".Localize() : noCancel)
{
@ -78,7 +76,7 @@ namespace MatterHackers.MatterControl
responseCallback = callback;
unwrappedMessage = message;
contentRow.AddChild(messageContainer = new TextWidget(message, textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 12 * extraTextScaling)
contentRow.AddChild(messageContainer = new TextWidget(message, textColor: ActiveTheme.Instance.PrimaryTextColor, pointSize: 12 * DeviceScale)
{
AutoExpandBoundsToText = true,
HAnchor = HAnchor.Left
@ -137,7 +135,7 @@ namespace MatterHackers.MatterControl
double wrappingSize = contentRow.Width - (contentRow.Padding.Width + messageContainer.Margin.Width);
if (wrappingSize > 0)
{
var wrapper = new EnglishTextWrapping(12 * extraTextScaling * GuiWidget.DeviceScale);
var wrapper = new EnglishTextWrapping(12 * GuiWidget.DeviceScale);
messageContainer.Text = wrapper.InsertCRs(unwrappedMessage, wrappingSize);
}
}

View file

@ -53,15 +53,7 @@ namespace MatterHackers.MatterControl
FlowLayoutWidget topToBottom = new FlowLayoutWidget(FlowDirection.TopToBottom);
topToBottom.AnchorAll();
if (UserSettings.Instance.IsTouchScreen)
{
topToBottom.Padding = new BorderDouble(12);
}
else
{
topToBottom.Padding = new BorderDouble(3, 0, 3, 5);
}
topToBottom.Padding = new BorderDouble(3, 0, 3, 5);
FlowLayoutWidget headerRow = new FlowLayoutWidget(FlowDirection.LeftToRight);
headerRow.HAnchor = HAnchor.Stretch;

View file

@ -184,6 +184,7 @@ namespace MatterHackers.MatterControl
GuiWidget.DeviceScale = 1.3;
SystemWindow.ShareSingleOsWindow = true;
}
string textSizeMode = UserSettings.Instance.get(UserSettingsKey.ApplicationTextSize);
if (!string.IsNullOrEmpty(textSizeMode))
{

View file

@ -37,7 +37,7 @@ namespace MatterHackers.MatterControl.PartPreviewWindow
{
public class SliceLayerSelector : GuiWidget
{
public static int SliderWidth { get; } = (UserSettings.Instance.IsTouchScreen) ? 20 : 10;
public static int SliderWidth { get; } = 10;
private InlineEditControl currentLayerInfo;

View file

@ -64,10 +64,6 @@ namespace MatterHackers.MatterControl.PrinterControls
double sliderWidth = 300 * GuiWidget.DeviceScale;
double sliderThumbWidth = 10 * GuiWidget.DeviceScale;
if (UserSettings.Instance.IsTouchScreen)
{
sliderThumbWidth = 15 * GuiWidget.DeviceScale;
}
{
var row = new FlowLayoutWidget()

View file

@ -65,7 +65,6 @@ namespace MatterHackers.MatterControl
if (!UserSettings.Instance.IsTouchScreen)
{
this.BackgroundColor = ActiveTheme.Instance.SecondaryBackgroundColor;
this.Padding = new BorderDouble(0); //To be re-enabled once native borders are turned off
}
@ -117,16 +116,13 @@ namespace MatterHackers.MatterControl
mainContainer.AddChild(contentRow);
mainContainer.AddChild(footerRow);
if (!UserSettings.Instance.IsTouchScreen)
{
mainContainer.Padding = new BorderDouble(3, 5, 3, 5);
headerRow.Padding = new BorderDouble(0, 3, 0, 3);
mainContainer.Padding = new BorderDouble(3, 5, 3, 5);
headerRow.Padding = new BorderDouble(0, 3, 0, 3);
headerLabel.TextWidget.PointSize = 14;
headerLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor;
contentRow.Padding = new BorderDouble(5);
footerRow.Margin = new BorderDouble(0, 3);
}
headerLabel.TextWidget.PointSize = 14;
headerLabel.TextColor = ActiveTheme.Instance.PrimaryTextColor;
contentRow.Padding = new BorderDouble(5);
footerRow.Margin = new BorderDouble(0, 3);
this.AddChild(mainContainer);
}