Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Commit

Permalink
Close #126 - Update UI
Browse files Browse the repository at this point in the history
  • Loading branch information
jibedoubleve committed Jun 5, 2020
1 parent 851b039 commit 65a9dc6
Show file tree
Hide file tree
Showing 25 changed files with 331 additions and 190 deletions.
2 changes: 1 addition & 1 deletion build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ Task("Inno-Setup")
var plugins = new string[] { "spotify", "calculator", "clipboard", "evernote" };
Information("Bin path : {0}: ", path);
Information("Plugin path: {0}: ", pluginDir);
// Information("Plugin path: {0}: ", pluginDir);
InnoSetup(inno_setup, new InnoSetupSettings {
OutputDirectory = publishDir,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
Width="{StaticResource DefaultIconSize}"
Height="{StaticResource DefaultIconSize}"
Margin="5,5,10,5"
Foreground="{DynamicResource MyTextBrush}"
Foreground="{DynamicResource TextColourBrush}"
Kind="Calculator" />
<TextBlock
Margin="5"
FontFamily="Tahomas"
FontFamily="{StaticResource TextFontFamily}"
FontSize="26"
Foreground="{DynamicResource MyTextBrush}"
Foreground="{DynamicResource TextColourBrush}"
Text="{Binding Expression, UpdateSourceTrigger=PropertyChanged}" />
</StackPanel>
</DataTemplate>
Expand All @@ -34,9 +34,9 @@
Margin="5"
local:FocusOnLastBehavior.Focus="True"
Background="Transparent"
FontFamily="Tahomas"
FontFamily="{StaticResource TextFontFamily}"
FontSize="26"
Foreground="{DynamicResource MyTextBrush}"
Foreground="{DynamicResource TextColourBrush}"
IsReadOnly="{Binding IsReadOnly, UpdateSourceTrigger=PropertyChanged}"
KeyDown="OnTextBoxKeyDown"
Text="{Binding Expression, UpdateSourceTrigger=PropertyChanged}" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
Height="{StaticResource DefaultIconSize}"
Margin="5,10,15,5"
DockPanel.Dock="Left"
Foreground="#FFB9B9B9"
Foreground="{StaticResource TextColourBrush}"
Kind="Clippy" />

<StackPanel
Expand Down Expand Up @@ -62,9 +62,7 @@
Margin="0,3,0,0"
VerticalAlignment="Bottom"
DockPanel.Dock="Bottom"
FontFamily="Consolas"
FontSize="10"
Foreground="#FFB9B9B9"
Style="{StaticResource FooterStyle}"
Text="{Binding Saved, StringFormat={}dd MMMM yyyy HH:mm:ss}" />

</DockPanel>
Expand Down
17 changes: 11 additions & 6 deletions src/Plugins/Probel.Lanceur.Plugin.Spotify/Views/MainView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
<conv:InvertBooleanToVisibilityConverter x:Key="InvertBooleanToVisibilityConverter" />
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="{DynamicResource MyTextBrush}" />
<Setter Property="Foreground" Value="{DynamicResource TextColourBrush}" />
<Setter Property="Margin" Value="5" />
</Style>
<Style x:Key="TimeTextBloxkStyle" TargetType="TextBlock">
<Setter Property="Foreground" Value="{DynamicResource MyTextBrush}" />
<Style
x:Key="TimeTextBlockStyle"
BasedOn="{StaticResource BaseTextBoxStyle}"
TargetType="TextBlock">
<Setter Property="Foreground" Value="{DynamicResource TextColourBrush}" />
<Setter Property="Margin" Value="5" />
<Setter Property="FontSize" Value="10" />
</Style>
Expand All @@ -38,12 +41,14 @@
Source="{Binding Image.Url}" />
<StackPanel Margin="20,50,0,0">
<TextBlock
FontSize="28"
FontSize="24"
Style="{StaticResource BaseTextBoxStyle}"
Text="{Binding Artists}"
TextWrapping="Wrap" />

<TextBlock
FontSize="18"
Style="{StaticResource BaseTextBoxStyle}"
Text="{Binding Title}"
TextWrapping="Wrap" />

Expand All @@ -53,7 +58,7 @@
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<TextBlock Style="{DynamicResource TimeTextBloxkStyle}" Text="{Binding Progress, Converter={StaticResource IntToTimeSpanStringConverter}}" />
<TextBlock Style="{StaticResource TimeTextBlockStyle}" Text="{Binding Progress, Converter={StaticResource IntToTimeSpanStringConverter}}" />

<ProgressBar
Grid.Column="1"
Expand All @@ -64,7 +69,7 @@

<TextBlock
Grid.Column="2"
Style="{DynamicResource TimeTextBloxkStyle}"
Style="{DynamicResource TimeTextBlockStyle}"
Text="{Binding Duration, Converter={StaticResource IntToTimeSpanStringConverter}}" />
</Grid>
</StackPanel>
Expand Down
4 changes: 2 additions & 2 deletions src/Probel.Lanceur.Core/Entities/Settings/WindowSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ public class WindowSettings
{
#region Properties

public string Colour { get; set; } = "#FF1E1E1E";
public string Colour { get; set; } = "#424242";

public int ExpirationTimeMessage { get; set; } = 8;

public double Opacity { get; set; } = 0.80;
public double Opacity { get; set; } = 1;

public PositionSettings Position { get; set; } = new PositionSettings();

Expand Down
15 changes: 13 additions & 2 deletions src/Probel.Lanceur.Core/Services/IAliasService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ public class ExecutionResult
{
#region Constructors

private ExecutionResult(bool isError, bool keepShowing)
private ExecutionResult(bool isError, bool keepShowing, string error = null)
{
Error = error;
IsError = isError;
KeepShowing = keepShowing;
}
Expand All @@ -41,12 +42,22 @@ private ExecutionResult(bool isError, bool keepShowing)
#region Properties

public static ExecutionResult None => new ExecutionResult(false, false);
public static ExecutionResult Failure => new ExecutionResult(true, true);
public static ExecutionResult SuccessHide => new ExecutionResult(false, false);

public static ExecutionResult SuccesShow => new ExecutionResult(false, true);

public string Error { get; }

public bool IsError { get; }

public bool KeepShowing { get; }

#endregion Properties

#region Methods

public static ExecutionResult Failure(string error = "An error occured") => new ExecutionResult(true, true, error);

#endregion Methods
}
}
10 changes: 7 additions & 3 deletions src/Probel.Lanceur.Core/ServicesImpl/CommandRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Probel.Lanceur.Core.Services;
using Probel.Lanceur.Infrastructure;
using System.Diagnostics;
using System.Net.Configuration;

namespace Probel.Lanceur.Core.ServicesImpl
{
Expand Down Expand Up @@ -49,9 +50,12 @@ public ExecutionResult Execute(Alias alias)
{
return _keywordService.ExecuteActionFor(alias.Name, alias.Arguments);
}
else {
_log.Warning($"Alias '{alias.Name}' does not exist in the database.");
return ExecutionResult.Failure; }
else
{
var msg = $"Alias '{alias.Name}' does not exist in the database.";
_log.Warning(msg);
return ExecutionResult.Failure(msg);
}
}

private ProcessStartInfo GetProcessStartInfo(Alias alias)
Expand Down
21 changes: 5 additions & 16 deletions src/Probel.Lanceur/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,16 @@
<ResourceDictionary>
<local:Bootstrapper x:Key="Bootstrapper" />
</ResourceDictionary>
<!-- MahApps.Metro resource dictionaries. Make sure that all file names are Case Sensitive! -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />

<!-- Accent and AppTheme setting -->
<!-- For all other styles -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
<!-- For clean style -->
<!--<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Clean/Clean.xaml" />-->

<!-- Default Styles -->
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Cyan.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseDark.xaml" />
<!-- MahApps -->
<ResourceDictionary Source="/Probel.Lanceur;component/Styles/MahApps.xaml" />

<!-- My Styles -->
<ResourceDictionary Source="/Probel.Lanceur;component/Styles/Merged.xaml" />
<ResourceDictionary Source="/Probel.Lanceur;component/Styles/Themes/DarkTheme.xaml" />
<ResourceDictionary Source="/Probel.Lanceur;component/Styles/MahAppsFonts.xaml" />
<ResourceDictionary Source="/Probel.Lanceur;component/Styles/Styles.xaml" />

</ResourceDictionary.MergedDictionaries>
<SolidColorBrush x:Key="MyTextBrush" Color="#FFE6E6E6" />
</ResourceDictionary>
</Application.Resources>
</Application>
24 changes: 13 additions & 11 deletions src/Probel.Lanceur/Controls/AliasControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,26 @@
<UserControl.Resources>
<sys:Double x:Key="DefaultIconSize">30</sys:Double>
</UserControl.Resources>
<Border BorderBrush="white" BorderThickness="0.1">
<Border
Margin="0"
Padding="3"
Background="Transparent"
BorderBrush="white"
CornerRadius="3">
<DockPanel Background="Transparent">
<iconPacks:PackIconMaterial
x:Name="CtrlIcon"
Width="{StaticResource DefaultIconSize}"
Height="{StaticResource DefaultIconSize}"
Margin="5,10,15,3"
DockPanel.Dock="Left"
Foreground="#FFB9B9B9" />
Foreground="{StaticResource TextColourBrush}" />

<TextBlock
x:Name="CtrlCounter"
Margin="0,0,5,3"
VerticalAlignment="Bottom"
DockPanel.Dock="Right"
FontSize="8"
Foreground="#FFB9B9B9"
Style="{StaticResource FooterStyle}"
Visibility="Collapsed">
<Run Text="Count:" />
<Run x:Name="CtrlCount" />
Expand All @@ -37,17 +40,16 @@
<TextBlock
x:Name="CtrlName"
DockPanel.Dock="Top"
FontSize="22"
FontWeight="DemiBold"
Foreground="#FFE6E6E6" />
FontSize="24"
FontWeight="SemiBold"
Foreground="{StaticResource TextColourBrush}" />

<TextBlock
x:Name="CtrlFileName"
Margin="0,3,0,3"
DockPanel.Dock="Bottom"
FontFamily="Consolas"
FontSize="10"
Foreground="#FFB9B9B9" />
Foreground="{StaticResource TextColourBrush}"
Opacity=".7" />
</DockPanel>
</Border>
</UserControl>
2 changes: 1 addition & 1 deletion src/Probel.Lanceur/Controls/DisplayResultControl.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
x:Name="CtrlSubtitle"
Margin="0,3,0,3"
DockPanel.Dock="Bottom"
FontFamily="Consolas"
FontFamily="{StaticResource TextFontFamily}"
FontSize="10"
Foreground="#FFB9B9B9" />
</DockPanel>
Expand Down
7 changes: 0 additions & 7 deletions src/Probel.Lanceur/Controls/ResultList.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,5 @@
</Style>
</ListBox.Resources>
</ListBox>
<TextBlock Grid.Row="1" HorizontalAlignment="Right">
<Run Foreground="#FFB9B9B9" Text="Session:" />
<Run
x:Name="Session"
FontWeight="DemiBold"
Foreground="#FFB9B9B9" />
</TextBlock>
</Grid>
</UserControl>
Loading

0 comments on commit 65a9dc6

Please sign in to comment.