mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Work on UI, added splash screen
This commit is contained in:
parent
4e2eb5dd3f
commit
00f5ddf673
@ -4,6 +4,10 @@
|
||||
StartupUri="UI/MainWindow.xaml"
|
||||
Startup="Application_Startup">
|
||||
<Application.Resources>
|
||||
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="UI/Styles/Common.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
|
@ -134,6 +134,14 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UI\Styles\ButtonStyle.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UI\Styles\Common.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs">
|
||||
@ -172,6 +180,9 @@
|
||||
<ItemGroup>
|
||||
<Resource Include="Resources\Icons\text-x-generic-32.png" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<SplashScreen Include="Resources\splash.png" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
BIN
RainmeterEditor/Resources/splash.png
Normal file
BIN
RainmeterEditor/Resources/splash.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 316 KiB |
@ -6,6 +6,7 @@ using RainmeterEditor.Business;
|
||||
using RainmeterEditor.UI.Dialogs;
|
||||
using RainmeterEditor.Model.Events;
|
||||
using RainmeterEditor.Model;
|
||||
using System.Windows;
|
||||
|
||||
namespace RainmeterEditor.UI.Controller
|
||||
{
|
||||
@ -29,10 +30,15 @@ namespace RainmeterEditor.UI.Controller
|
||||
{
|
||||
}
|
||||
|
||||
public void Create()
|
||||
public void Create(Window parent = null, DocumentFormat defaultFormat = null, string defaultPath = "")
|
||||
{
|
||||
// Show dialog
|
||||
var dialog = new CreateDocumentDialog();
|
||||
var dialog = new CreateDocumentDialog()
|
||||
{
|
||||
Owner = parent,
|
||||
SelectedFormat = defaultFormat,
|
||||
SelectedPath = defaultPath
|
||||
};
|
||||
bool? res = dialog.ShowDialog();
|
||||
|
||||
if (!res.HasValue || !res.Value)
|
||||
@ -44,5 +50,11 @@ namespace RainmeterEditor.UI.Controller
|
||||
// Call manager
|
||||
DocumentManager.Instance.Create(format, path);
|
||||
}
|
||||
|
||||
public void Create(DocumentFormat format, string path)
|
||||
{
|
||||
// Call manager
|
||||
DocumentManager.Instance.Create(format, path);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,10 @@
|
||||
<Window x:Class="RainmeterEditor.UI.Dialogs.CreateDocumentDialog"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="CreateDocumentDialog" Height="250" Width="400">
|
||||
Title="Create..." Height="250" Width="400"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
WindowStyle="ToolWindow" ShowInTaskbar="False">
|
||||
|
||||
<Grid Background="WhiteSmoke">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
|
@ -59,6 +59,7 @@ namespace RainmeterEditor.UI.Dialogs
|
||||
InitializeComponent();
|
||||
|
||||
PopulateFormats();
|
||||
Validate();
|
||||
}
|
||||
|
||||
private void PopulateFormats()
|
||||
@ -79,5 +80,14 @@ namespace RainmeterEditor.UI.Dialogs
|
||||
DialogResult = false;
|
||||
Close();
|
||||
}
|
||||
|
||||
private void Validate()
|
||||
{
|
||||
bool res = true;
|
||||
res &= !String.IsNullOrWhiteSpace(textPath.Text);
|
||||
res &= (listFormats.SelectedItem != null);
|
||||
|
||||
buttonCreate.IsEnabled = res;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,8 @@
|
||||
xmlns:ui="clr-namespace:RainmeterEditor.UI"
|
||||
xmlns:ad="clr-namespace:Xceed.Wpf.AvalonDock;assembly=Xceed.Wpf.AvalonDock"
|
||||
xmlns:adlayout="clr-namespace:Xceed.Wpf.AvalonDock.Layout;assembly=Xceed.Wpf.AvalonDock"
|
||||
Title="Rainmeter Studio" Height="350" Width="525">
|
||||
Title="Rainmeter Studio" Height="350" Width="525"
|
||||
ResizeMode="CanResizeWithGrip" >
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
|
@ -61,7 +61,7 @@ namespace RainmeterEditor
|
||||
|
||||
private void File_New_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
documentController.Create();
|
||||
documentController.Create(this);
|
||||
}
|
||||
}
|
||||
}
|
55
RainmeterEditor/UI/Styles/ButtonStyle.xaml
Normal file
55
RainmeterEditor/UI/Styles/ButtonStyle.xaml
Normal file
@ -0,0 +1,55 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Margin" Value="1" />
|
||||
<Setter Property="Padding" Value="6,1,6,1" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border Name="_border"
|
||||
BorderBrush="Gray"
|
||||
BorderThickness="1"
|
||||
CornerRadius="2"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<Border.Background>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
||||
<GradientStop Color="#eeee" Offset="0" />
|
||||
<GradientStop Color="#cccc" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
</Border.Background>
|
||||
<ContentPresenter Name="_content" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="_border" Property="Background" >
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
||||
<GradientStop Color="#eeee" Offset="0" />
|
||||
<GradientStop Color="#dddd" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="_border" Property="Background" >
|
||||
<Setter.Value>
|
||||
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
|
||||
<GradientStop Color="#dddd" Offset="0" />
|
||||
<GradientStop Color="#bbbb" Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Trigger>
|
||||
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="_content" Property="Opacity" Value=".5" />
|
||||
</Trigger>
|
||||
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
6
RainmeterEditor/UI/Styles/Common.xaml
Normal file
6
RainmeterEditor/UI/Styles/Common.xaml
Normal file
@ -0,0 +1,6 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="ButtonStyle.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
Loading…
Reference in New Issue
Block a user