mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Implement temporary result list height increase when preview is on
This commit is contained in:
parent
de8c8bde76
commit
29be504789
2 changed files with 34 additions and 5 deletions
|
|
@ -143,15 +143,21 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
ContextMenu = new ResultsViewModel(Settings)
|
||||
{
|
||||
LeftClickResultCommand = OpenResultCommand, RightClickResultCommand = LoadContextMenuCommand
|
||||
LeftClickResultCommand = OpenResultCommand,
|
||||
RightClickResultCommand = LoadContextMenuCommand,
|
||||
IsPreviewOn = Settings.AlwaysPreview
|
||||
};
|
||||
Results = new ResultsViewModel(Settings)
|
||||
{
|
||||
LeftClickResultCommand = OpenResultCommand, RightClickResultCommand = LoadContextMenuCommand
|
||||
LeftClickResultCommand = OpenResultCommand,
|
||||
RightClickResultCommand = LoadContextMenuCommand,
|
||||
IsPreviewOn = Settings.AlwaysPreview
|
||||
};
|
||||
History = new ResultsViewModel(Settings)
|
||||
{
|
||||
LeftClickResultCommand = OpenResultCommand, RightClickResultCommand = LoadContextMenuCommand
|
||||
LeftClickResultCommand = OpenResultCommand,
|
||||
RightClickResultCommand = LoadContextMenuCommand,
|
||||
IsPreviewOn = Settings.AlwaysPreview
|
||||
};
|
||||
_selectedResults = Results;
|
||||
|
||||
|
|
@ -586,6 +592,10 @@ namespace Flow.Launcher.ViewModel
|
|||
{
|
||||
HidePreview();
|
||||
}
|
||||
|
||||
ContextMenu.IsPreviewOn = PreviewVisible;
|
||||
History.IsPreviewOn = PreviewVisible;
|
||||
Results.IsPreviewOn = PreviewVisible;
|
||||
}
|
||||
|
||||
private void ShowPreview()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using Flow.Launcher.Infrastructure.UserSettings;
|
||||
using System;
|
||||
using Flow.Launcher.Infrastructure.UserSettings;
|
||||
using Flow.Launcher.Plugin;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
|
|
@ -49,7 +50,25 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
#region Properties
|
||||
|
||||
public double MaxHeight => MaxResults * _settings.ItemHeightSize;
|
||||
public bool IsPreviewOn { get; set; }
|
||||
|
||||
public double MaxHeight
|
||||
{
|
||||
get
|
||||
{
|
||||
var newResultsCount = MaxResults;
|
||||
if (IsPreviewOn)
|
||||
{
|
||||
newResultsCount = (int)Math.Ceiling(380 / _settings.ItemHeightSize);
|
||||
if (newResultsCount < MaxResults)
|
||||
{
|
||||
newResultsCount = MaxResults;
|
||||
}
|
||||
}
|
||||
return newResultsCount * _settings.ItemHeightSize;
|
||||
}
|
||||
}
|
||||
|
||||
public double ItemHeightSize
|
||||
{
|
||||
get => _settings.ItemHeightSize;
|
||||
|
|
|
|||
Loading…
Reference in a new issue