Skip to content

Commit

Permalink
commonized homepage events, continued on profiels page
Browse files Browse the repository at this point in the history
  • Loading branch information
project-sbc committed Aug 3, 2022
1 parent ce8a52a commit a426502
Show file tree
Hide file tree
Showing 5 changed files with 175 additions and 102 deletions.
10 changes: 5 additions & 5 deletions PowerControlPanel/Pages/HomePage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<Label Content="Brightness" VerticalContentAlignment="Center" DockPanel.Dock="Left" HorizontalAlignment="Left" FontSize="20"/>

<TextBlock DockPanel.Dock="Right" HorizontalAlignment="Right" VerticalAlignment="Center" FontFamily="Segoe MDL2 Assets" Text="&#xE706;" FontSize="30" Margin="8,0,0,0"/>
<Slider x:Name="Brightness" DockPanel.Dock="Right" HorizontalAlignment="Right" VerticalAlignment="Center" Thumb.DragCompleted="Brightness_DragCompleted" Thumb.DragStarted="Brightness_DragStarted" Width="230" Height="40" IsSnapToTickEnabled="True" Maximum="100" Value="{Binding ElementName=txtsliderBrightness, Path=Content}" SmallChange="1" TickPlacement="None" ValueChanged="Brightness_ValueChanged" MouseLeftButtonUp="Brightness_MouseLeftButtonUp" AutoToolTipPlacement="TopLeft" Loaded="Slider_Loaded" />
<Slider x:Name="Brightness" DockPanel.Dock="Right" HorizontalAlignment="Right" VerticalAlignment="Center" Thumb.DragCompleted="Slider_DragCompleted" Thumb.DragStarted="Slider_DragStarted" Width="230" Height="40" IsSnapToTickEnabled="True" Maximum="100" SmallChange="1" TickPlacement="None" ValueChanged="Slider_ValueChanged" MouseLeftButtonUp="Slider_MouseLeftButtonUp" AutoToolTipPlacement="TopLeft" Loaded="Slider_Loaded" TouchUp="Slider_TouchUp" TouchDown="Slider_TouchDown" />


</DockPanel>
Expand All @@ -66,7 +66,7 @@

</Label>
<TextBlock DockPanel.Dock="Right" HorizontalAlignment="Right" VerticalAlignment="Center" FontFamily="Segoe MDL2 Assets" Text="&#xE767;" FontSize="30" Margin="8,0,0,0"/>
<Slider x:Name="Volume" DockPanel.Dock="Right" HorizontalAlignment="Right" VerticalAlignment="Center" Thumb.DragCompleted="Volume_DragCompleted" Thumb.DragStarted="Volume_DragStarted" Width="230" Height="40" IsSnapToTickEnabled="True" Maximum="100" Value="{Binding ElementName=txtsliderVolume, Path=Content}" SmallChange="1" TickPlacement="None" ValueChanged="Volume_ValueChanged" MouseLeftButtonUp="Volume_MouseLeftButtonUp" AutoToolTipPlacement="TopLeft" Loaded="Slider_Loaded" >
<Slider x:Name="Volume" DockPanel.Dock="Right" HorizontalAlignment="Right" VerticalAlignment="Center" Thumb.DragCompleted="Slider_DragCompleted" Thumb.DragStarted="Slider_DragStarted" Width="230" Height="40" IsSnapToTickEnabled="True" Maximum="100" SmallChange="1" TickPlacement="None" ValueChanged="Slider_ValueChanged" MouseLeftButtonUp="Slider_MouseLeftButtonUp" TouchUp="Slider_TouchUp" TouchDown="Slider_TouchDown" AutoToolTipPlacement="TopLeft" Loaded="Slider_Loaded" >


</Slider>
Expand Down Expand Up @@ -108,7 +108,7 @@

</Label>
<Label x:Name="txtsliderTDP1" DockPanel.Dock="Right" HorizontalAlignment="Right" Width="40" FontSize="17" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Content="{Binding ElementName=TDP1, Path=Value}"/>
<Slider x:Name="TDP1" DockPanel.Dock="Right" HorizontalAlignment="Right" Thumb.DragCompleted="TDP1_DragCompleted" Thumb.DragStarted="TDP1_DragStarted" Width="230" Height="40" Minimum="5" Maximum="35" Value="{Binding ElementName=txtsliderTDP1, Path=Content}" SmallChange="1" TickPlacement="None" ValueChanged="TDP1_ValueChanged" MouseLeftButtonUp="TDP1_MouseLeftButtonUp" TouchUp="TDP1_TouchUp" TouchDown="TDP1_TouchDown" IsSnapToTickEnabled="True" AutoToolTipPlacement="TopLeft" Loaded="Slider_Loaded" />
<Slider x:Name="TDP1" DockPanel.Dock="Right" HorizontalAlignment="Right" Thumb.DragCompleted="Slider_DragCompleted" Thumb.DragStarted="Slider_DragStarted" Width="230" Height="40" Minimum="5" Maximum="35" SmallChange="1" TickPlacement="None" ValueChanged="Slider_ValueChanged" MouseLeftButtonUp="Slider_MouseLeftButtonUp" TouchUp="Slider_TouchUp" TouchDown="Slider_TouchDown" IsSnapToTickEnabled="True" AutoToolTipPlacement="TopLeft" Loaded="Slider_Loaded" />

</DockPanel>

Expand All @@ -118,7 +118,7 @@
</Label>

