Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move priority buttons to left, add dynamic sytling. Closes #4647
- Loading branch information
Showing
9 changed files
with
297 additions
and
52 deletions.
There are no files selected for viewing
129 changes: 88 additions & 41 deletions
129
Rubberduck.Core/UI/AddRemoveReferences/AddRemoveReferencesWindow.xaml
Large diffs are not rendered by default.
Oops, something went wrong.
62 changes: 62 additions & 0 deletions
62
Rubberduck.Core/UI/AddRemoveReferences/PriorityButtonImageSourceConverter.cs
This file contains 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,62 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Windows.Data; | ||
using System.Windows.Media; | ||
using Rubberduck.AddRemoveReferences; | ||
using ImageSourceConverter = Rubberduck.UI.Converters.ImageSourceConverter; | ||
|
||
namespace Rubberduck.UI.AddRemoveReferences | ||
{ | ||
public class PriorityButtonImageSourceConverter : ImageSourceConverter, IMultiValueConverter | ||
{ | ||
private enum IconKey | ||
{ | ||
None, | ||
MoveUp, | ||
MoveUpDim, | ||
MoveDown, | ||
MoveDownDim | ||
} | ||
|
||
private readonly IDictionary<IconKey, ImageSource> _icons = new Dictionary<IconKey, ImageSource> | ||
{ | ||
{ IconKey.None, null }, | ||
{ IconKey.MoveUp , ToImageSource(Resources.RubberduckUI.arrow_090) }, | ||
{ IconKey.MoveUpDim, ToImageSource(Resources.RubberduckUI.arrow_090_dimmed) }, | ||
{ IconKey.MoveDown, ToImageSource(Resources.RubberduckUI.arrow_270) }, | ||
{ IconKey.MoveDownDim, ToImageSource(Resources.RubberduckUI.arrow_270_dimmed) } | ||
}; | ||
|
||
public override object Convert(object value, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
return _icons[IconKey.None]; | ||
} | ||
|
||
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) | ||
{ | ||
if (values is null || | ||
values.Length != 2 || | ||
!(values[1] is ReferenceModel reference) || //DataContext | ||
reference.IsBuiltIn || | ||
!(parameter is string direction)) | ||
{ | ||
return _icons[IconKey.None]; | ||
} | ||
|
||
var mouseOver = (bool)values[0]; | ||
|
||
if (mouseOver) | ||
{ | ||
return direction.Equals("Up") ? _icons[IconKey.MoveUp] : _icons[IconKey.MoveDown]; | ||
} | ||
|
||
return direction.Equals("Up") ? _icons[IconKey.MoveUpDim] : _icons[IconKey.MoveDownDim]; | ||
} | ||
|
||
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
} | ||
} |
This file contains 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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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