Closed quozl closed 7 months ago
is this issue open. Can I work on it ? @quozl
@vaishnavi192 the issue is still open as it's not been closed, you should checkout our contributing guide which has this;
Please note there is no need to ask permission to work on an issue. You should check for pull requests linked to an issue you are addressing; if there are none, then assume nobody has done anything. Begin to fix the problem, test, make your commits, push your commits, then make a pull request. Mention an issue number in the pull request, but not the commit message. These practices allow the competition of ideas (Sugar Labs is a meritocracy.
Hey @quozl @chimosky I wanted some help for solving this issue. I found out that GDK doesn't provide a built-in way to detect long press events. So we can achieve this in other way by implementing x and y co-ordinates. Here is a rough example
I will make changes in view.py file
import time
def _touch_event_cb(self, widget, event):
if event.type == Gdk.EventType.TOUCH_BEGIN:
self.touch_start_time = GLib.get_monotonic_time()
elif event.type == Gdk.EventType.TOUCH_END:
if self.touch_start_time is not None:
elapsed_time = (GLib.get_monotonic_time() - self.touch_start_time) / 1000000
if elapsed_time > 1.0: # 1.0 seconds for a long press
self.show_menu(event)
self.touch_start_time = None
def show_menu(self, event):
print("Long press detected at", event.x, event.y)
I am not sure if this is the correct way? can you plz guide me further?
Hey @quozl @chimosky I wanted some help for solving this issue. I found out that GDK doesn't provide a built-in way to detect long press events. So we can achieve this in other way by implementing x and y co-ordinates. Here is a rough example I will make changes in view.py file
Have you been able to reproduce the issue, as I just tried and the issue no longer persists.
Gdk does provide ways to handle long press events, just depends on what exactly you want to achieve.
For future purposes, please share texts instead of screenshots, you can also use ticks to enclose code to make it more readable on GH.
If you're interested, the GH writing and formatting syntax would come-in handy.
In the home view, a long touch on an activity displays the menu in the top left of the screen. The menu should be displayed near the finger press.