<Label x:Name="txtsliderTDP2" DockPanel.Dock="Right" Width="40" FontSize="17" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Content="{Binding ElementName=TDP2, Path=Value}"/>
<Slider x:Name="TDP2" DockPanel.Dock="Right" Thumb.DragCompleted="TDP2_DragCompleted" Height="25" Thumb.DragStarted="TDP2_DragStarted" Width="230" Minimum="5" IsSnapToTickEnabled="True" Maximum="35" Value="{Binding ElementName=txtsliderTDP2, Path=Content}" SmallChange="1" TickPlacement="None" ValueChanged="TDP2_ValueChanged" MouseLeftButtonUp="TDP2_MouseLeftButtonUp" HorizontalAlignment="Right" TouchDown="TDP2_TouchDown" TouchUp="TDP2_TouchUp" AutoToolTipPlacement="TopLeft" Loaded="Slider_Loaded" >
<Slider x:Name="TDP2" DockPanel.Dock="Right" Thumb.DragCompleted="Slider_DragCompleted" Height="25" Thumb.DragStarted="Slider_DragStarted" Width="230" Minimum="5" IsSnapToTickEnabled="True" Maximum="35" SmallChange="1" TickPlacement="None" ValueChanged="Slider_ValueChanged" MouseLeftButtonUp="Slider_MouseLeftButtonUp" HorizontalAlignment="Right" TouchDown="Slider_TouchDown" TouchUp="Slider_TouchUp" AutoToolTipPlacement="TopLeft" Loaded="Slider_Loaded" >

</Slider>
</DockPanel>
Expand Down Expand Up @@ -157,7 +157,7 @@

</Label>
<Label x:Name="txtsliderAMDGPUCLK" DockPanel.Dock="Right" HorizontalAlignment="Right" Width="40" FontSize="12" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Content=""/>
<Slider x:Name="GPUCLK" DockPanel.Dock="Right" HorizontalAlignment="Right" Thumb.DragCompleted="GPUCLK_DragCompleted" Thumb.DragStarted="GPUCLK_DragStarted" Width="230" Height="40" Minimum="200" Maximum="2200" Value="{Binding ElementName=txtsliderAMDGPUCLK, Path=Content}" SmallChange="50" TickPlacement="None" ValueChanged="GPUCLK_ValueChanged" MouseLeftButtonUp="GPUCLK_MouseLeftButtonUp" TouchUp="GPUCLK_TouchUp" TouchDown="GPUCLK_TouchDown" IsSnapToTickEnabled="True" AutoToolTipPlacement="TopLeft" Loaded="Slider_Loaded" LargeChange="50" TickFrequency="50" />
<Slider x:Name="GPUCLK" DockPanel.Dock="Right" HorizontalAlignment="Right" Thumb.DragCompleted="Slider_DragCompleted" Thumb.DragStarted="Slider_DragStarted" Width="230" Height="40" Minimum="200" Maximum="2200" SmallChange="50" TickPlacement="None" ValueChanged="Slider_ValueChanged" MouseLeftButtonUp="Slider_MouseLeftButtonUp" TouchUp="Slider_TouchUp" TouchDown="Slider_TouchDown" IsSnapToTickEnabled="True" AutoToolTipPlacement="TopLeft" Loaded="Slider_Loaded" LargeChange="50" TickFrequency="50" />
<Label x:Name="txtsliderAMDGPUCLKDEF" DockPanel.Dock="Right" HorizontalAlignment="Right" Width="70" FontSize="17" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Content="Default"/>
</DockPanel>

Expand Down
69 changes: 6 additions & 63 deletions PowerControlPanel/Pages/HomePage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -403,26 +403,7 @@ private void Slider_ValueChanged(object sender, RoutedPropertyChangedEventArgs<d

}
}
private void TDP1_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
Slider_ValueChanged(sender, e);
}
private void TDP2_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
Slider_ValueChanged(sender, e);
}
private void Brightness_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
Slider_ValueChanged(sender, e);
}
private void GPUCLK_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
Slider_ValueChanged(sender, e);
}
private void Volume_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e)
{
Slider_ValueChanged(sender, e);
}

#endregion

#region slider drag completed
Expand Down Expand Up @@ -464,29 +445,8 @@ private void Slider_DragCompleted(object sender, System.Windows.Controls.Primiti
}

}
private void TDP1_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e)
{
Slider_DragCompleted(sender, e);
}
private void TDP2_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e)
{
Slider_DragCompleted(sender, e);
}
private void Brightness_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e)
{
Slider_DragCompleted(sender, e);

}
private void Volume_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e)
{
Slider_DragCompleted(sender, e);

}
private void GPUCLK_DragCompleted(object sender, System.Windows.Controls.Primitives.DragCompletedEventArgs e)
{
Slider_DragCompleted(sender, e);

}


#endregion

#region slider drag started
Expand Down Expand Up @@ -523,26 +483,7 @@ private void Slider_DragStarted(object sender, System.Windows.Controls.Primitive

}

private void TDP1_DragStarted(object sender, System.Windows.Controls.Primitives.DragStartedEventArgs e)
{
Slider_DragStarted(sender, e);
}
private void TDP2_DragStarted(object sender, System.Windows.Controls.Primitives.DragStartedEventArgs e)
{
Slider_DragStarted(sender, e);
}
private void Brightness_DragStarted(object sender, System.Windows.Controls.Primitives.DragStartedEventArgs e)
{
Slider_DragStarted(sender, e);
}
private void Volume_DragStarted(object sender, System.Windows.Controls.Primitives.DragStartedEventArgs e)
{
Slider_DragStarted(sender, e);
}
private void GPUCLK_DragStarted(object sender, System.Windows.Controls.Primitives.DragStartedEventArgs e)
{
Slider_DragStarted(sender, e);
}

#endregion

#region slider mouse left up
Expand Down Expand Up @@ -895,5 +836,7 @@ private void Page_Loaded(object sender, RoutedEventArgs e)
{
handleVisibility();
}


}
}
Loading

0 comments on commit a426502

Please sign in to comment.