[gnome-contacts] Editor: Don't overuse `using Gtk`



commit f1b1e63e5c7d518d6c313763ede9c98f2a4d6994
Author: Niels De Graef <nielsdegraef gmail com>
Date:   Fri Jun 5 11:02:04 2020 +0200

    Editor: Don't overuse `using Gtk`
    
    We've had compilation errors thanks to that before, when libhandy
    introduced a similar name as that of Gtk (e.g. HdyHeaderBar vs
    GtkHeaderBar). It also makes grepping a bit easier for maintainers :-)

 src/contacts-contact-editor.vala | 22 ++++++++++------------
 1 file changed, 10 insertions(+), 12 deletions(-)
---
diff --git a/src/contacts-contact-editor.vala b/src/contacts-contact-editor.vala
index 22b35bb..09753c9 100644
--- a/src/contacts-contact-editor.vala
+++ b/src/contacts-contact-editor.vala
@@ -16,24 +16,22 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-using Gtk;
 using Folks;
-using Gee;
 
 /**
  * A widget that allows the user to edit a given {@link Contact}.
  */
-public class Contacts.ContactEditor : Box {
+public class Contacts.ContactEditor : Gtk.Box {
   private Individual individual;
-  private Entry name_entry;
+  private Gtk.Entry name_entry;
   private AvatarSelector avatar_selector = null;
   private Avatar avatar;
 
   public ContactEditor (Individual individual, IndividualAggregator aggregator) {
-    Object (orientation: Orientation.VERTICAL, spacing: 24);
+    Object (orientation: Gtk.Orientation.VERTICAL, spacing: 24);
     this.individual = individual;
 
-    Box header = new Box (Orientation.HORIZONTAL, 6);
+    Gtk.Box header = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 6);
     header.add (create_avatar_button ());
     header.add (create_name_entry ());
     add (header);
@@ -45,10 +43,10 @@ public class Contacts.ContactEditor : Box {
   }
 
   // Creates the contact's current avatar in a big button on top of the Editor
-  private Widget create_avatar_button () {
+  private Gtk.Widget create_avatar_button () {
     this.avatar = new Avatar (PROFILE_SIZE, this.individual);
 
-    var button = new Button ();
+    var button = new Gtk.Button ();
     button.get_accessible ().set_name (_("Change avatar"));
     button.image = this.avatar;
     button.clicked.connect (on_avatar_button_clicked);
@@ -57,18 +55,18 @@ public class Contacts.ContactEditor : Box {
   }
 
   // Show the avatar popover when the avatar is clicked
-  private void on_avatar_button_clicked (Button avatar_button) {
+  private void on_avatar_button_clicked (Gtk.Button avatar_button) {
     if (this.avatar_selector == null)
       this.avatar_selector = new AvatarSelector (avatar_button, this.individual);
     this.avatar_selector.show();
   }
 
   // Creates the big name entry on the top
-  private Widget create_name_entry () {
+  private Gtk.Widget create_name_entry () {
     NameDetails name = this.individual as NameDetails;
-    this.name_entry = new Entry ();
+    this.name_entry = new Gtk.Entry ();
     this.name_entry.hexpand = true;
-    this.name_entry.valign = Align.CENTER;
+    this.name_entry.valign = Gtk.Align.CENTER;
     this.name_entry.input_purpose = Gtk.InputPurpose.NAME;
     this.name_entry.placeholder_text = _("Add name");
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]