Skip to content

Commit

Permalink
fix item row
Browse files Browse the repository at this point in the history
  • Loading branch information
alainm23 committed Aug 27, 2024
1 parent 7a38f78 commit e597e71
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 13 deletions.
2 changes: 1 addition & 1 deletion core/QuickAdd.vala
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ public class Layouts.QuickAdd : Adw.Bin {
label_button.source = item.project.source;

reminder_button = new Widgets.ReminderPicker.ReminderButton (true) {
tooltip_markup = Util.get_default ().markup_accel_tooltip (_("Add Reminders"), "Ctrl+R"),
tooltip_markup = Util.get_default ().markup_accel_tooltip (_("Add Reminders"), "!"),
};

var action_box = new Gtk.Box (Gtk.Orientation.HORIZONTAL, 12) {
Expand Down
6 changes: 1 addition & 5 deletions core/Widgets/PinButton.vala
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@ public class Widgets.PinButton : Gtk.Button {
pinned_image = new Gtk.Image.from_icon_name ("pin-symbolic");
child = pinned_image;

var gesture = new Gtk.GestureClick ();
add_controller (gesture);

gesture.pressed.connect ((n_press, x, y) => {
gesture.set_state (Gtk.EventSequenceState.CLAIMED);
clicked.connect (() => {
changed ();
});
}
Expand Down
24 changes: 17 additions & 7 deletions src/Layouts/ItemRow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public class Layouts.ItemRow : Layouts.ItemBase {
_edit = value;

if (value) {
add_css_class ("row");
add_css_class ("no-selectable");
itemrow_box.add_css_class ("card");
itemrow_box.add_css_class ("card-selected");

Expand Down Expand Up @@ -131,7 +131,7 @@ public class Layouts.ItemRow : Layouts.ItemBase {
return GLib.Source.REMOVE;
});
} else {
remove_css_class ("row");
add_css_class ("no-selectable");
itemrow_box.remove_css_class ("card-selected");
itemrow_box.remove_css_class ("card");

Expand Down Expand Up @@ -199,18 +199,16 @@ public class Layouts.ItemRow : Layouts.ItemBase {
public ItemRow (Objects.Item item, bool is_project_view = false) {
Object (
item: item,
is_project_view: is_project_view,
focusable: false,
can_focus: true
);
is_project_view: is_project_view
);
}

~ItemRow () {
print ("Destroying Layouts.ItemRow\n");
}

construct {
css_classes = { "no-selectable", "no-padding" };
css_classes = { "row", "no-padding" };

project_id = item.project_id;
section_id = item.section_id;
Expand Down Expand Up @@ -616,6 +614,18 @@ public class Layouts.ItemRow : Layouts.ItemBase {
}
})] = handle_gesture_click;

activate.connect (() => {
if (Services.Settings.get_default ().settings.get_boolean ("open-task-sidebar")) {
Services.EventBus.get_default ().open_item (item);
} else {
if (Services.Settings.get_default ().settings.get_boolean ("attention-at-one")) {
Services.EventBus.get_default ().item_selected (item.id);
} else {
edit = true;
}
}
});

signals_map[Services.EventBus.get_default ().mobile_mode_change.connect (() => {
if (Services.EventBus.get_default ().mobile_mode) {
action_box_right.hexpand = false;
Expand Down

0 comments on commit e597e71

Please sign in to comment.