/ src / Ryujinx.Gtk3 / UI / Windows / UserProfilesManagerWindow.Designer.cs
UserProfilesManagerWindow.Designer.cs
  1  using Gtk;
  2  using Pango;
  3  using System;
  4  
  5  namespace Ryujinx.UI.Windows
  6  {
  7      public partial class UserProfilesManagerWindow : Window
  8      {
  9          private Box _mainBox;
 10          private Label _selectedLabel;
 11          private Box _selectedUserBox;
 12          private Image _selectedUserImage;
 13          private Box _selectedUserInfoBox;
 14          private Entry _selectedUserNameEntry;
 15          private Label _selectedUserIdLabel;
 16          private Box _selectedUserButtonsBox;
 17          private Button _saveProfileNameButton;
 18          private Button _changeProfileImageButton;
 19          private Box _usersTreeViewBox;
 20          private Label _availableUsersLabel;
 21          private ScrolledWindow _usersTreeViewWindow;
 22          private ListStore _tableStore;
 23          private TreeView _usersTreeView;
 24          private Box _bottomBox;
 25          private Button _addButton;
 26          private Button _deleteButton;
 27          private Button _closeButton;
 28  
 29          private void InitializeComponent()
 30          {
 31              //
 32              // UserProfilesManagerWindow
 33              //
 34              CanFocus = false;
 35              Resizable = false;
 36              Modal = true;
 37              WindowPosition = WindowPosition.Center;
 38              DefaultWidth = 620;
 39              DefaultHeight = 548;
 40              TypeHint = Gdk.WindowTypeHint.Dialog;
 41  
 42              //
 43              // _mainBox
 44              //
 45              _mainBox = new Box(Orientation.Vertical, 0);
 46  
 47              //
 48              // _selectedLabel
 49              //
 50              _selectedLabel = new Label("Selected User Profile:")
 51              {
 52                  Margin = 15,
 53                  Attributes = new AttrList(),
 54                  Halign = Align.Start,
 55              };
 56              _selectedLabel.Attributes.Insert(new Pango.AttrWeight(Weight.Bold));
 57  
 58              //
 59              // _viewBox
 60              //
 61              _usersTreeViewBox = new Box(Orientation.Vertical, 0);
 62  
 63              //
 64              // _SelectedUserBox
 65              //
 66              _selectedUserBox = new Box(Orientation.Horizontal, 0)
 67              {
 68                  MarginStart = 30,
 69              };
 70  
 71              //
 72              // _selectedUserImage
 73              //
 74              _selectedUserImage = new Image();
 75  
 76              //
 77              // _selectedUserInfoBox
 78              //
 79              _selectedUserInfoBox = new Box(Orientation.Vertical, 0)
 80              {
 81                  Homogeneous = true,
 82              };
 83  
 84              //
 85              // _selectedUserNameEntry
 86              //
 87              _selectedUserNameEntry = new Entry("")
 88              {
 89                  MarginStart = 15,
 90                  MaxLength = (int)MaxProfileNameLength,
 91              };
 92              _selectedUserNameEntry.KeyReleaseEvent += SelectedUserNameEntry_KeyReleaseEvent;
 93  
 94              //
 95              // _selectedUserIdLabel
 96              //
 97              _selectedUserIdLabel = new Label("")
 98              {
 99                  MarginTop = 15,
100                  MarginStart = 15,
101              };
102  
103              //
104              // _selectedUserButtonsBox
105              //
106              _selectedUserButtonsBox = new Box(Orientation.Vertical, 0)
107              {
108                  MarginEnd = 30,
109              };
110  
111              //
112              // _saveProfileNameButton
113              //
114              _saveProfileNameButton = new Button()
115              {
116                  Label = "Save Profile Name",
117                  CanFocus = true,
118                  ReceivesDefault = true,
119                  Sensitive = false,
120              };
121              _saveProfileNameButton.Clicked += EditProfileNameButton_Pressed;
122  
123              //
124              // _changeProfileImageButton
125              //
126              _changeProfileImageButton = new Button()
127              {
128                  Label = "Change Profile Image",
129                  CanFocus = true,
130                  ReceivesDefault = true,
131                  MarginTop = 10,
132              };
133              _changeProfileImageButton.Clicked += ChangeProfileImageButton_Pressed;
134  
135              //
136              // _availableUsersLabel
137              //
138              _availableUsersLabel = new Label("Available User Profiles:")
139              {
140                  Margin = 15,
141                  Attributes = new AttrList(),
142                  Halign = Align.Start,
143              };
144              _availableUsersLabel.Attributes.Insert(new Pango.AttrWeight(Weight.Bold));
145  
146              //
147              // _usersTreeViewWindow
148              //
149              _usersTreeViewWindow = new ScrolledWindow()
150              {
151                  ShadowType = ShadowType.In,
152                  CanFocus = true,
153                  Expand = true,
154                  MarginStart = 30,
155                  MarginEnd = 30,
156                  MarginBottom = 15,
157              };
158  
159              //
160              // _tableStore
161              //
162              _tableStore = new ListStore(typeof(bool), typeof(Gdk.Pixbuf), typeof(string), typeof(Gdk.RGBA));
163  
164              //
165              // _usersTreeView
166              //
167              _usersTreeView = new TreeView(_tableStore)
168              {
169                  HoverSelection = true,
170                  HeadersVisible = false,
171              };
172              _usersTreeView.RowActivated += UsersTreeView_Activated;
173  
174              //
175              // _bottomBox
176              //
177              _bottomBox = new Box(Orientation.Horizontal, 0)
178              {
179                  MarginStart = 30,
180                  MarginEnd = 30,
181                  MarginBottom = 15,
182              };
183  
184              //
185              // _addButton
186              //
187              _addButton = new Button()
188              {
189                  Label = "Add New Profile",
190                  CanFocus = true,
191                  ReceivesDefault = true,
192                  HeightRequest = 35,
193              };
194              _addButton.Clicked += AddButton_Pressed;
195  
196              //
197              // _deleteButton
198              //
199              _deleteButton = new Button()
200              {
201                  Label = "Delete Selected Profile",
202                  CanFocus = true,
203                  ReceivesDefault = true,
204                  HeightRequest = 35,
205                  MarginStart = 10,
206              };
207              _deleteButton.Clicked += DeleteButton_Pressed;
208  
209              //
210              // _closeButton
211              //
212              _closeButton = new Button()
213              {
214                  Label = "Close",
215                  CanFocus = true,
216                  ReceivesDefault = true,
217                  HeightRequest = 35,
218                  WidthRequest = 80,
219              };
220              _closeButton.Clicked += CloseButton_Pressed;
221  
222              ShowComponent();
223          }
224  
225          private void ShowComponent()
226          {
227              _usersTreeViewWindow.Add(_usersTreeView);
228  
229              _usersTreeViewBox.Add(_usersTreeViewWindow);
230              _bottomBox.PackStart(_addButton, false, false, 0);
231              _bottomBox.PackStart(_deleteButton, false, false, 0);
232              _bottomBox.PackEnd(_closeButton, false, false, 0);
233  
234              _selectedUserInfoBox.Add(_selectedUserNameEntry);
235              _selectedUserInfoBox.Add(_selectedUserIdLabel);
236  
237              _selectedUserButtonsBox.Add(_saveProfileNameButton);
238              _selectedUserButtonsBox.Add(_changeProfileImageButton);
239  
240              _selectedUserBox.Add(_selectedUserImage);
241              _selectedUserBox.PackStart(_selectedUserInfoBox, false, false, 0);
242              _selectedUserBox.PackEnd(_selectedUserButtonsBox, false, false, 0);
243  
244              _mainBox.PackStart(_selectedLabel, false, false, 0);
245              _mainBox.PackStart(_selectedUserBox, false, true, 0);
246              _mainBox.PackStart(_availableUsersLabel, false, false, 0);
247              _mainBox.Add(_usersTreeViewBox);
248              _mainBox.Add(_bottomBox);
249  
250              Add(_mainBox);
251  
252              ShowAll();
253          }
254      }
255  }