Skip to content

Commit

Permalink
Disabled Row Count Setting when Location is Right or Left
Browse files Browse the repository at this point in the history
  • Loading branch information
Avid29 committed Oct 18, 2024
1 parent 1480f69 commit cfc0236
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 9 deletions.
21 changes: 21 additions & 0 deletions RetroBar/Converters/EdgeIsHorizontalConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using ManagedShell.AppBar;
using RetroBar.Utilities;
using System.Windows.Data;
using System;

namespace RetroBar.Converters
{
[ValueConversion(typeof(AppBarEdge), typeof(bool))]
public class EdgeIsHorizontalConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return Settings.Instance.Edge is AppBarEdge.Top or AppBarEdge.Bottom;
}

public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
19 changes: 10 additions & 9 deletions RetroBar/PropertiesWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<converters:BoolToInvertedVisibilityConverter x:Key="boolToInvertedVisibilityConverter" />
<converters:DoubleToPercentConverter x:Key="doubleToPercentConverter" />
<converters:EnumConverter x:Key="enumConverter" />
<converters:EdgeIsHorizontalConverter x:Key="isHorizontalConverter" />
<Style TargetType="{x:Type TextBlock}">
<Setter Property="VerticalAlignment"
Value="Center" />
Expand Down Expand Up @@ -203,6 +204,15 @@
SelectedIndex="{Binding Source={x:Static Settings:Settings.Instance}, Path=Edge, UpdateSourceTrigger=PropertyChanged, Converter={StaticResource enumConverter}}"
SelectionChanged="cboEdgeSelect_SelectionChanged" />
</DockPanel>
<DockPanel IsEnabled="{Binding Source={x:Static Settings:Settings.Instance}, Path=Edge, Converter={StaticResource isHorizontalConverter}}">
<Label VerticalAlignment="Center"
Target="{Binding ElementName=cboEdgeSelect}">
<AccessText Text="{DynamicResource rowcount_text}"
ToolTip="{DynamicResource rowcount_tip}" />
</Label>
<ComboBox ItemsSource="{DynamicResource rowcount_options}"
SelectedValue="{Binding Source={x:Static Settings:Settings.Instance}, Path=RowCount, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
<CheckBox IsChecked="{Binding Source={x:Static Settings:Settings.Instance}, Path=AllowFontSmoothing, UpdateSourceTrigger=PropertyChanged}">
<Label Content="{DynamicResource allow_font_smoothing}" />
</CheckBox>
Expand All @@ -229,15 +239,6 @@
IsChecked="{Binding Source={x:Static Settings:Settings.Instance}, Path=ShowTaskThumbnails, UpdateSourceTrigger=PropertyChanged}">
<Label Content="{DynamicResource show_window_previews}" />
</CheckBox>
<DockPanel>
<Label VerticalAlignment="Center"
Target="{Binding ElementName=cboEdgeSelect}">
<AccessText Text="{DynamicResource rowcount_text}"
ToolTip="{DynamicResource rowcount_tip}" />
</Label>
<ComboBox ItemsSource="{DynamicResource rowcount_options}"
SelectedValue="{Binding Source={x:Static Settings:Settings.Instance}, Path=RowCount, UpdateSourceTrigger=PropertyChanged}" />
</DockPanel>
</StackPanel>
</GroupBox>
<GroupBox Header="{DynamicResource notification_area}">
Expand Down

0 comments on commit cfc0236

Please sign in to comment.