Skip to content

Commit

Permalink
UI: clean up slider UI for shader translation delay
Browse files Browse the repository at this point in the history
  • Loading branch information
GreemDev committed Jan 1, 2025
1 parent 6286501 commit 3525d5e
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/Ryujinx/UI/ViewModels/SettingsHacksViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public bool ShaderTranslationDelayEnabled
}
}

public string ShaderTranslationDelayTooltipText => $"Current value: {ShaderTranslationDelay}";
public string ShaderTranslationDelayValueText => $"{ShaderTranslationDelay}ms";

public int ShaderTranslationDelay
{
Expand All @@ -49,7 +49,7 @@ public int ShaderTranslationDelay
{
_shaderTranslationSleepDelay = value;

OnPropertiesChanged(nameof(ShaderTranslationDelay), nameof(ShaderTranslationDelayTooltipText));
OnPropertiesChanged(nameof(ShaderTranslationDelay), nameof(ShaderTranslationDelayValueText));
}
}

Expand Down
36 changes: 21 additions & 15 deletions src/Ryujinx/UI/Views/Settings/SettingsHacksView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,27 @@
<TextBlock VerticalAlignment="Center"
Text="Arbitrary Delay on Shader Translation"/>
</StackPanel>
<Slider IsVisible="{Binding DirtyHacks.ShaderTranslationDelayEnabled}"
HorizontalAlignment="Center"
Value="{Binding DirtyHacks.ShaderTranslationDelay}"
ToolTip.Tip="{Binding DirtyHacks.ShaderTranslationDelayTooltipText}"
Width="175"
Margin="0,-3,0,0"
Height="32"
Padding="0,-5"
TickFrequency="1"
IsSnapToTickEnabled="True"
LargeChange="10"
SmallChange="1"
VerticalAlignment="Center"
Minimum="1"
Maximum="1000" />
<StackPanel
IsVisible="{Binding DirtyHacks.ShaderTranslationDelayEnabled}"
Margin="0,10,0,0"
Orientation="Horizontal"
HorizontalAlignment="Center">
<Slider HorizontalAlignment="Center"
Value="{Binding DirtyHacks.ShaderTranslationDelay}"
Width="175"
Margin="0,-3,0,0"
Height="32"
Padding="0,-5"
TickFrequency="1"
IsSnapToTickEnabled="True"
LargeChange="10"
SmallChange="1"
VerticalAlignment="Center"
Minimum="1"
Maximum="1000" />
<TextBlock Margin="5,0"
Text="{Binding DirtyHacks.ShaderTranslationDelayValueText}"/>
</StackPanel>
<Separator/>
</StackPanel>
</Border>
Expand Down

0 comments on commit 3525d5e

Please sign in to comment.