-
Notifications
You must be signed in to change notification settings - Fork 6
Video processing slider dropdowns #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
19d988a
Dropdown sliders
meesoft 923927e
Delay frame update
meesoft bc2a994
Slider range from first clip
meesoft e0c6250
Don't format entered text
meesoft 10d285c
Handle Vaonis Vespera time format
meesoft c4d16ab
Update duration range
meesoft d6aae03
Dark frame to hot pixel
meesoft 5289616
Review fixes
meesoft 50d909a
Use instance flags
meesoft File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
PhotoLocator/Helpers/ColorToneControl.xaml → PhotoLocator/Controls/ColorToneControl.xaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
PhotoLocator/Helpers/CropControl.xaml → PhotoLocator/Controls/CropControl.xaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 3 additions & 2 deletions
5
PhotoLocator/Helpers/CropControl.xaml.cs → PhotoLocator/Controls/CropControl.xaml.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| <UserControl x:Class="PhotoLocator.Controls.DropDownSlider" | ||
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
| mc:Ignorable="d" d:DesignHeight="30" d:DesignWidth="200"> | ||
| <Grid Width="Auto"> | ||
| <Grid.ColumnDefinitions> | ||
| <ColumnDefinition /> | ||
| <ColumnDefinition Width="22" /> | ||
| </Grid.ColumnDefinitions> | ||
|
|
||
| <TextBox Text="{Binding Text, RelativeSource={RelativeSource AncestorType=UserControl}, Mode=TwoWay, UpdateSourceTrigger=LostFocus}" | ||
| IsEnabled="{Binding IsEnabled, RelativeSource={RelativeSource AncestorType=UserControl}}" | ||
| VerticalContentAlignment="Center" /> | ||
|
|
||
| <ToggleButton x:Name="DropToggle" Grid.Column="1" Width="20" Margin="2,0,0,0" FontFamily="Segoe UI Symbol" FontSize="12" Content="⏷" | ||
| IsEnabled="{Binding IsEnabled, RelativeSource={RelativeSource AncestorType=UserControl}}"/> | ||
|
|
||
| <Popup IsOpen="{Binding IsChecked, ElementName=DropToggle}" PlacementTarget="{Binding ElementName=DropToggle}" | ||
| StaysOpen="False" AllowsTransparency="True" PopupAnimation="Fade"> | ||
| <Border Background="#FF222222" BorderBrush="Gray" BorderThickness="1" Padding="8" CornerRadius="4"> | ||
| <StackPanel Width="260"> | ||
| <Slider Minimum="{Binding Minimum, RelativeSource={RelativeSource AncestorType=UserControl}}" | ||
| Maximum="{Binding Maximum, RelativeSource={RelativeSource AncestorType=UserControl}}" | ||
| Value="{Binding NumericValue, RelativeSource={RelativeSource AncestorType=UserControl}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" | ||
| TickPlacement="BottomRight" | ||
| TickFrequency="{Binding TickFrequency, RelativeSource={RelativeSource AncestorType=UserControl}}" IsSnapToTickEnabled="False" /> | ||
| <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,6,0,0"> | ||
| <TextBlock Foreground="#FFEEEEEE" Margin="0,0,6,0" Text="{Binding FormattedNumericValue, RelativeSource={RelativeSource AncestorType=UserControl}}" /> | ||
| </StackPanel> | ||
| </StackPanel> | ||
| </Border> | ||
| </Popup> | ||
| </Grid> | ||
| </UserControl> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,87 @@ | ||
| using System; | ||
| using System.Globalization; | ||
| using System.Windows; | ||
| using System.Windows.Controls; | ||
|
|
||
| namespace PhotoLocator.Controls; | ||
|
|
||
| public partial class DropDownSlider : UserControl | ||
| { | ||
| bool _onTextChangedRunning, _onNumericValueChangedRunning; | ||
|
|
||
| public DropDownSlider() | ||
| { | ||
| InitializeComponent(); | ||
| } | ||
|
|
||
| public static readonly DependencyProperty TextProperty = DependencyProperty.Register( | ||
| nameof(Text), typeof(string), typeof(DropDownSlider), new FrameworkPropertyMetadata(string.Empty, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnTextChanged)); | ||
|
|
||
| public string Text | ||
| { | ||
| get => (string)GetValue(TextProperty); | ||
| set => SetValue(TextProperty, value); | ||
| } | ||
|
|
||
| static void OnTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | ||
| { | ||
| if (d is not DropDownSlider control || control._onNumericValueChangedRunning) | ||
| return; | ||
| if (double.TryParse(control.Text, NumberStyles.Float, CultureInfo.InvariantCulture, out var v)) | ||
| { | ||
| control._onTextChangedRunning = true; | ||
| control.NumericValue = Math.Clamp(v, control.Minimum, control.Maximum); | ||
| control._onTextChangedRunning = false; | ||
| } | ||
| } | ||
|
|
||
| public static readonly DependencyProperty MinimumProperty = DependencyProperty.Register( | ||
| nameof(Minimum), typeof(double), typeof(DropDownSlider), new PropertyMetadata(0.0)); | ||
| public double Minimum { get => (double)GetValue(MinimumProperty); set => SetValue(MinimumProperty, value); } | ||
|
|
||
| public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register( | ||
| nameof(Maximum), typeof(double), typeof(DropDownSlider), new PropertyMetadata(100.0)); | ||
| public double Maximum { get => (double)GetValue(MaximumProperty); set => SetValue(MaximumProperty, value); } | ||
meesoft marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| public static readonly DependencyProperty TickFrequencyProperty = DependencyProperty.Register( | ||
| nameof(TickFrequency), typeof(double), typeof(DropDownSlider), new PropertyMetadata(1.0)); | ||
| public double TickFrequency { get => (double)GetValue(TickFrequencyProperty); set => SetValue(TickFrequencyProperty, value); } | ||
|
|
||
| public static readonly DependencyProperty NumericValueProperty = DependencyProperty.Register( | ||
| nameof(NumericValue), typeof(double), typeof(DropDownSlider), new FrameworkPropertyMetadata(0.0, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault, OnNumericValueChanged)); | ||
| public double NumericValue { get => (double)GetValue(NumericValueProperty); set => SetValue(NumericValueProperty, value); } | ||
|
|
||
| public static readonly DependencyProperty DecimalsProperty = DependencyProperty.Register( | ||
| nameof(Decimals), typeof(int), typeof(DropDownSlider), new PropertyMetadata(1, OnFormatChanged)); | ||
| public int Decimals { get => (int)GetValue(DecimalsProperty); set => SetValue(DecimalsProperty, value); } | ||
|
|
||
| public static readonly DependencyProperty SliderValueUnitsProperty = DependencyProperty.Register( | ||
| nameof(SliderValueUnits), typeof(string), typeof(DropDownSlider), new PropertyMetadata(string.Empty, OnFormatChanged)); | ||
| public string SliderValueUnits { get => (string)GetValue(SliderValueUnitsProperty); set => SetValue(SliderValueUnitsProperty, value); } | ||
|
|
||
| static void OnFormatChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | ||
| { | ||
| if (d is DropDownSlider control) | ||
| control.UpdateFormattedValue(); | ||
| } | ||
|
|
||
| public static readonly DependencyProperty FormattedNumericValueProperty = DependencyProperty.Register( | ||
| nameof(FormattedNumericValue), typeof(string), typeof(DropDownSlider), new PropertyMetadata(string.Empty)); | ||
| public string FormattedNumericValue { get => (string)GetValue(FormattedNumericValueProperty); private set => SetValue(FormattedNumericValueProperty, value); } | ||
|
|
||
| static void OnNumericValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | ||
| { | ||
| if (d is not DropDownSlider control) | ||
| return; | ||
| control._onNumericValueChangedRunning = true; | ||
| if (!control._onTextChangedRunning) | ||
| control.Text = control.NumericValue.ToString("F" + control.Decimals.ToString(CultureInfo.InvariantCulture), CultureInfo.InvariantCulture); | ||
| control.UpdateFormattedValue(); | ||
| control._onNumericValueChangedRunning = false; | ||
| } | ||
|
|
||
| void UpdateFormattedValue() | ||
| { | ||
| FormattedNumericValue = NumericValue.ToString("F" + Decimals.ToString(CultureInfo.InvariantCulture), CultureInfo.CurrentCulture) + SliderValueUnits; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.