Skip to content

Commit ba7afdb

Browse files
committed
add icon and context menu from long touch
1 parent 7e2259a commit ba7afdb

File tree

4 files changed

+20
-131
lines changed

4 files changed

+20
-131
lines changed
Loading

net.hemish.kaar.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"app-id" : "net.hemish.kaar",
33
"runtime" : "org.gnome.Platform",
4-
"runtime-version" : "46",
4+
"runtime-version" : "47",
55
"sdk" : "org.gnome.Sdk",
66
"command" : "kaar",
77
"finish-args" : [

src/blp/task.blp

+5-1
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,15 @@ PopoverMenu popover_menu {
1414

1515
template $TaskStack: Gtk.Stack {
1616

17+
// Right click actions with right click and touch long press
18+
1719
GestureClick gesture_click {
1820
button: 3;
1921
}
2022

21-
23+
GestureLongPress gesture_long_press {}
24+
25+
2226

2327
styles [
2428
"task"

src/model.py

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class TaskStack(Gtk.Stack):
1616
tags_flow_box: Gtk.FlowBox = Gtk.Template.Child()
1717
dates_flow_box: Gtk.FlowBox = Gtk.Template.Child()
1818
gesture_click: Gtk.GestureClick = Gtk.Template.Child()
19+
gesture_long_press: Gtk.GestureLongPress = Gtk.Template.Child()
1920
popover_menu: Gtk.PopoverMenu = Gtk.Template.Child()
2021

2122
# Creates a label which holds name of projects, contexts, and due, completion dates
@@ -33,6 +34,8 @@ def __init__(self, **kwargs):
3334

3435
# Shows right click actions like delete, toggle editing
3536
self.gesture_click.connect("pressed", self.on_right_click)
37+
# same for touch devices
38+
self.gesture_long_press.connect("pressed", self.on_right_click)
3639
self.popover_menu.set_parent(self)
3740

3841
def on_entry_apply(self, *args):

0 commit comments

Comments
 (0)