some old changes

This commit is contained in:
2022-06-30 22:05:52 +03:00
parent 87f17669c3
commit a5b7e0479d
12 changed files with 73 additions and 41 deletions

View File

@@ -2,6 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Application.Resources>
<SolidColorBrush x:Key="MyBackgroundColor" Color="#232328"/>
<SolidColorBrush x:Key="MyDarkTr"
Opacity="0.8"
Color="#141419" />
@@ -30,7 +31,7 @@
<Setter.Value>
<ControlTemplate TargetType="{x:Type Thumb}">
<Border x:Name="rectangle"
Width="8"
Width="6"
Height="{TemplateBinding Height}"
Background="{DynamicResource MyGray}"
SnapsToDevicePixels="True" />
@@ -172,17 +173,32 @@
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style x:Key="MyLabelStyle" TargetType="Label">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="Background" Value="{DynamicResource MyDarkTr}" />
<Setter Property="FontFamily" Value="Unispace" />
<Setter Property="FontSize" Value="15" />
<Setter Property="FontStyle" Value="Normal" />
<Setter Property="FontSize" Value="14" />
<Setter Property="Foreground" Value="{DynamicResource MyWhite}" />
<!-->disables some shit which removes underscores from Content<!-->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Label}">
<Border Background="{TemplateBinding Background}"
BorderThickness="{TemplateBinding BorderThickness}"
BorderBrush="{TemplateBinding BorderBrush}"
Padding="{TemplateBinding Padding}">
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
RecognizesAccessKey="False" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<ControlTemplate x:Key="MyComboBox" TargetType="ComboBox">
<Grid>
<ToggleButton Focusable="false" IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">

View File

@@ -9,7 +9,7 @@
Height="500"
MinWidth="800"
MinHeight="500"
Background="#232328"
Background="{DynamicResource MyBackgroundColor}"
mc:Ignorable="d">
<Grid>
<Grid.ColumnDefinitions>
@@ -72,7 +72,7 @@
<ColumnDefinition Width="5" />
<ColumnDefinition />
<ColumnDefinition Width="5" />
<ColumnDefinition Width="200" />
<ColumnDefinition Width="220" />
</Grid.ColumnDefinitions>
<ScrollViewer Grid.Column="0"
HorizontalAlignment="Stretch"

View File

@@ -11,9 +11,9 @@ public partial class LauncherWindow : Window
InitializeComponent();
LogBox.Text = Logger.Buffer;
Logger.MessageSent += LogHandler;
LogfileLabel.Content = Logger.Logfile.Remove(0,Logger.Logfile.LastIndexOf(Path.Sep)+1);
LogfileLabel.Content = Logger.Logfile.Remove(0,Logger.Logfile.LastIndexOf(Путь.Разд)+1);
LogfileLabel.MouseLeftButtonDown += (s,e)=>
Process.Start("explorer.exe", Logger.Logfile.Remove(Logger.Logfile.LastIndexOf(Path.Sep)));
Process.Start("explorer.exe", Logger.Logfile.Remove(Logger.Logfile.LastIndexOf(Путь.Разд)));
LogfileLabel.MouseEnter += (s,e)=>LogfileLabel.Foreground=App.MySelectionColor;
LogfileLabel.MouseLeave += (s,e)=>LogfileLabel.Foreground=App.MyWhite;
LibraryButton.TabGrid = LibraryGrid;
@@ -89,7 +89,7 @@ public partial class LauncherWindow : Window
DescriptionBox.Text = selectedProg.Description;
BackgroundImage.Source =
new BitmapImage(new Uri(
$"{Directory.GetCurrent()}{Path.Sep}backgrounds{Path.Sep}{selectedProg.BackgroundFile}",
$"{Directory.GetCurrent()}{Путь.Разд}backgrounds{Путь.Разд}{selectedProg.BackgroundFile}",
UriKind.Absolute));
ProgramSettingsViever.Content = selectedProg.SettingsPanel;
DisplayingProgram = selectedProg;

View File

@@ -10,7 +10,7 @@ public partial class ProgramLabel : UserControl
InitializeComponent();
NameLabel.Content = label;
IconImage.Source = new BitmapImage(new Uri(
$"{Directory.GetCurrent()}{Path.Sep}icons{Path.Sep}{icon}",
$"{Directory.GetCurrent()}{Путь.Разд}icons{Путь.Разд}{icon}",
UriKind.Absolute));
}
}

View File

@@ -4,8 +4,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:launcher_client_win.GUI"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
Height="30"
d:DesignWidth="100"
d:DesignHeight="30"
mc:Ignorable="d"
Background="Transparent">
<Grid>
@@ -15,7 +15,9 @@
</Grid.ColumnDefinitions>
<Label Name="KeyLabel" Grid.Column="0"
Content="{Binding SettingKey, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:ProgramSettingsPanelItem}}"
Style="{DynamicResource MyLabelStyle}" />
Style="{DynamicResource MyLabelStyle}"
FontFamily="default"
FontSize="16"/>
<TextBox Name="ValueBox" Grid.Column="1"
HorizontalScrollBarVisibility="Auto"
Style="{DynamicResource MyTextBoxStyle}"

View File

@@ -7,22 +7,33 @@ public partial class ProgramSettingsPanelItem : UserControl
public static readonly DependencyProperty SettingKeyProp = DependencyProperty.Register(
"SettingKey",
typeof(string),
typeof(TabButton));
typeof(ProgramSettingsPanelItem));
public string SettingKey
{
get => (string)GetValue(SettingKeyProp);
set => SetValue(SettingKeyProp, value);
set
{
SetValue(SettingKeyProp, value);
KeyLabel.ToolTip = new ToolTip
{
Content = value,
Foreground = App.MyWhite,
Background = App.MySoftDark
};
}
}
public static readonly DependencyProperty SettingValueProp = DependencyProperty.Register(
"SettingValue",
typeof(string),
typeof(TabButton));
typeof(ProgramSettingsPanelItem));
public string SettingValue
{
get => (string)GetValue(SettingValueProp);
set => SetValue(SettingValueProp, value);
}
public event Action<ProgramSettingsPanelItem> UpdatedEvent;
public ProgramSettingsPanelItem(string key, string value)
{
@@ -31,6 +42,4 @@ public partial class ProgramSettingsPanelItem : UserControl
SettingValue = value;
ValueBox.TextChanged += (_,_)=> UpdatedEvent?.Invoke(this);
}
public event Action<ProgramSettingsPanelItem> UpdatedEvent;
}