Skip to content

Commit

Permalink
#17 improvement app styles
Browse files Browse the repository at this point in the history
  • Loading branch information
Art-Stea1th committed May 10, 2017
1 parent aad8eb8 commit 53840db
Show file tree
Hide file tree
Showing 13 changed files with 248 additions and 245 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
<Setting Name="ShellState" Type="System.Windows.WindowState" Scope="User">
<Value Profile="(Default)">Normal</Value>
</Setting>
<Setting Name="ShellWidth" Type="System.Double" Scope="User">
<Value Profile="(Default)">1044</Value>
<Setting Name="ShellWidth" Type="System.Double" Scope="Application">
<Value Profile="(Default)">1136</Value>
</Setting>
<Setting Name="ShellHeight" Type="System.Double" Scope="User">
<Value Profile="(Default)">534</Value>
<Setting Name="ShellHeight" Type="System.Double" Scope="Application">
<Value Profile="(Default)">587</Value>
</Setting>
<Setting Name="ShellLeft" Type="System.Double" Scope="User">
<Value Profile="(Default)">0</Value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ public IEvolutionAlgorithm Algorithm {
public ApplicationFacade() {
Initialize(new EPSGenerationService(), new GenerationStateMachine());
MatrixReadyToChange = State == State.Stopped;
GenerationWidth = 320;
GenerationHeight = 180;
GenerationWidth = 960;
GenerationHeight = 540;
}

private void Initialize(IEPSGenerator fpsGenerator, IGenerationController controller) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ internal EPSGenerationService() {
epsCollection = new DoubleCollection { 1.0, 2.0, 3.0, 5.0, 15.0, 30.0, 60.0, 120.0, 125.0 }; // Last = NoLimit
timer = new DispatcherTimer();
timer.Tick += (s, e) => NextFrameTime?.Invoke();
EPS = epsCollection.TakeWhile(f => f < 120.0).Last();
EPS = epsCollection.TakeWhile(f => f < epsCollection.Last()).Last();
}

private double ValidEps(double eps) => eps < MinEPS ? MinEPS : eps > MaxEPS ? MaxEPS : eps;
private void UpdateTimerInterval() => timer.Interval =
eps == epsCollection.Last() // <-- if Last - No Limit
eps == epsCollection.Last() // <-- if Last - NoLimit
? TimeSpan.FromTicks(1)
: TimeSpan.FromMilliseconds(1000.0 / ValidEps(eps));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<Style x:Key="{x:Type c:AcceptableTextBox}" TargetType="{x:Type c:AcceptableTextBox}">
<Setter Property="Focusable" Value="False"/>
<Setter Property="Cursor" Value="Arrow"/>
<Setter Property="ToolTip" Value="Double-сlick to edit"/>
<Setter Property="ToolTip" Value="Double click to edit the matrix resolution&#10;Recommended: 160x90, 320x180, 480x270, 960x540, 1920x1080"/>
<Setter Property="ToolTipInEdit" Value="Press &#34;Enter&#34; to accept input or &#34;Esc&#34; to deny"/>
<Setter Property="ToolTipService.InitialShowDelay" Value="0"/>
<Setter Property="MinHeight" Value="{StaticResource ElementsMinHeight}"/>
<Setter Property="CaretBrush" Value="{StaticResource TextBrush}"/>
<Setter Property="SelectionBrush" Value="{StaticResource ControlLightLightBrush}"/>
<Setter Property="SelectionBrush" Value="{StaticResource TextDarkBrush}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type c:AcceptableTextBox}">
Expand Down Expand Up @@ -53,15 +53,15 @@
<Trigger Property="IsEnabled" Value="False">
<Setter
Property="Foreground"
Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
<Setter
Value="{StaticResource TextDarkBrush}"/>
<!--<Setter
TargetName="Border"
Property="BorderBrush"
Value="{DynamicResource {x:Static SystemColors.InactiveCaptionBrushKey}}"/>
<Setter
TargetName="Border"
Property="Background"
Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}"/>
Value="{DynamicResource {x:Static SystemColors.ControlLightLightBrushKey}}"/>-->
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
Expand Down
64 changes: 37 additions & 27 deletions Application/ASD.CellUniverse.Resources/Styles/ButtonStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
<ResourceDictionary Source="Shared.xaml"/>
</ResourceDictionary.MergedDictionaries>

<ControlTemplate x:Key="ButtonBaseTemplate" TargetType="{x:Type ButtonBase}">

<ControlTemplate x:Key="ButtonBaseTemplate" TargetType="{x:Type ButtonBase}">
<Border
x:Name="Border"
BorderThickness="1"
BorderBrush="{StaticResource BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}"
Background="{TemplateBinding Background}"
SnapsToDevicePixels="True">
<ContentPresenter
Expand All @@ -29,54 +28,65 @@

<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Border" Property="Background"
Value="{StaticResource ControlLightBrush}"/>
<Setter TargetName="Border" Property="BorderBrush"
Value="{StaticResource BorderLightBrush}"/>
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground"
Value="{StaticResource TextLightBrush}"/>
<Setter
TargetName="Border"
Property="Background"
Value="{StaticResource ControlLightBrush}"/>
<Setter
TargetName="Border"
Property="BorderBrush"
Value="{StaticResource BorderLightBrush}"/>
<Setter
TargetName="ContentPresenter"
Property="TextElement.Foreground"
Value="{StaticResource TextLightBrush}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Border" Property="Background"
Value="{StaticResource ControlDarkBrush}"/>
<Setter
TargetName="Border"
Property="Background"
Value="{StaticResource ControlDarkBrush}"/>
<Setter
TargetName="Border"
Property="BorderBrush"
Value="{StaticResource BorderDarkBrush}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground"
Value="{StaticResource TextDarkBrush}"/>
<Setter
TargetName="ContentPresenter"
Property="TextElement.Foreground"
Value="{StaticResource TextDarkBrush}"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>


</ControlTemplate>

<Style x:Key="{x:Type Button}" TargetType="{x:Type Button}">
<Setter Property="Template" Value="{StaticResource ButtonBaseTemplate}"/>
<Setter Property="Background" Value="{StaticResource ControlBrush}"/>
<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Foreground" Value="{StaticResource TextBrush}"/>
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisualStyle}"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="MinHeight" Value="{StaticResource ElementsMinHeight}"/>
</Style>

<Style x:Key="{x:Type RepeatButton}" TargetType="{x:Type RepeatButton}">
<Setter Property="Template" Value="{StaticResource ButtonBaseTemplate}"/>
<Setter Property="Background" Value="{StaticResource ControlBrush}"/>
<Setter Property="BorderBrush" Value="{StaticResource BorderBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Foreground" Value="{StaticResource TextBrush}"/>
<Setter Property="FocusVisualStyle" Value="{DynamicResource FocusVisualStyle}"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="MinHeight" Value="{StaticResource ElementsMinHeight}"/>
</Style>

<Style x:Key="WindowButton" TargetType="{x:Type Button}">
<Setter Property="Template" Value="{StaticResource ButtonBaseTemplate}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="MinWidth" Value="40"/>
</Style>

<!--<Style x:Key="WindowCloseButton" TargetType="{x:Type Button}">
<Setter Property="Template" Value="{StaticResource WindowHeaderCloseButtonBaseTemplate}"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="MinWidth" Value="40"/>
</Style>-->

</ResourceDictionary>
Loading

0 comments on commit 53840db

Please sign in to comment.