Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Battify/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public partial class App : System.Windows.Application

protected override void OnStartup(StartupEventArgs e)
{
Localizer.ApplyConfiguredCulture();

// 뮤텍스 생성 시도
_mutex = new Mutex(true, MutexName, out bool createdNew);

Expand All @@ -22,7 +24,7 @@ protected override void OnStartup(StartupEventArgs e)
// 이미 실행 중인 인스턴스가 있음
/*
System.Windows.MessageBox.Show(
"Battify가 이미 실행 중입니다.\n시스템 트레이를 확인해주세요.",
Localizer.Get("App.AlreadyRunning"),
"Battify",
MessageBoxButton.OK,
MessageBoxImage.Information);
Expand Down
1 change: 0 additions & 1 deletion Battify/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Windows;

[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
Expand Down
146 changes: 133 additions & 13 deletions Battify/BatteryInfoWindow.xaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Window x:Class="Battify.BatteryInfoWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Battify 정보"
xmlns:local="clr-namespace:Battify"
Title="{local:Loc Window.BatteryInfo.Title}"
Height="370"
Width="455"
Background="#1B1B1B"
Expand Down Expand Up @@ -133,6 +134,114 @@
</Setter.Value>
</Setter>
</Style>

<!-- 하단 버튼들과 어울리는 다크 테마 언어 선택 콤보박스 -->
<Style x:Key="DarkComboBoxItemStyle" TargetType="ComboBoxItem">
<Setter Property="Foreground" Value="#E6E6E6"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Padding" Value="10,6"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBoxItem">
<Border x:Name="ItemBorder"
Background="{TemplateBinding Background}"
CornerRadius="5"
Margin="3,1">
<ContentPresenter Margin="{TemplateBinding Padding}"
VerticalAlignment="Center"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
TextElement.Foreground="{TemplateBinding Foreground}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsHighlighted" Value="True">
<Setter TargetName="ItemBorder" Property="Background" Value="#383838"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="ItemBorder" Property="Background" Value="#0078D4"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>

<Style x:Key="DarkComboBoxStyle" TargetType="ComboBox">
<Setter Property="Foreground" Value="#E6E6E6"/>
<Setter Property="Background" Value="#282828"/>
<Setter Property="BorderBrush" Value="#404040"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="10,0,8,0"/>
<Setter Property="ItemContainerStyle" Value="{StaticResource DarkComboBoxItemStyle}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid x:Name="Root">
<ToggleButton x:Name="DropDownToggle"
Background="Transparent"
BorderThickness="0"
Focusable="False"
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}">
<ToggleButton.Template>
<ControlTemplate TargetType="ToggleButton">
<Border x:Name="ComboBorder"
Background="{TemplateBinding Background}"
BorderBrush="{Binding BorderBrush, RelativeSource={RelativeSource AncestorType=ComboBox}}"
BorderThickness="{Binding BorderThickness, RelativeSource={RelativeSource AncestorType=ComboBox}}"
CornerRadius="8">
<Grid>
<ContentPresenter Margin="{Binding Padding, RelativeSource={RelativeSource AncestorType=ComboBox}}"
VerticalAlignment="Center"
Content="{Binding SelectionBoxItem, RelativeSource={RelativeSource AncestorType=ComboBox}}"
ContentTemplate="{Binding SelectionBoxItemTemplate, RelativeSource={RelativeSource AncestorType=ComboBox}}"
TextElement.Foreground="{Binding Foreground, RelativeSource={RelativeSource AncestorType=ComboBox}}"/>
<Path x:Name="Arrow"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Margin="0,0,10,0"
Fill="#AFAFAF"
Data="M 0 0 L 8 0 L 4 4 Z"/>
</Grid>
</Border>
</ControlTemplate>
</ToggleButton.Template>
</ToggleButton>
<Popup x:Name="PART_Popup"
AllowsTransparency="True"
Placement="Bottom"
PopupAnimation="Slide"
IsOpen="{TemplateBinding IsDropDownOpen}">
<Border MinWidth="{Binding ActualWidth, ElementName=Root}"
Margin="0,4,0,0"
Padding="2"
Background="#282828"
BorderBrush="#404040"
BorderThickness="1"
CornerRadius="8">
<ScrollViewer MaxHeight="180"
CanContentScroll="True"
VerticalScrollBarVisibility="Auto">
<ItemsPresenter/>
</ScrollViewer>
</Border>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="DropDownToggle" Property="Background" Value="#383838"/>
</Trigger>
<Trigger Property="IsDropDownOpen" Value="True">
<Setter TargetName="DropDownToggle" Property="Background" Value="#383838"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.5"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Window.Resources>

<Grid>
Expand All @@ -143,7 +252,7 @@

<!-- 배터리 정보 라벨 -->
<Label x:Name="AppVersionLabel"
Content="배티파이"
Content="{local:Loc Battery.AppVersion}"
Foreground="#FFBDBDBD"
FontSize="14"
Margin="76,59,0,0"
Expand All @@ -152,7 +261,7 @@

<!-- 배터리 정보 라벨 -->
<Label x:Name="BatteryInfoLabel"
Content="배터리 &amp; 앱 정보"
Content="{local:Loc Battery.SectionTitle}"
Foreground="Gray"
FontSize="14"
Margin="11,139,0,0"
Expand All @@ -161,7 +270,7 @@

<!-- 새로 고침 버튼 -->
<Button x:Name="UpdateButton"
Content="새로 고침"
Content="{local:Loc Common.Refresh}"
Foreground="White"
BorderBrush="Transparent"
FontSize="11"
Expand Down Expand Up @@ -216,7 +325,7 @@
<Grid VerticalAlignment="Bottom" Height="50" Margin="0,0,0,0">
<!-- 시작프로그램 설정 체크박스 -->
<CheckBox x:Name="SetStartupChk"
Content="시작프로그램 설정"
Content="{local:Loc Battery.StartupEnabled}"
Style="{StaticResource DarkCheckBoxStyle}"
FontSize="14"
VerticalAlignment="Center"
Expand All @@ -227,7 +336,7 @@

<!-- 닫기 버튼 -->
<Button x:Name="CloseButton"
Content="닫기"
Content="{local:Loc Common.Close}"
Foreground="White"
BorderBrush="Transparent"
FontSize="14"
Expand Down Expand Up @@ -270,8 +379,8 @@
Margin="0,0,120,0"
Click="OpenUpdatePageButton_Click" Height="36" VerticalAlignment="Center">
<TextBlock TextAlignment="Center">
최신 버전 확인<LineBreak />
<TextBlock FontSize="8" Text="(스토어)"/>
<TextBlock Text="{local:Loc Battery.CheckForUpdates}"/><LineBreak />
<TextBlock FontSize="8" Text="{local:Loc Battery.Store}"/>
</TextBlock>
<Button.Style>
<Style TargetType="{x:Type Button}">
Expand Down Expand Up @@ -302,14 +411,14 @@

</Grid>
<Button x:Name="DevSiteButton"
Content="제작자 사이트 (pbj.kr)"
Content="{local:Loc Battery.DeveloperSite}"
Foreground="#FFB2B2B2"
BorderBrush="Transparent"
FontSize="9"
Width="103"
Width="120"
HorizontalAlignment="Right"
Margin="0,23,13,0"
Click="DevSiteButton_Click" Height="22" VerticalAlignment="Top">
Margin="0,21,13,0"
Click="DevSiteButton_Click" Height="26" VerticalAlignment="Top">
<Button.Style>
<Style TargetType="{x:Type Button}">
<Setter Property="Background" Value="#282828"/>
Expand All @@ -336,5 +445,16 @@
</Style>
</Button.Style>
</Button>
<ComboBox x:Name="LanguageSelector"
Style="{StaticResource DarkComboBoxStyle}"
Foreground="White"
Width="120"
Height="26"
VerticalAlignment="Top"
HorizontalAlignment="Right"
Margin="0,54,13,0"
SelectedValuePath="Tag"
SelectionChanged="LanguageSelector_SelectionChanged">
</ComboBox>
</Grid>
</Window>
</Window>
Loading
Loading