Skip to content

Commit

Permalink
Merge pull request #489 from mcneel/dev/1.x/482
Browse files Browse the repository at this point in the history
Update window no longer masks release info button - Fixes issue #482
  • Loading branch information
eirannejad committed Sep 8, 2021
2 parents 9e9b61e + de7845b commit b51ded4
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions src/RhinoInside.Revit/UI/Forms/AddInOptionsDialog.cs
Expand Up @@ -25,7 +25,7 @@ internal class AddInOptionsDialog : ModalDialog
private TabPage _scripts;
private TabControl _tabs;

public AddInOptionsDialog(UIApplication uiApp) : base(uiApp, initialSize: new Size(470, -1))
public AddInOptionsDialog(UIApplication uiApp) : base(uiApp, initialSize: new Size(470, 450))
{
Title = "Options";
DefaultButton.Click += OkButton_Click;
Expand Down Expand Up @@ -159,7 +159,7 @@ internal class UpdatesPanel : Panel
readonly DropDown _updateChannelSelector = new DropDown() { Height = 25 };
readonly Button _releaseNotesBtn = new Button { Text = "Release Notes", Height = 25 };
readonly Button _downloadBtn = new Button { Text = "Download Installer", Height = 25 };
readonly StackLayout _prevChannelsInfo = new StackLayout();
readonly Panel _prevChannelsInfo = new Panel();
static readonly Spinner _prevChannelsInfoSpinner = new Spinner { Visible = false, Enabled = true };
readonly StackLayout _prevChannelsInfoLabel = new StackLayout
{
Expand All @@ -171,7 +171,7 @@ internal class UpdatesPanel : Panel
}
};

TableRow _releaseInfoPanel = null;
TableRow _releaseInfoPanel = new TableRow();
internal ReleaseInfo ReleaseInfo = null;

void InitLayout()
Expand All @@ -185,7 +185,8 @@ void InitLayout()
foreach (AddinUpdateChannel channel in AddinUpdater.Channels)
{
_updateChannelSelector.Items.Add(
new ImageListItem {
new ImageListItem
{
Image = Icon.FromResource(channel.IconResource, execAssm).WithSize(16, 16),
Text = channel.Name
}
Expand Down Expand Up @@ -235,9 +236,9 @@ void InitLayout()
Cells = { _prevChannelsInfoLabel }
},
new TableRow {
ScaleHeight = false,
Cells = { _prevChannelsInfo }
},
null
}
};

Expand Down Expand Up @@ -277,10 +278,7 @@ private async void UpdatePreviousChannelsInfo(List<AddinUpdateChannel> prevChann
{
if (prevChannels.Count > 0)
{
_prevChannelsInfoLabel.Visible = true;
_prevChannelsInfoSpinner.Visible = true;
_prevChannelsInfo.Items.Clear();
_prevChannelsInfo.Visible = true;

var infoTable = new TableLayout();

Expand All @@ -297,7 +295,9 @@ private async void UpdatePreviousChannelsInfo(List<AddinUpdateChannel> prevChann
{
Cells =
{
new ImageView {
new ImageView
{
Width = 18,
Image = Icon.FromResource(
channel.IconResource, assembly: Assembly.GetExecutingAssembly()
).WithSize(16, 16),
Expand All @@ -307,16 +307,15 @@ private async void UpdatePreviousChannelsInfo(List<AddinUpdateChannel> prevChann
ScaleWidth = true,
Control = new Label { Text = channel.ReleaseName },
},
null,
downloadBtn,
new Panel { Width = 20 },
whatsNewButton
}
});
}

_prevChannelsInfo.Content = infoTable;
_prevChannelsInfoSpinner.Visible = false;
_prevChannelsInfo.Items.Add(infoTable);
}
else
{
Expand All @@ -334,7 +333,6 @@ internal void SetReleaseInfo(ReleaseInfo releaseInfo)

_releaseInfoPanel = new TableRow
{
ScaleHeight = true,
Cells = {
new Panel {
Content = new TableLayout {
Expand Down Expand Up @@ -363,8 +361,7 @@ internal void SetReleaseInfo(ReleaseInfo releaseInfo)
TextAlignment = TextAlignment.Center
},
_downloadBtn,
_releaseNotesBtn,
null
_releaseNotesBtn
}
}
}
Expand Down Expand Up @@ -466,8 +463,9 @@ private void AddButton_Click(object sender, EventArgs e)

if (sfdlg.Directory is string location)
{
foreach(var item in _scriptLocations.Items)
if (item.Text == location) {
foreach (var item in _scriptLocations.Items)
if (item.Text == location)
{
_scriptLocations.SelectedIndex = _scriptLocations.Items.IndexOf(item);
return;
}
Expand Down

0 comments on commit b51ded4

Please sign in to comment.