Skip to content

Commit

Permalink
Add option for reload config
Browse files Browse the repository at this point in the history
  • Loading branch information
cezarypiatek committed Jun 23, 2022
1 parent 92b7136 commit 2ab5569
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ public void OpenSettingsWindow()
window.Show();
}

public void RefreshSettings() => BuildUi();


public bool SelectedActionInstalled
{
get => _selectedActionInstalled;
Expand Down
36 changes: 18 additions & 18 deletions src/ScriptRunner/ScriptRunner.GUI/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,29 @@

</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="*" MinHeight="40"></RowDefinition>
<RowDefinition Height="3"></RowDefinition>
<RowDefinition Height="300" ></RowDefinition>
</Grid.RowDefinitions>

<DockPanel Grid.Column="0" Classes="actionsMenu" LastChildFill="True">
<!-- List of available actions, selectable -->
<StackPanel DockPanel.Dock="Top" >
<ListBox Items="{Binding Actions}" SelectedItem="{Binding SelectedAction, Mode=TwoWay}">
<ListBox.DataTemplates>
<DataTemplate>
<TextBlock Text="{Binding Name}"></TextBlock>
</DataTemplate>
</ListBox.DataTemplates>
</ListBox>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="*"></RowDefinition>
<RowDefinition Height="Auto"></RowDefinition>
</Grid.RowDefinitions>
<!-- List of available actions, selectable -->
<ListBox Items="{Binding Actions}" SelectedItem="{Binding SelectedAction, Mode=TwoWay}">
<ListBox.DataTemplates>
<DataTemplate>
<TextBlock Text="{Binding Name}"></TextBlock>
</DataTemplate>
</ListBox.DataTemplates>
</ListBox>
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" VerticalAlignment="Bottom" Grid.Row="1">
<Button i:Attached.Icon="fas fa-cog" Margin="5" Height="35" Width="50" FontSize="18" Command="{Binding OpenSettingsWindow}" ToolTip.Tip="Configure actions sources"/>
<Button i:Attached.Icon="fas fa-sync" Height="35" Width="50" FontSize="18" Command="{Binding RefreshSettings}" ToolTip.Tip="Refresh actions" />
</StackPanel>

<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" VerticalAlignment="Bottom">
<Button i:Attached.Icon="fas fa-cog" Height="35" Width="50" FontSize="18"
Command="{Binding OpenSettingsWindow}" />
</StackPanel>
</DockPanel>

</Grid>
<GridSplitter Grid.Column="1" Grid.Row="0" ResizeDirection="Columns"></GridSplitter>
<!-- Below instead of stack panel will be Reactive UI View Host displaying current action props-->
<ScrollViewer Grid.Column="2">
Expand Down

0 comments on commit 2ab5569

Please sign in to comment.