mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Finish the binding part of global browser
This commit is contained in:
parent
a1af487449
commit
399c3c9752
3 changed files with 1005 additions and 1375 deletions
|
|
@ -84,7 +84,7 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
|
||||
public int CustomBrowserIndex { get; set; } = 0;
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public CustomBrowserViewModel CustomBrowser
|
||||
{
|
||||
get => CustomBrowserList[CustomBrowserIndex];
|
||||
|
|
@ -96,7 +96,9 @@ namespace Flow.Launcher.Infrastructure.UserSettings
|
|||
new()
|
||||
{
|
||||
Name = "Default",
|
||||
Path = "",
|
||||
Path = "*",
|
||||
PrivateArg = "*",
|
||||
EnablePrivate = false,
|
||||
Editable = false
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,91 +1,77 @@
|
|||
<Window
|
||||
x:Class="Flow.Launcher.SelectBrowserWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Flow.Launcher"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||
Title="{DynamicResource defaultBrowserTitle}"
|
||||
Background="#f3f3f3"
|
||||
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
||||
ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<Window x:Class="Flow.Launcher.SelectBrowserWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:Flow.Launcher"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||
Title="{DynamicResource defaultBrowserTitle}"
|
||||
Background="#f3f3f3"
|
||||
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
||||
ResizeMode="NoResize"
|
||||
SizeToContent="WidthAndHeight"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<Grid Width="530">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="80" />
|
||||
</Grid.RowDefinitions>
|
||||
<Border
|
||||
Padding="26,26,26,0"
|
||||
Background="#ffffff"
|
||||
BorderBrush="#e5e5e5"
|
||||
BorderThickness="0,0,0,1">
|
||||
<Border Padding="26,26,26,0"
|
||||
Background="#ffffff"
|
||||
BorderBrush="#e5e5e5"
|
||||
BorderThickness="0,0,0,1">
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<StackPanel Grid.Row="0" Margin="0,0,0,12">
|
||||
<TextBlock
|
||||
Grid.Column="0"
|
||||
Margin="0,0,0,0"
|
||||
FontFamily="Segoe UI"
|
||||
FontSize="20"
|
||||
FontWeight="SemiBold"
|
||||
Text="{DynamicResource defaultBrowserTitle}"
|
||||
TextAlignment="Left" />
|
||||
<TextBlock Grid.Column="0"
|
||||
Margin="0,0,0,0"
|
||||
FontFamily="Segoe UI"
|
||||
FontSize="20"
|
||||
FontWeight="SemiBold"
|
||||
Text="{DynamicResource defaultBrowserTitle}"
|
||||
TextAlignment="Left" />
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<TextBlock
|
||||
FontSize="14"
|
||||
Foreground="#1b1b1b"
|
||||
Text="{DynamicResource defaultBrowser_tips}"
|
||||
TextAlignment="Left"
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
<TextBlock FontSize="14"
|
||||
Foreground="#1b1b1b"
|
||||
Text="{DynamicResource defaultBrowser_tips}"
|
||||
TextAlignment="Left"
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Margin="14,28,0,0" Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="{DynamicResource defaultBrowser_name}" />
|
||||
<ComboBox
|
||||
Name="comboBox"
|
||||
Width="200"
|
||||
Height="35"
|
||||
Margin="14,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
ItemsSource="{Binding CustomBrowsers}"
|
||||
SelectedIndex="{Binding SelectedCustomBrowserIndex}">
|
||||
<TextBlock Grid.Column="1"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="{DynamicResource defaultBrowser_name}" />
|
||||
<ComboBox Name="comboBox"
|
||||
Width="200"
|
||||
Height="35"
|
||||
Margin="14,0,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
ItemsSource="{Binding CustomBrowsers}"
|
||||
SelectedIndex="{Binding SelectedCustomBrowserIndex}">
|
||||
<ComboBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Name}" />
|
||||
</DataTemplate>
|
||||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
<Button
|
||||
Margin="10,0,0,0"
|
||||
Click="btnAdd_Click"
|
||||
Content="{DynamicResource add}" />
|
||||
<Button
|
||||
Margin="10,0,0,0"
|
||||
Click="btnDelete_Click"
|
||||
Content="{DynamicResource delete}"
|
||||
IsEnabled="{Binding CustomExplorer.Editable}" />
|
||||
<Button Margin="10,0,0,0" Click="btnAdd_Click" Content="{DynamicResource add}" />
|
||||
<Button Margin="10,0,0,0"
|
||||
Click="btnDelete_Click"
|
||||
Content="{DynamicResource delete}"
|
||||
IsEnabled="{Binding CustomExplorer.Editable}" />
|
||||
|
||||
</StackPanel>
|
||||
<Rectangle
|
||||
Height="1"
|
||||
Margin="0,20,0,12"
|
||||
Fill="#cecece" />
|
||||
<StackPanel
|
||||
Margin="0,0,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
DataContext="{Binding CustomExplorer}"
|
||||
Orientation="Horizontal">
|
||||
<Rectangle Height="1" Margin="0,20,0,12" Fill="#cecece" />
|
||||
<StackPanel Margin="0,0,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
DataContext="{Binding CustomExplorer}"
|
||||
Orientation="Horizontal">
|
||||
<Grid Width="480">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="150" />
|
||||
|
|
@ -97,99 +83,86 @@
|
|||
<RowDefinition />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Margin="14,5,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="{DynamicResource defaultBrowser_profile_name}" />
|
||||
<TextBox
|
||||
x:Name="ProfileTextBox"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Width="Auto"
|
||||
Margin="10,5,15,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
IsEnabled="{Binding Editable}"
|
||||
Text="{Binding Name}" />
|
||||
<TextBlock
|
||||
Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="14,10,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="{DynamicResource defaultBrowser_path}" />
|
||||
<TextBox
|
||||
x:Name="PathTextBox"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="Auto"
|
||||
Margin="10,10,15,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
IsEnabled="{Binding Editable}"
|
||||
Text="{Binding Path}" />
|
||||
<StackPanel
|
||||
Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Margin="14,10,14,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<TextBlock Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Margin="14,5,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="{DynamicResource defaultBrowser_profile_name}" />
|
||||
<TextBox x:Name="ProfileTextBox"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Width="Auto"
|
||||
Margin="10,5,15,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
IsEnabled="{Binding Editable}"
|
||||
Text="{Binding Name}" />
|
||||
<TextBlock Grid.Row="1"
|
||||
Grid.Column="0"
|
||||
Margin="14,10,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="{DynamicResource defaultBrowser_path}" />
|
||||
<TextBox x:Name="PathTextBox"
|
||||
Grid.Row="1"
|
||||
Grid.Column="1"
|
||||
Width="Auto"
|
||||
Margin="10,10,15,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
IsEnabled="{Binding Editable}"
|
||||
Text="{Binding Path}" />
|
||||
<StackPanel Grid.Row="2"
|
||||
Grid.Column="1"
|
||||
Margin="14,10,14,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<RadioButton GroupName="browser" IsChecked="True">New Tab</RadioButton>
|
||||
<RadioButton GroupName="browser">New Window</RadioButton>
|
||||
</StackPanel>
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
Margin="14,10,0,20"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="{DynamicResource defaultBrowser_parameter}" />
|
||||
<StackPanel
|
||||
Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Margin="0,10,0,15"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<TextBox
|
||||
x:Name="fileArgTextBox"
|
||||
Width="180"
|
||||
Margin="10,0,0,0"
|
||||
IsEnabled="{Binding Editable}"
|
||||
Text="{Binding FileArgument}" />
|
||||
<CheckBox Margin="12,0,0,0" VerticalAlignment="Center" />
|
||||
<TextBlock Grid.Row="3"
|
||||
Grid.Column="0"
|
||||
Margin="14,10,0,20"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Text="{DynamicResource defaultBrowser_parameter}" />
|
||||
<StackPanel Grid.Row="3"
|
||||
Grid.Column="1"
|
||||
Margin="0,10,0,15"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<TextBox x:Name="fileArgTextBox"
|
||||
Width="180"
|
||||
Margin="10,0,0,0"
|
||||
IsEnabled="{Binding Editable}"
|
||||
Text="{Binding PrivateArg}" />
|
||||
<CheckBox Margin="12,0,0,0" VerticalAlignment="Center" IsChecked="{Binding EnablePrivate}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
<StackPanel
|
||||
Grid.Row="1"
|
||||
HorizontalAlignment="Center"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnCancel"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="0,0,5,0"
|
||||
Click="btnCancel_Click"
|
||||
Content="{DynamicResource cancel}" />
|
||||
<Button
|
||||
x:Name="btnDone"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="5,0,0,0"
|
||||
Click="btnDone_Click"
|
||||
Content="{DynamicResource done}"
|
||||
ForceCursor="True">
|
||||
<StackPanel Grid.Row="1" HorizontalAlignment="Center" Orientation="Horizontal">
|
||||
<Button x:Name="btnCancel"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="0,0,5,0"
|
||||
Click="btnCancel_Click"
|
||||
Content="{DynamicResource cancel}" />
|
||||
<Button x:Name="btnDone"
|
||||
Width="100"
|
||||
Height="30"
|
||||
Margin="5,0,0,0"
|
||||
Click="btnDone_Click"
|
||||
Content="{DynamicResource done}"
|
||||
ForceCursor="True">
|
||||
<Button.Style>
|
||||
<Style BasedOn="{StaticResource DefaultButtonStyle}" TargetType="{x:Type Button}">
|
||||
<Style.Triggers>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue