-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Fix OpenFile, SaveFile, Directory pickers style #622
base: develop
Are you sure you want to change the base?
Conversation
@@ -3,5 +3,8 @@ | |||
xmlns:controls="clr-namespace:Orc.Controls"> | |||
|
|||
<Style x:Key="{x:Type controls:SaveFilePicker}" | |||
TargetType="{x:Type controls:SaveFilePicker}"/> | |||
TargetType="{x:Type controls:SaveFilePicker}"> | |||
<Setter Property="Margin" Value="{DynamicResource Margin.TextBox}" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this setter to DefaultSaveFilePicker (See overall comments)
|
||
<Style x:Key="{x:Type controls:OpenFilePicker}" | ||
TargetType="{x:Type controls:OpenFilePicker}"> | ||
<Setter Property="Margin" Value="{DynamicResource Margin.TextBox}" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this setter to DefaultOpenFilePickerStyle (See overall comments)
|
||
<Style x:Key="{x:Type controls:DirectoryPicker}" | ||
TargetType="{x:Type controls:DirectoryPicker}"> | ||
<Setter Property="Margin" Value="{DynamicResource Margin.TextBox}" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this setter to DefaultDirectoryPickerStyle (See overall comments)
|
||
<TextBox AutomationProperties.AutomationId="{x:Static automation:OpenFilePickerMap.SelectedFileTextBoxId}" | ||
Grid.Column="1" | ||
IsReadOnly="True" | ||
Text="{Binding SelectedFileDisplayName, Mode=OneWay}" | ||
Height="{Binding ElementName=OpenFileButton, Path=ActualHeight}"/> | ||
Height="{Binding ElementName=OpenFileButton, Path=ActualHeight}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove it (and also remove it from other pickers, if they have it too) Binding to sizes 95% in cases is wrong solution. I understand that maybe it's not your code, but as long as we noticed it - we should get rid of it: please try to remove it or use VerticalAlignment=Stretch -> whatever will work
Another suggestion, but for other task -> as we working on OpenFilePicker/SaveFilePicker/Directory picker ... there is a lot of extra code here because we use MVVM approach here and controls are not extendable (changed control template, styles, attached events etc); so created issue for it https://sesolutions.atlassian.net/browse/ORCOMP-657 |
@@ -25,6 +25,7 @@ public OpenFilePicker() | |||
} | |||
|
|||
#region Properties | |||
[ObsoleteEx(Message = "This property will be deprecated", TreatAsErrorFromVersion ="4.9.0", RemoveInVersion = "6.0.0")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TreatAsErrorFromVersion ="5.0.0"
@@ -33,9 +34,11 @@ public double LabelWidth | |||
} | |||
|
|||
// Using a DependencyProperty as the backing store for LabelWidth. This enables animation, styling, binding, etc... | |||
[ObsoleteEx(Message = "This property will be deprecated", TreatAsErrorFromVersion ="4.9.0", RemoveInVersion = "6.0.0")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TreatAsErrorFromVersion ="5.0.0"
|
||
[ObsoleteEx(Message = "This property will be deprecated", TreatAsErrorFromVersion ="4.9.0", RemoveInVersion = "6.0.0")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TreatAsErrorFromVersion ="5.0.0"
@@ -44,6 +47,7 @@ public string LabelText | |||
} | |||
|
|||
// Using a DependencyProperty as the backing store for LabelText. This enables animation, styling, binding, etc... | |||
[ObsoleteEx(Message = "This property will be deprecated", TreatAsErrorFromVersion ="4.9.0", RemoveInVersion = "6.0.0")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TreatAsErrorFromVersion ="5.0.0"
@@ -24,24 +24,27 @@ public SaveFilePicker() | |||
InitializeComponent(); | |||
} | |||
|
|||
[ObsoleteEx(Message = "This property will be deprecated", TreatAsErrorFromVersion ="4.9.0", RemoveInVersion = "6.0.0")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TreatAsErrorFromVersion ="5.0.0"
[ViewToViewModel(MappingType = ViewToViewModelMappingType.TwoWayViewWins)] | ||
public string LabelText | ||
{ | ||
get { return (string)GetValue(LabelTextProperty); } | ||
set { SetValue(LabelTextProperty, value); } | ||
} | ||
|
||
[ObsoleteEx(Message = "This property will be deprecated", TreatAsErrorFromVersion ="4.9.0", RemoveInVersion = "6.0.0")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TreatAsErrorFromVersion ="5.0.0"
@@ -2,6 +2,8 @@ | |||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:Orc.Controls" xmlns:catel="http://schemas.catelproject.com" xmlns:automation="clr-namespace:Orc.Controls.Automation" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:converters="clr-namespace:Orc.Controls.Converters" xmlns:xamlbehaviors="http://schemas.microsoft.com/xaml/behaviors" xmlns:orctheming="http://schemas.wildgums.com/orc/theming"> | |||
<ResourceDictionary.MergedDictionaries> | |||
<ResourceDictionary Source="/Orc.Theming;component/themes/generic.xaml" /> | |||
<ResourceDictionary Source="/Orc.Controls;component/Controls/DirectoryPicker/Themes/DirectoryPicker.generic.xaml" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks as it something wrong with generated xaml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it should not be merged dictionaries ...because generated.xaml itself solves a problem with merged dictionaries
@@ -1481,6 +1482,9 @@ | |||
</Setter.Value> | |||
</Setter> | |||
</Style> | |||
<Style x:Key="{x:Type local:SaveFilePicker}" TargetType="{x:Type local:SaveFilePicker}"> | |||
<Setter Property="Margin" Value="{DynamicResource Margin.TextBox}" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is also strange...Margin should be only on Default***Style
<Label.Style> | ||
<Style TargetType="Label"> | ||
<Style.Triggers> | ||
<DataTrigger Binding="{Binding LabelText, Converter={catel:EmptyStringToCollapsingVisibilityConverter}}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how does the trigger works without Value property specified? (Same in other cases)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer not to use DataTrigger...why not use Content property and simple Trigger? (but as for me it's not critical as long as it would be deprecated)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another one: what if LabelWidth would be 0 -> what kind of margin it would be?
<Setter Property="Margin" Value="0"/> | ||
</DataTrigger> | ||
</Style.Triggers> | ||
</Style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please re-style the code
The buttons don't seem square? |
Description of Change
Fix styles to make it look more even
Issues Resolved
API Changes
None
Platforms Affected
Behavioral Changes
None
Testing Procedure
PR Checklist