Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/DynamoDS/Dynamo into temp…
Browse files Browse the repository at this point in the history
…late2
  • Loading branch information
zeusongit committed Mar 20, 2024
2 parents d54276c + ec6b87a commit cc470fa
Show file tree
Hide file tree
Showing 15 changed files with 1,001 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check_file_size.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
uses: actions/checkout@v4
- name: Get changed files
id: get_changed_files
uses: tj-actions/changed-files@v42
uses: tj-actions/changed-files@v43
with:
write_output_files: true
- name: List changed files
Expand Down
19 changes: 5 additions & 14 deletions src/DynamoCoreWpf/DynamoCoreWpf.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
</PropertyGroup>

<Target Name="NpmRunBuild" BeforeTargets="BeforeBuild">
<!--This command gets the latest build from the splash screen-->
<!--This command updates the npm registry configuration if necessary-->
<Exec Command="$(PowerShellCommand) -ExecutionPolicy ByPass -Command $(SolutionDir)\setnpmreg.ps1" />
<Exec Command="npm pack @dynamods/splash-screen@latest" />
<!--This command gets a specific splash screen build from npm-->
<Exec Command="npm pack @dynamods/[email protected]" />
</Target>

<Target Name="ExtractTGZFile" DependsOnTargets="NpmRunBuild" BeforeTargets="BeforeBuild">
Expand All @@ -33,11 +34,6 @@
<TGZFiles Include="./dynamods-splash-screen-*.tgz" />
</ItemGroup>

<!--Reverse the order of the files to get the higher version-->
<ItemGroup>
<Reversed Include="@(TGZFiles-&gt;Reverse())" />
</ItemGroup>

<PropertyGroup>
<Last>%(TGZFiles.Filename)</Last>
</PropertyGroup>
Expand All @@ -56,8 +52,8 @@
<Target Name="NpmRunBuildHomePage" BeforeTargets="BeforeBuild">
<!--This command updates the npm registry configuration if necessary-->
<Exec Command="$(PowerShellCommand) -ExecutionPolicy ByPass -Command $(SolutionDir)\setnpmreg.ps1" />
<!--Download the latest build of the Dynamo Home package-->
<Exec Command="npm pack @dynamods/dynamo-home@latest" />
<!--Download a specific build of the Dynamo Home package from npm-->
<Exec Command="npm pack @dynamods/dynamo-home@1.0.5" />
</Target>

<Target Name="ExtractTGZFileDynamoHome" DependsOnTargets="NpmRunBuildHomePage" BeforeTargets="BeforeBuild">
Expand All @@ -66,11 +62,6 @@
<TGZFilesDynamoHome Include="./dynamods-dynamo-home-*.tgz" />
</ItemGroup>

<!--Reverse the order of the files to get the higher version-->
<ItemGroup>
<ReversedDynamoHome Include="@(TGZFilesDynamoHome-&gt;Reverse())" />
</ItemGroup>

<PropertyGroup>
<Last>%(TGZFilesDynamoHome.Filename)</Last>
</PropertyGroup>
Expand Down
130 changes: 130 additions & 0 deletions src/DynamoCoreWpf/UI/Themes/Modern/DynamoModern.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,136 @@
</Setter>
<Style.Triggers />
</Style>


<!-- NodeView c ustomization styles -->
<ControlTemplate x:Key="NodeViewComboBoxToggleButton" TargetType="ToggleButton">
<Grid>
<Border x:Name="Border"
Background="#2a2a2a"
BorderThickness="0"/>
<Path x:Name="Arrow"
Margin="0 0 5 0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Data="M 0 0 L 4 4 L 8 0 Z"
Fill="#999" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="ToggleButton.IsMouseOver"
Value="true">
<Setter TargetName="Arrow"
Property="Fill"
Value="#fff" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>

