Skip to content

Commit

Permalink
Minor changes to fixed window size
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonyCorbett committed Aug 4, 2021
1 parent 458ec7a commit c879e85
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 22 deletions.
9 changes: 0 additions & 9 deletions OnlyM/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 3 additions & 7 deletions OnlyM/Properties/Resources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -112,16 +112,16 @@
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="APP_VER" xml:space="preserve">
<value>OnlyM software version: {0}</value>
<comment>See Settings =&gt; Images. Please retain the "{0}" - it's a placeholder for the version number</comment>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="blank" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\blank.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
Expand Down Expand Up @@ -580,8 +580,4 @@
<value>Resizable</value>
<comment>See Settings =&gt; Display</comment>
</data>
<data name="MEDIA_WINDOW_RECOMMENDED_SIZE" xml:space="preserve">
<value>This is the recommended resolution, if you have a good internet connection.</value>
<comment>See Settings =&gt; Display</comment>
</data>
</root>
15 changes: 14 additions & 1 deletion OnlyM/ViewModel/SettingsViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,14 @@ public bool MediaWindowed
}
}

public bool Is360PSize => MediaWindowSize == Size360P;

public bool Is480PSize => MediaWindowSize == Size480P;

public bool Is720PSize => MediaWindowSize == Size720P;

public bool Is1080PSize => MediaWindowSize == Size1080P;

public bool MediaWindowResizable
{
get => MediaWindowSize.IsEmpty;
Expand Down Expand Up @@ -918,7 +926,7 @@ public int? MediaWindowWidth
get => MediaWindowSize.IsEmpty ? null : (int)MediaWindowSize.Width;
set => MediaWindowSize = value.HasValue ? new Size(value.Value, MediaWindowSize.Height) : Size.Empty;
}

public int? MediaWindowHeight
{
get => MediaWindowSize.IsEmpty ? null : (int)MediaWindowSize.Height;
Expand All @@ -937,6 +945,11 @@ public Size MediaWindowSize

OnPropertyChanged(nameof(MediaWindowWidth));
OnPropertyChanged(nameof(MediaWindowHeight));

OnPropertyChanged(nameof(Is360PSize));
OnPropertyChanged(nameof(Is480PSize));
OnPropertyChanged(nameof(Is720PSize));
OnPropertyChanged(nameof(Is1080PSize));
}
}

Expand Down
16 changes: 11 additions & 5 deletions OnlyM/Windows/SettingsPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,32 +169,38 @@
Style="{StaticResource SettingsRadioButtonStyle}" >
<StackPanel Orientation="Horizontal" IsEnabled="{Binding MediaWindowFixed, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}">
<TextBlock Text="{x:Static resx:Resources.MEDIA_WINDOW_FIXED_SIZE}" VerticalAlignment="Center" Margin="0,0,10,0" />
<TextBox Text="{Binding MediaWindowWidth, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" MinWidth="50" TextAlignment="Center" ></TextBox>
<TextBox Text="{Binding MediaWindowWidth, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
MinWidth="50" TextAlignment="Center" />

<TextBlock Text="x" VerticalAlignment="Center" Margin="10,0,10,0" />
<TextBox Text="{Binding MediaWindowHeight, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" MinWidth="50" TextAlignment="Center" ></TextBox>
<TextBox Text="{Binding MediaWindowHeight, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
MinWidth="50" TextAlignment="Center" />
</StackPanel>
</RadioButton>
<StackPanel Orientation="Horizontal" IsEnabled="{Binding MediaWindowFixed, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" Margin="20,0,0,0">
<Button
Style="{StaticResource MaterialDesignRaisedLightButton}"
Command="{Binding Set360PSizeCommand}"
IsEnabled="{Binding Is360PSize, Converter={StaticResource InvertBooleanConverter}}"
Content="360p" />
<Button
Style="{StaticResource MaterialDesignRaisedLightButton}"
Margin="10,0,0,0"
Command="{Binding Set480PSizeCommand}"
IsEnabled="{Binding Is480PSize, Converter={StaticResource InvertBooleanConverter}}"
Content="480p" />
<Button
Style="{StaticResource MaterialDesignRaisedDarkButton}"
Style="{StaticResource MaterialDesignRaisedLightButton}"
Margin="10,0,0,0"
Command="{Binding Set720PSizeCommand}"
IsEnabled="{Binding Is720PSize, Converter={StaticResource InvertBooleanConverter}}"
FontWeight="Bold"
Content="720p"
ToolTip="{x:Static resx:Resources.MEDIA_WINDOW_RECOMMENDED_SIZE}" />
Content="720p" />
<Button
Style="{StaticResource MaterialDesignRaisedLightButton}"
Margin="10,0,0,0"
Command="{Binding Set1080PSizeCommand}"
IsEnabled="{Binding Is1080PSize, Converter={StaticResource InvertBooleanConverter}}"
Content="1080p" />
</StackPanel>
</StackPanel>
Expand Down

0 comments on commit c879e85

Please sign in to comment.