-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathToolStripSpringTextBox.cs
More file actions
89 lines (83 loc) · 2.74 KB
/
ToolStripSpringTextBox.cs
File metadata and controls
89 lines (83 loc) · 2.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
// Decompiled with JetBrains decompiler
// Type: OculusTrayTool.ToolStripSpringTextBox
// Assembly: OculusTrayTool, Version=0.87.8.0, Culture=neutral, PublicKeyToken=null
// MVID: E8946A27-16D6-4BF6-9D7B-70CB25A977E0
// Assembly location: C:\Program Files (x86)\Oculus Tray Tool\OculusTrayTool.exe
using Microsoft.VisualBasic.CompilerServices;
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;
using System.Windows.Forms.Layout;
#nullable disable
namespace OculusTrayTool
{
[DesignerGenerated]
public class ToolStripSpringTextBox : CueToolStripTextBox
{
private IContainer components;
public ToolStripSpringTextBox()
{
this.components = (IContainer) null;
this.InitializeComponent();
}
protected override void Dispose(bool disposing)
{
if (disposing && this.components != null)
this.components.Dispose();
base.Dispose(disposing);
}
private void InitializeComponent() => this.components = (IContainer) new System.ComponentModel.Container();
public override Size GetPreferredSize(Size constrainingSize)
{
if (this.IsOnOverflow || this.Owner.Orientation == Orientation.Vertical)
return this.DefaultSize;
int num1 = this.Owner.DisplayRectangle.Width;
Padding margin;
if (this.Owner.OverflowButton.Visible)
{
int num2 = checked (num1 - this.Owner.OverflowButton.Width);
margin = this.Owner.OverflowButton.Margin;
int horizontal = margin.Horizontal;
num1 = checked (num2 - horizontal);
}
int num3 = 0;
foreach (ToolStripItem toolStripItem in (ArrangedElementCollection) this.Owner.Items)
{
if (!toolStripItem.IsOnOverflow)
{
if (toolStripItem is ToolStripSpringTextBox)
{
checked { ++num3; }
int num4 = num1;
margin = toolStripItem.Margin;
int horizontal = margin.Horizontal;
num1 = checked (num4 - horizontal);
}
else
{
int num5 = checked (num1 - toolStripItem.Width);
margin = toolStripItem.Margin;
int horizontal = margin.Horizontal;
num1 = checked (num5 - horizontal);
}
}
}
if (num3 > 1)
num1 = checked ((int) Math.Round(unchecked ((double) num1 / (double) num3)));
int num6 = num1;
Size defaultSize = this.DefaultSize;
int width = defaultSize.Width;
if (num6 < width)
{
defaultSize = this.DefaultSize;
num1 = defaultSize.Width;
}
return base.GetPreferredSize(constrainingSize) with
{
Width = checked (num1 - 8)
};
}
}
}