[gnome-contacts] ContactList: start select mode on right click.
- From: Niels De Graef <nielsdg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-contacts] ContactList: start select mode on right click.
- Date: Mon, 22 Jan 2018 21:31:51 +0000 (UTC)
commit a91a08009820848de18d02854db73cee0aae429e
Author: Niels De Graef <nielsdegraef gmail com>
Date: Mon Jan 22 22:30:51 2018 +0100
ContactList: start select mode on right click.
src/contacts-contact-list.vala | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/src/contacts-contact-list.vala b/src/contacts-contact-list.vala
index a4ee808..f45bb2f 100644
--- a/src/contacts-contact-list.vala
+++ b/src/contacts-contact-list.vala
@@ -231,7 +231,7 @@ public class Contacts.ContactList : ListBox {
}
public override void row_selected (ListBoxRow? row) {
- var data = row as ContactDataRow;
+ var data = (ContactDataRow?) row as ContactDataRow;
var contact = data != null ? data.contact : null;
selection_changed (contact);
#if HAVE_TELEPATHY
@@ -265,4 +265,16 @@ public class Contacts.ContactList : ListBox {
}
return cs;
}
+
+ public override bool button_press_event (Gdk.EventButton event) {
+ base.button_press_event (event);
+
+ if (event.button == Gdk.BUTTON_SECONDARY) {
+ var row = (ContactDataRow) get_row_at_y ((int) Math.round (event.y));
+ select_row (row);
+ row.selector_button.active = (this.state != UiState.SELECTING);
+ }
+
+ return false;
+ }
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]