<Style x:Key="NodeViewComboBox" TargetType="{x:Type ComboBox}">
<Setter Property="SnapsToDevicePixels" Value="true" />
<Setter Property="OverridesDefaultStyle" Value="true" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.CanContentScroll" Value="true" />
<Setter Property="MinWidth" Value="40" />
<Setter Property="Padding" Value="5 0" />
<Setter Property="MinHeight" Value="20" />
<Setter Property="MaxHeight" Value="30" />
<Setter Property="FontSize" Value="10" />
<Setter Property="Foreground" Value="#C7C7C7" />
<Setter Property="ItemContainerStyle" Value="{DynamicResource PackageManagerComboBoxItemStyle}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid>
<ToggleButton Name="ToggleButton"
Grid.Column="2"
ClickMode="Press"
Focusable="false"
IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
Template="{DynamicResource NodeViewComboBoxToggleButton}" />
<ContentPresenter Name="ContentSite"
Margin="5,3,12,3"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
ContentTemplateSelector="{TemplateBinding ItemTemplateSelector}"
IsHitTestVisible="False" />
<TextBox x:Name="PART_EditableTextBox"
Margin="3,3,23,3"
Padding="10"
HorizontalAlignment="Left"
VerticalAlignment="Center"
Background="#2a2a2a"
CaretBrush="#bbbbbb"
Focusable="True"
Foreground="#bbbbbb"
IsReadOnly="{TemplateBinding IsReadOnly}"
Style="{x:Null}"
Template="{StaticResource ComboBoxTextBox}"
Visibility="Hidden" />
<Popup Name="Popup"
AllowsTransparency="True"
Focusable="False"
IsOpen="{TemplateBinding IsDropDownOpen}"
Placement="Bottom"
PopupAnimation="Slide">
<Grid Name="DropDown"
MinWidth="{TemplateBinding ActualWidth}"
MaxHeight="{TemplateBinding MaxDropDownHeight}"
SnapsToDevicePixels="True">
<Border x:Name="DropDownBorder"
Background="#2a2a2a"
BorderBrush="Transparent"
BorderThickness="0" />
<ScrollViewer Margin="0,6,0,6"
SnapsToDevicePixels="True">
<StackPanel IsItemsHost="True"
KeyboardNavigation.DirectionalNavigation="Contained" />
</ScrollViewer>
</Grid>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="HasItems"
Value="false">
<Setter TargetName="DropDownBorder"
Property="MinHeight"
Value="95" />
</Trigger>
<Trigger Property="IsGrouping"
Value="true">
<Setter Property="ScrollViewer.CanContentScroll"
Value="false" />
</Trigger>
<Trigger SourceName="Popup"
Property="Popup.AllowsTransparency"
Value="true">
<Setter TargetName="DropDownBorder"
Property="CornerRadius"
Value="0" />
<Setter TargetName="DropDownBorder"
Property="Margin"
Value="0,0,0,0" />
</Trigger>
<Trigger Property="IsEditable"
Value="true">
<Setter Property="IsTabStop"
Value="false" />
<Setter TargetName="PART_EditableTextBox"
Property="Visibility"
Value="Visible" />
<Setter TargetName="ContentSite"
Property="Visibility"
Value="Hidden" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers />
</Style>
<!-- End Package Manager Styles -->
<Style x:Key="SComboBox_Update" TargetType="{x:Type ComboBox}">
<Setter Property="SnapsToDevicePixels" Value="true" />
Expand Down
2 changes: 2 additions & 0 deletions src/DynamoCoreWpf/ViewModels/Core/DynamoViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1845,6 +1845,8 @@ private void Open(object parameters)
commandString,
MessageBoxButton.OK,
MessageBoxImage.Error);

this.ShowStartPage = true; // Triggers start page change to notify the frontend
}
else
{
Expand Down
14 changes: 10 additions & 4 deletions src/DynamoCoreWpf/Views/SplashScreen/SplashScreen.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using System.Runtime.InteropServices;
using System.Windows;
using System.Xml.Serialization;
using Autodesk.DesignScript.Runtime;
using Dynamo.Configuration;
using Dynamo.Controls;
using Dynamo.Core;
Expand Down Expand Up @@ -218,8 +219,8 @@ private void WebView_NavigationCompleted(object sender, CoreWebView2NavigationCo
private void SplashScreenRequestClose(object sender, EventArgs e)
{
//This is only called when shutdownparams.closeDynamoView = true
//which is during tests or an exist command
//which is used rarely, during but we it is used when the Revit document is lost and Dynamo is open.
//which is during tests or an exit command
//which is used rarely, but it is used when the Revit document is lost and Dynamo is open.
CloseWindow();
viewModel.RequestClose -= SplashScreenRequestClose;
}
Expand Down Expand Up @@ -657,29 +658,34 @@ public ScriptObject(Action<bool> requestLaunchDynamo, Action<string> requestImpo
RequestSignOut = requestSignOut;
RequestCloseWindowPreserve = requestCloseWindow;
}

[DynamoJSInvokable]
public void LaunchDynamo(bool showScreenAgain)
{
RequestLaunchDynamo(showScreenAgain);
Analytics.TrackEvent(Actions.Start, Categories.SplashScreenOperations);
}

[DynamoJSInvokable]
public void ImportSettings(string file)
{
RequestImportSettings(file);
}
[DynamoJSInvokable]
public bool SignIn()
{
return RequestSignIn();
}
[DynamoJSInvokable]
public bool SignOut()
{
return RequestSignOut();
}
[Obsolete]
[DynamoJSInvokable]
public void CloseWindow()
{
RequestCloseWindow();
}
[DynamoJSInvokable]
public void CloseWindowPreserve(bool isCheckboxChecked)
{
RequestCloseWindowPreserve(isCheckboxChecked);
Expand Down
Loading

0 comments on commit cc470fa

Please sign in to comment.