Skip to content

Commit c3ceed1

Browse files
committed
Revert "Allow adjustment of offset in settings file"
This reverts commit aafbdeb.
1 parent aafbdeb commit c3ceed1

File tree

4 files changed

+2
-16
lines changed

4 files changed

+2
-16
lines changed

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public class Settings : BaseModel
1515
private string language = "en";
1616
public string Hotkey { get; set; } = $"{KeyConstant.Alt} + {KeyConstant.Space}";
1717
public string OpenResultModifiers { get; set; } = KeyConstant.Alt;
18-
public int SuggestionTextOffset { get; set; } = 40;
1918
public string ColorScheme { get; set; } = "System";
2019
public bool ShowOpenResultHotkey { get; set; } = true;
2120
public double WindowSize { get; set; } = 580;

Flow.Launcher/Converters/QuerySuggestionBoxConverter.cs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,7 @@ public class QuerySuggestionBoxConverter : IMultiValueConverter
1212
{
1313
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
1414
{
15-
16-
if (values.Length != 4)
15+
if (values.Length != 3)
1716
{
1817
return string.Empty;
1918
}
@@ -54,10 +53,7 @@ public object Convert(object[] values, Type targetType, object parameter, Cultur
5453
// Check if Text will be larger then our QueryTextBox
5554
System.Windows.Media.Typeface typeface = new Typeface(QueryTextBox.FontFamily, QueryTextBox.FontStyle, QueryTextBox.FontWeight, QueryTextBox.FontStretch);
5655
System.Windows.Media.FormattedText ft = new FormattedText(QueryTextBox.Text, System.Globalization.CultureInfo.CurrentCulture, System.Windows.FlowDirection.LeftToRight, typeface, QueryTextBox.FontSize, Brushes.Black);
57-
58-
var FormatOffset = (int)values[3];
59-
60-
if ((ft.Width + FormatOffset) > QueryTextBox.ActualWidth || QueryTextBox.HorizontalOffset != 0)
56+
if ((ft.Width + 40) > QueryTextBox.ActualWidth || QueryTextBox.HorizontalOffset != 0)
6157
{
6258
return string.Empty;
6359
};

Flow.Launcher/MainWindow.xaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@
164164
<Binding ElementName="QueryTextBox" Mode="OneTime" />
165165
<Binding ElementName="ResultListBox" Path="SelectedItem" />
166166
<Binding ElementName="QueryTextBox" Path="Text" />
167-
<Binding Path="SuggestionTextOffset" />
168167
</MultiBinding>
169168
</TextBox.Text>
170169
</TextBox>

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ public MainViewModel(Settings settings)
8484
InitializeKeyCommands();
8585
RegisterViewUpdate();
8686
RegisterResultsUpdatedEvent();
87-
SetSuggestionTextOffset();
8887

8988
SetOpenResultModifiers();
9089
}
@@ -396,8 +395,6 @@ private ResultsViewModel SelectedResults
396395

397396
public double MainWindowWidth => _settings.WindowSize;
398397

399-
public int SuggestionTextOffset { get; set; }
400-
401398
public ICommand EscCommand { get; set; }
402399
public ICommand SelectNextItemCommand { get; set; }
403400
public ICommand SelectPrevItemCommand { get; set; }
@@ -723,11 +720,6 @@ private void SetOpenResultModifiers()
723720
OpenResultCommandModifiers = _settings.OpenResultModifiers ?? DefaultOpenResultModifiers;
724721
}
725722

726-
private void SetSuggestionTextOffset()
727-
{
728-
SuggestionTextOffset = _settings.SuggestionTextOffset;
729-
}
730-
731723
public void ToggleFlowLauncher()
732724
{
733725
if (!MainWindowVisibilityStatus)

0 commit comments

Comments
 (0)