Skip to content

Commit

Permalink
Add ko-fi button to settings view
Browse files Browse the repository at this point in the history
  • Loading branch information
G-Stas committed Sep 13, 2021
1 parent c8591af commit 9b10d8f
Show file tree
Hide file tree
Showing 25 changed files with 226 additions and 19 deletions.
7 changes: 7 additions & 0 deletions Volumey/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,13 @@
<BitmapImage x:Key="TrayMuteDark" UriSource="/Resources/Icons/TrayDark/mute.ico" />
<BitmapImage x:Key="TrayNoDeviceDark" UriSource="Resources/Icons/TrayDark/no-device.ico" />

<BitmapImage x:Key="Mug" UriSource="Resources/Icons/ButtonIcon/mug.png" />
<BitmapImage x:Key="MugEmpty" UriSource="Resources/Icons/ButtonIcon/mugEmpty.png" />
<BitmapImage x:Key="MugDark" UriSource="Resources/Icons/ButtonIcon/mug-dark.png" />
<BitmapImage x:Key="MugEmptyDark" UriSource="Resources/Icons/ButtonIcon/mugEmpty-dark.png" />
<BitmapImage x:Key="GitHub" UriSource="Resources/Icons/ButtonIcon/github.png" />
<BitmapImage x:Key="GitHubDark" UriSource="Resources/Icons/ButtonIcon/github-dark.png" />

<!--override default style properties-->
<CornerRadius x:Key="SliderThumbCornerRadius">4</CornerRadius>
<system:Double x:Key="SliderHorizontalThumbWidth">8</system:Double>
Expand Down
Binary file added Volumey/Resources/Icons/ButtonIcon/github-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Volumey/Resources/Icons/ButtonIcon/github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Volumey/Resources/Icons/ButtonIcon/mug-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Volumey/Resources/Icons/ButtonIcon/mug.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Volumey/Resources/Icons/ButtonIcon/mugEmpty-dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Volumey/Resources/Icons/ButtonIcon/mugEmpty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Volumey/Resources/Resources.de.resx
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,7 @@
<data name="Settings_VolumeLimit" xml:space="preserve">
<value>Begrenzen Sie das Volumen der gestarteten App auf 100%</value>
</data>
<data name="Settings_Tip" xml:space="preserve">
<value>Kauf mir einen Kaffee :)</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Volumey/Resources/Resources.en.resx
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,7 @@
<data name="Settings_AppsHotkeys" xml:space="preserve">
<value>Hotkeys for apps</value>
</data>
<data name="Settings_Tip" xml:space="preserve">
<value>Buy me a coffee :)</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Volumey/Resources/Resources.es.resx
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,7 @@
<data name="Settings_VolumeLimit" xml:space="preserve">
<value>Limite el volumen de la aplicación iniciada si es del 100%</value>
</data>
<data name="Settings_Tip" xml:space="preserve">
<value>Cómprame un café :)</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Volumey/Resources/Resources.fr.resx
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,7 @@
<data name="Settings_VolumeLimit" xml:space="preserve">
<value>Limiter le volume de l'application lancée s'il est de 100%</value>
</data>
<data name="Settings_Tip" xml:space="preserve">
<value>Achetez-moi un café :)</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Volumey/Resources/Resources.hi.resx
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,7 @@
<data name="Settings_VolumeLimit" xml:space="preserve">
<value>100% होने पर लॉन्च किए गए ऐप की मात्रा को सीमित करें</value>
</data>
<data name="Settings_Tip" xml:space="preserve">
<value>मुझे एक कॉफी खरीदो :)</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Volumey/Resources/Resources.it.resx
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,7 @@
<data name="Settings_VolumeLimit" xml:space="preserve">
<value>Limita il volume dell'app avviata se è del 100%</value>
</data>
<data name="Settings_Tip" xml:space="preserve">
<value>Offrimi un caffè :)</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Volumey/Resources/Resources.ja.resx
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,7 @@
<data name="Settings_VolumeLimit" xml:space="preserve">
<value>100%の場合、起動するアプリのボリュームを制限します</value>
</data>
<data name="Settings_Tip" xml:space="preserve">
<value>私にコーヒーを買ってください:)</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Volumey/Resources/Resources.pt.resx
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,7 @@
<data name="Settings_VolumeLimit" xml:space="preserve">
<value>Limite o volume do aplicativo iniciado se for 100%</value>
</data>
<data name="Settings_Tip" xml:space="preserve">
<value>Compre-me um café :)</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Volumey/Resources/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -111,4 +111,7 @@
<data name="Settings_AppsHotkeys" xml:space="preserve">
<value />
</data>
<data name="Settings_Tip" xml:space="preserve">
<value></value>
</data>
</root>
3 changes: 3 additions & 0 deletions Volumey/Resources/Resources.ru.resx
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,7 @@
<data name="Settings_AppsHotkeys" xml:space="preserve">
<value>Хоткеи для приложений</value>
</data>
<data name="Settings_Tip" xml:space="preserve">
<value>Купите мне кофе :)</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Volumey/Resources/Resources.tr.resx
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,7 @@
<data name="TrayMenu_SoundSettings" xml:space="preserve">
<value>Ses ayarları</value>
</data>
<data name="Settings_Tip" xml:space="preserve">
<value>Bana bir kahve ısmarla :)</value>
</data>
</root>
3 changes: 3 additions & 0 deletions Volumey/Resources/Resources.zh.resx
Original file line number Diff line number Diff line change
Expand Up @@ -154,4 +154,7 @@
<data name="Settings_VolumeLimit" xml:space="preserve">
<value>限制启动的应用程序量(如果为100%)</value>
</data>
<data name="Settings_Tip" xml:space="preserve">
<value>给我买杯咖啡:)</value>
</data>
</root>
63 changes: 63 additions & 0 deletions Volumey/View/Converters/ButtonIconThemeConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media.Imaging;
using Volumey.DataProvider;

