Skip to content

Commit

Permalink
fix #344 #284
Browse files Browse the repository at this point in the history
  • Loading branch information
mrvladus committed Oct 10, 2024
1 parent 2479852 commit f19bc3b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
12 changes: 12 additions & 0 deletions data/io.github.mrvladus.List.metainfo.xml.in.in
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@
</requires>

<releases>
<release version="46.2.6" date="2024-10-09">
<description translatable="no">
<p>Fixes:</p>
<ul>
<li>Fixed long-press right-click menu on touch devices</li>
</ul>
<p>Translations:</p>
<ul>
<li>Updated Spanish translation (haggen88)</li>
</ul>
</description>
</release>
<release version="46.2.5" date="2024-10-03">
<description translatable="no">
<p>Translations:</p>
Expand Down
8 changes: 6 additions & 2 deletions errands/widgets/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from __future__ import annotations

from datetime import datetime
from typing import TYPE_CHECKING, Any
from typing import TYPE_CHECKING, Any, Callable

from gi.repository import Adw, Gdk, Gio, GLib, GObject, Gtk # type:ignore

Expand Down Expand Up @@ -53,7 +53,7 @@ def __add_actions(self) -> None:
self.group: Gio.SimpleActionGroup = Gio.SimpleActionGroup()
self.insert_action_group(name="task", group=self.group)

def __create_action(name: str, callback: callable) -> None:
def __create_action(name: str, callback: Callable) -> None:
action: Gio.SimpleAction = Gio.SimpleAction(name=name)
action.connect("activate", callback)
self.group.add_action(action)
Expand Down Expand Up @@ -197,6 +197,10 @@ def __build_ui(self):
right_click_ctrl = Gtk.GestureClick(button=3)
right_click_ctrl.connect("released", self.__on_right_click)
self.title_row.add_controller(right_click_ctrl)
right_click_ctrl_touch = Gtk.GestureLongPress(touch_only=True)
right_click_ctrl_touch.connect("pressed", self.__on_right_click)
self.title_row.add_controller(right_click_ctrl_touch)


self.popover_menu: Gtk.PopoverMenu = Gtk.PopoverMenu(
halign=Gtk.Align.START,
Expand Down
3 changes: 3 additions & 0 deletions errands/widgets/task_list/task_list_sidebar_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,9 @@ def __build_ui(self) -> None:
right_click = Gtk.GestureClick(button=3)
right_click.connect("released", self._on_row_pressed)
self.add_controller(right_click)
right_click_ctrl_touch = Gtk.GestureLongPress(touch_only=True)
right_click_ctrl_touch.connect("pressed", self._on_row_pressed)
self.add_controller(right_click_ctrl_touch)

# Context menu
self.popover_menu = Gtk.PopoverMenu(
Expand Down
11 changes: 7 additions & 4 deletions errands/widgets/trash/trash_sidebar_row.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,20 @@ def __build_ui(self) -> None:
# Gesture click
self.gesture_click = Gtk.GestureClick(button=3)
self.gesture_click.connect("released", self._on_row_pressed)
self.add_controller(self.gesture_click)
right_click_ctrl_touch = Gtk.GestureLongPress(touch_only=True)
right_click_ctrl_touch.connect("pressed", self._on_row_pressed)
self.add_controller(right_click_ctrl_touch)

# Context menu
self.popover_menu = Gtk.PopoverMenu(
halign=Gtk.Align.START,
has_arrow=False,
menu_model=ErrandsSimpleMenu(
items=[
items=(
ErrandsMenuItem(_("Clear"), "trash_row.clear"),
ErrandsMenuItem(_("Restore"), "trash_row.restore"),
]
ErrandsMenuItem(_("Restore"), "trash_row.restore")
)
),
)

Expand All @@ -75,7 +79,6 @@ def __build_ui(self) -> None:
)
)

self.add_controller(self.gesture_click)

def __add_actions(self) -> None:
self.group: Gio.SimpleActionGroup = Gio.SimpleActionGroup()
Expand Down
2 changes: 1 addition & 1 deletion meson.build
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
project(
'errands',
version: '46.2.5',
version: '46.2.6',
meson_version: '>= 0.62.0',
)

Expand Down

0 comments on commit f19bc3b

Please sign in to comment.