@@ -32,75 +32,64 @@ public class Views.Form : Adw.Bin {
3232 critical (e. message);
3333 }
3434
35- var project_name_header = new Granite .HeaderLabel (_(" Project Name:" )) {
36- valign = CENTER
37- };
38-
39- var project_name_info = new Gtk .MenuButton () {
40- can_focus = false ,
41- hexpand = true ,
42- halign = END ,
43- icon_name = " dialog-information-symbolic" ,
44- popover = build_info_popover (_ ("A unique name that is used for the project folder and other resources . The name should be in lower case without spaces and should not start with a number "))
45- };
46- project_name_info.add_css_class (Granite .STYLE_CLASS_DIM_LABEL );
47- project_name_info.add_css_class (Granite .STYLE_CLASS_FLAT );
48-
49- var project_name_box = new Gtk .Box (Gtk . Orientation . HORIZONTAL , 0 ) {
50- margin_top = 12
51- };
52- project_name_box.append (project_name_header );
53- project_name_box.append (project_name_info );
54-
5535 project_name_entry = new Granite .ValidatedEntry () {
5636 regex = project_name_regex,
57- margin_top = 6
5837 };
5938
60- var project_name_invalid = new Widgets .InvalidLabel () {
61- text = _ ("Project name must start with a lowercase letter and contain only letters and numbers ")
39+ var project_name_header = new Granite .HeaderLabel (_(" Project Name" )) {
40+ mnemonic_widget = project_name_entry,
41+ secondary_text = _ ("A unique name that is used for the project folder and other resources . The name should be in lower case without spaces and should not start with a number ")
6242 };
6343
64- var identifier_header = new Granite . HeaderLabel (_( " Organization Identifier: " ) ) {
65- valign = CENTER
44+ var project_name_invalid = new Widgets . InvalidLabel ( ) {
45+ text = _ (" Project name must start with a lowercase letter and contain only letters and numbers ")
6646 };
6747
68- var identifier_info = new Gtk .MenuButton () {
69- can_focus = false ,
70- hexpand = true ,
71- halign = END ,
72- icon_name = " dialog-information-symbolic" ,
73- popover = build_info_popover (_ ("A reverse domain -name identifier used to identify the application , such as 'io .github .username '. It may not contain dashes "))
74- };
75- identifier_info.add_css_class (Granite .STYLE_CLASS_DIM_LABEL );
76- identifier_info.add_css_class (Granite .STYLE_CLASS_FLAT );
48+ var project_name_box = new Gtk .Box (VERTICAL , 6 );
49+ project_name_box.append (project_name_header );
50+ project_name_box.append (project_name_entry );
51+ project_name_box.append (project_name_invalid );
7752
78- var identifier_box = new Gtk .Box (Gtk . Orientation . HORIZONTAL , 0 ) {
79- margin_top = 12
53+ identifier_entry = new Granite .ValidatedEntry () {
54+ placeholder_text = " io.github.username" ,
55+ regex = identifier_regex
8056 };
81- identifier_box.append (identifier_header );
82- identifier_box.append (identifier_info );
8357
84- identifier_entry = new Granite .ValidatedEntry ( ) {
85- regex = identifier_regex ,
86- margin_top = 6
58+ var identifier_header = new Granite .HeaderLabel (_( " Organization Identifier " ) ) {
59+ secondary_text = _ (" A reverse domain - name identifier used to identify the application . It may not contain dashes ") ,
60+ mnemonic_widget = identifier_entry,
8761 };
8862
8963 var identifier_invalid = new Widgets .InvalidLabel () {
9064 text = _ ("App ID must start with a lowercase letter , use dots to separate parts , contain only letters and numbers , and replace hyphens (-) with underscores (_ )")
9165 };
9266
67+ var identifier_box = new Gtk .Box (VERTICAL , 6 );
68+ identifier_box.append (identifier_header );
69+ identifier_box.append (identifier_entry );
70+ identifier_box.append (identifier_invalid );
71+
9372 application_id_entry = new Gtk .Entry () {
94- margin_top = 6 ,
9573 editable = false
9674 };
9775
76+ var app_id_box = new Gtk .Box (VERTICAL , 6 );
77+ app_id_box.append (new Granite .HeaderLabel (_ ("Application ID ")) {
78+ mnemonic_widget = application_id_entry
79+ });
80+ app_id_box.append (application_id_entry );
81+
9882 location_entry = new Gtk .Entry () {
99- margin_top = 6 ,
10083 secondary_icon_name = " folder-symbolic" ,
10184 text = GLib.Environment.get_user_special_dir (GLib .UserDirectory .TEMPLATES )
10285 };
10386
87+ var location_box = new Gtk .Box (VERTICAL , 6 );
88+ location_box.append (new Granite .HeaderLabel (_ ("Location ")) {
89+ mnemonic_widget = location_entry
90+ });
91+ location_box.append (location_entry );
92+
10493 var spinner = new Gtk .Spinner () {
10594 valign = Gtk . Align . CENTER ,
10695 halign = Gtk . Align . CENTER ,
@@ -135,21 +124,15 @@ public class Views.Form : Adw.Bin {
135124 buttons_box.append (back_button );
136125 buttons_box.append (create_button );
137126
138- var form_box = new Gtk .Box (Gtk . Orientation . VERTICAL , 0 );
127+ var form_box = new Gtk .Box (Gtk . Orientation . VERTICAL , 24 );
139128 form_box.append (new Gtk .Label (_ ("Application ")) {
140129 halign = START ,
141130 css_classes = { Granite . STYLE_CLASS_H1_LABEL }
142131 });
143132 form_box.append (project_name_box );
144- form_box.append (project_name_entry );
145- form_box.append (project_name_invalid );
146133 form_box.append (identifier_box );
147- form_box.append (identifier_entry );
148- form_box.append (identifier_invalid );
149- form_box.append (new Granite .HeaderLabel (_ ("Application ID :")));
150- form_box.append (application_id_entry );
151- form_box.append (new Granite .HeaderLabel (_ ("Location :")));
152- form_box.append (location_entry );
134+ form_box.append (app_id_box );
135+ form_box.append (location_box );
153136 form_box.append (buttons_box );
154137
155138 var content_box = new Gtk .Box (Gtk . Orientation . VERTICAL , 0 ) {
@@ -336,24 +319,6 @@ public class Views.Form : Adw.Bin {
336319 }
337320 }
338321
339- private Gtk .Popover build_info_popover (string text ) {
340- var label = new Gtk .Label (text) {
341- wrap = true ,
342- margin_top = 6 ,
343- margin_bottom = 6 ,
344- margin_start = 6 ,
345- margin_end = 6 ,
346- max_width_chars = 24 ,
347- justify = CENTER
348- };
349-
350- var popover = new Gtk .Popover () {
351- child = label
352- };
353-
354- return popover;
355- }
356-
357322 public void focus_name () {
358323 project_name_entry. grab_focus ();
359324 }
0 commit comments