namespace Volumey.View.Converters
{
public class ButtonIconThemeConverter : IMultiValueConverter
{
private BitmapImage mug;
private BitmapImage MugIcon => mug ??= App.Current.FindResource("Mug") as BitmapImage;

private BitmapImage mugEmpty;
private BitmapImage MugEmptyIcon => mugEmpty ??= App.Current.FindResource("MugEmpty") as BitmapImage;

private BitmapImage mugDark;
private BitmapImage MugIconDark => mugDark ??= App.Current.FindResource("MugDark") as BitmapImage;

private BitmapImage mugEmptyDark;
private BitmapImage MugEmptyIconDark => mugEmptyDark ??= App.Current.FindResource("MugEmptyDark") as BitmapImage;

private BitmapImage lightGit;
private BitmapImage LightGitIcon => lightGit ??= App.Current.FindResource("GitHub") as BitmapImage;

private BitmapImage darkGit;
private BitmapImage DarkGitIcon => darkGit ??= App.Current.FindResource("GitHubDark") as BitmapImage;

public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
try
{
var theme = AppTheme.Light;
if(values[0] is AppTheme selectedTheme)
{
if(selectedTheme == AppTheme.System && values[1] is AppTheme windowsTheme)
theme = windowsTheme;
else
theme = selectedTheme;
}

if(parameter.Equals("Mug") && values[2] is bool isMouseOver)
return GetMugIcon(theme, isMouseOver);
if(parameter.Equals("Git"))
return theme == AppTheme.Dark ? LightGitIcon : DarkGitIcon;
}
catch { }
return Binding.DoNothing;
}

private BitmapImage GetMugIcon(AppTheme theme, bool isMouseOver)
=> theme == AppTheme.Dark ? GetLightMugIcon(isMouseOver) : GetDarkMugIcon(isMouseOver);

private BitmapImage GetDarkMugIcon(bool isMouseOver)
=> isMouseOver ? MugIconDark : MugEmptyIconDark;

private BitmapImage GetLightMugIcon(bool isMouseOver)
=> isMouseOver ? MugIcon : MugEmptyIcon;

public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
=> new object[] { };
}
}
5 changes: 3 additions & 2 deletions Volumey/View/MainView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,11 @@
</ui:NavigationView.MenuItems>

<ui:Frame
x:Name="ContentFrame"/>
x:Name="ContentFrame"
Margin="0 0 0 7"/>

<ui:NavigationView.Resources>
<!-- override defualt NavigationView resource -->
<!-- override default NavigationView resource -->
<SolidColorBrush x:Key="NavigationViewTopPaneBackground" Color="Transparent" />
</ui:NavigationView.Resources>
</ui:NavigationView>
Expand Down
3 changes: 1 addition & 2 deletions Volumey/View/SessionsListView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
<ItemsControl
x:Name="ItemsControl"
ItemsSource="{Binding SelectedDevice.Sessions}"
Width="Auto"
Margin="0 0 0 10">
Width="Auto">
<ItemsControl.ItemTemplate>
<DataTemplate>
<Grid
Expand Down
Loading

0 comments on commit 9b10d8f

Please sign in to comment.