- Remove Comment

- Add String "Window Width Size"
This commit is contained in:
DB p 2021-10-21 18:31:14 +09:00
parent 6af1262ca6
commit 6b37adaf07
5 changed files with 10 additions and 19 deletions

View file

@ -189,20 +189,8 @@ namespace Flow.Launcher.Core.Resource
new[] { resultItemStyle, resultSubItemStyle, resultItemSelectedStyle, resultSubItemSelectedStyle, resultHotkeyItemStyle, resultHotkeyItemSelectedStyle }, o
=> Array.ForEach(setters, p => o.Setters.Add(p)));
}
/* Ignore Theme Window Width and use setting */
var windowStyle = dict["WindowStyle"] as Style;
/*
var width = windowStyle?.Setters.OfType<Setter>().Where(x => x.Property.Name == "Width")
.Select(x => x.Value).FirstOrDefault();
if (width == null)
{
windowStyle = dict["BaseWindowStyle"] as Style;
width = windowStyle?.Setters.OfType<Setter>().Where(x => x.Property.Name == "Width")
.Select(x => x.Value).FirstOrDefault();
}
*/
var width = Settings.WindowSize;
windowStyle.Setters.Add(new Setter(Window.WidthProperty, width));
mainWindowWidth = (double)width;

View file

@ -4,7 +4,7 @@ using System.Drawing;
using System.Text.Json.Serialization;
using Flow.Launcher.Plugin;
using Flow.Launcher.Plugin.SharedModels;
using Flow.Launcher;
namespace Flow.Launcher.Infrastructure.UserSettings
{
public class Settings : BaseModel

View file

@ -82,6 +82,7 @@
<system:String x:Key="deleteCustomHotkeyWarning">Are you sure you want to delete {0} plugin hotkey?</system:String>
<system:String x:Key="queryWindowShadowEffect">Query window shadow effect</system:String>
<system:String x:Key="shadowEffectCPUUsage">Shadow effect has a substantial usage of GPU. Not recommended if your computer performance is limited.</system:String>
<system:String x:Key="windowWidthSize">Window Width Size</system:String>
<system:String x:Key="useGlyphUI">Use Segoe Fluent Icons</system:String>
<system:String x:Key="useGlyphUIEffect">Use Segoe Fluent Icons for query results where supported</system:String>

View file

@ -677,13 +677,11 @@
<Border Style="{DynamicResource SettingGroupBox}" Margin="0 12 0 18">
<ItemsControl Style="{StaticResource SettingGrid}">
<StackPanel Style="{StaticResource TextPanel}">
<TextBlock Text="Window Width Size" Style="{DynamicResource SettingTitleLabel}"/>
<TextBlock Text="{DynamicResource windowWidthSize}" Style="{DynamicResource SettingTitleLabel}"/>
</StackPanel>
<!--<Button DockPanel.Dock="Top" Margin="0,0,18,0" Width="180" HorizontalAlignment="Center"
Click="OpenPluginFolder" Grid.Column="2">Open Theme Folder</Button>-->
<StackPanel Orientation="Horizontal" Grid.Column="2">
<TextBlock Text="{Binding ElementName=WindowWidthValue, Path=Value, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" TextAlignment="Right" Width="100" Margin="0 0 8 2"/>
<Slider Name="WindowWidthValue" Value="{Binding Settings.WindowSize, Mode=TwoWay}" Maximum="900" Minimum="400" Margin="0,0,18,0" TickFrequency="10" IsSnapToTickEnabled="True" Width="400"/>
<Slider Name="WindowWidthValue" Value="{Binding WindowWidthSize, Mode=TwoWay}" Maximum="900" Minimum="400" Margin="0,0,18,0" TickFrequency="10" IsSnapToTickEnabled="True" Width="300"/>
</StackPanel>
<TextBlock FontFamily="/Resources/#Segoe Fluent Icons" FontSize="20" Grid.Column="0" VerticalAlignment="Center" Margin="24 0 16 0">
&#xe740;

View file

@ -307,7 +307,11 @@ namespace Flow.Launcher.ViewModel
public double WindowWidthSize
{
get { return Settings.WindowSize; }
set { Settings.WindowSize = value;}
set
{
Settings.WindowSize = value;
ThemeManager.Instance.ChangeTheme(Settings.Theme);
}
}
public bool UseGlyphIcons