mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Fix memory leak in ResultViewModel
This commit is contained in:
parent
94df8d9085
commit
83bc664a30
2 changed files with 5 additions and 38 deletions
|
|
@ -175,7 +175,7 @@
|
|||
Margin="0,0,0,1"
|
||||
VerticalAlignment="Bottom"
|
||||
DockPanel.Dock="Left"
|
||||
FontSize="{Binding ResultItemFontSize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
FontSize="{Binding Settings.ResultItemFontSize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="False"
|
||||
Style="{DynamicResource ItemTitleStyle}"
|
||||
Text="{Binding Result.Title}"
|
||||
|
|
@ -194,7 +194,7 @@
|
|||
Grid.Row="1"
|
||||
Margin="0,1,0,0"
|
||||
VerticalAlignment="Top"
|
||||
FontSize="{Binding ResultSubItemFontSize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
FontSize="{Binding Settings.ResultSubItemFontSize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
|
||||
IsEnabled="False"
|
||||
Style="{DynamicResource ItemSubTitleStyle}"
|
||||
Text="{Binding Result.SubTitle}"
|
||||
|
|
@ -224,7 +224,7 @@
|
|||
<Style TargetType="{x:Type ListBoxItem}">
|
||||
<EventSetter Event="MouseEnter" Handler="OnMouseEnter" />
|
||||
<EventSetter Event="MouseMove" Handler="OnMouseMove" />
|
||||
<Setter Property="Height" Value="{Binding ItemHeightSize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Setter Property="Height" Value="{Binding Settings.ItemHeightSize, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Setter Property="Margin" Value="0" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="BorderThickness" Value="0" />
|
||||
|
|
|
|||
|
|
@ -21,22 +21,6 @@ namespace Flow.Launcher.ViewModel
|
|||
{
|
||||
Settings = settings;
|
||||
|
||||
Settings.PropertyChanged += (_, args) =>
|
||||
{
|
||||
switch (args.PropertyName)
|
||||
{
|
||||
case nameof(Settings.ItemHeightSize):
|
||||
OnPropertyChanged(nameof(ItemHeightSize));
|
||||
break;
|
||||
case nameof(Settings.ResultItemFontSize):
|
||||
OnPropertyChanged(nameof(ResultItemFontSize));
|
||||
break;
|
||||
case nameof(Settings.ResultSubItemFontSize):
|
||||
OnPropertyChanged(nameof(ResultSubItemFontSize));
|
||||
break;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
|
|
@ -46,7 +30,7 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
if (Result.Glyph is { FontFamily: not null } glyph)
|
||||
{
|
||||
// Checks if it's a system installed font, which does not require path to be provided.
|
||||
// Checks if it's a system installed font, which does not require path to be provided.
|
||||
if (glyph.FontFamily.EndsWith(".ttf") || glyph.FontFamily.EndsWith(".otf"))
|
||||
{
|
||||
string fontFamilyPath = glyph.FontFamily;
|
||||
|
|
@ -81,7 +65,7 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
}
|
||||
|
||||
private Settings Settings { get; }
|
||||
public Settings Settings { get; }
|
||||
|
||||
public Visibility ShowOpenResultHotkey =>
|
||||
Settings.ShowOpenResultHotkey ? Visibility.Visible : Visibility.Collapsed;
|
||||
|
|
@ -136,23 +120,6 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
}
|
||||
|
||||
public double ItemHeightSize
|
||||
{
|
||||
get => Settings.ItemHeightSize;
|
||||
set => Settings.ItemHeightSize = value;
|
||||
}
|
||||
|
||||
public double ResultItemFontSize
|
||||
{
|
||||
get => Settings.ResultItemFontSize;
|
||||
set => Settings.ResultItemFontSize = value;
|
||||
}
|
||||
|
||||
public double ResultSubItemFontSize
|
||||
{
|
||||
get => Settings.ResultSubItemFontSize;
|
||||
set => Settings.ResultSubItemFontSize = value;
|
||||
}
|
||||
public Visibility ShowGlyph
|
||||
{
|
||||
get
|
||||
|
|
|
|||
Loading…
Reference in a new issue