summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Wildberg <lorenz@wild-fisch.de>2021-08-09 12:35:19 +0200
committerNiels De Graef <nielsdegraef@gmail.com>2021-08-20 11:34:23 +0000
commitec6c52706e1882d897463517e1b5cf9cc3c67c4f (patch)
tree61000deee4b9cf0e3011bff4086f706d5f6500b1
parentae49be135b7f0ec8b5b4d35de9354284104ce539 (diff)
downloadgnome-contacts-ec6c52706e1882d897463517e1b5cf9cc3c67c4f.tar.gz
contacts-list: don't show checkbox on hovering
You can select an item trough right-click or holding on touchscreens. In the mockup is nothing like this showed too.
-rw-r--r--src/contacts-contact-list.vala22
1 files changed, 1 insertions, 21 deletions
diff --git a/src/contacts-contact-list.vala b/src/contacts-contact-list.vala
index 816784d..266545d 100644
--- a/src/contacts-contact-list.vala
+++ b/src/contacts-contact-list.vala
@@ -30,8 +30,6 @@ public class Contacts.ContactList : Gtk.ListBox {
private Gtk.Label label;
private Avatar avatar;
public Gtk.CheckButton selector_button;
- // Whether the selector should always be visible (or only on hover)
- private bool checkbox_exposed = false;
public ContactDataRow(Individual i) {
this.individual = i;
@@ -72,24 +70,6 @@ public class Contacts.ContactList : Gtk.ListBox {
this.label.set_text (this.individual.display_name);
changed ();
}
-
- // Sets whether the checbox should always be shown (and not only on hover)
- public void expose_checkbox (bool expose) {
- this.checkbox_exposed = expose;
-
- var hovering = Gtk.StateFlags.PRELIGHT in get_state_flags ();
- this.selector_button.visible = expose || hovering;
- }
-
- // Normally, we would use the (enter/leave)_notify_event here, but since ListBoxRow
- // doesn't have its own Gdk.Window, this won't work (at least in GTK+3).
- public override void state_flags_changed (Gtk.StateFlags previous_state) {
- var hovering_now = Gtk.StateFlags.PRELIGHT in get_state_flags ();
- var was_hovering = Gtk.StateFlags.PRELIGHT in previous_state;
-
- if (hovering_now != was_hovering) // If hovering changed
- this.selector_button.visible = checkbox_exposed || hovering_now;
- }
}
public signal void selection_changed (Individual? individual);
@@ -148,7 +128,7 @@ public class Contacts.ContactList : Gtk.ListBox {
private void on_ui_state_changed (Object obj, ParamSpec pspec) {
foreach (var widget in get_children ()) {
var row = widget as ContactDataRow;
- row.expose_checkbox (this.state == UiState.SELECTING);
+ row.selector_button.visible = (this.state == UiState.SELECTING);
if (this.state != UiState.SELECTING)
row.selector_button.active = false;