Private
Public Access
1
0

Mark conversation as read on movement

This commit is contained in:
2025-06-18 15:32:37 -07:00
parent a70adbb7f1
commit 3b6666cfc2
5 changed files with 113 additions and 37 deletions

View File

@@ -25,6 +25,8 @@ private class TranscriptDrawingArea : Widget
private GestureClick _click_gesture = new GestureClick();
private Gdk.Rectangle? _click_bounding_box = null;
private EventControllerMotion _motion_controller = new EventControllerMotion();
private const bool debug_viewport = false;
private uint? _tick_callback_id = null;
private HashMap<string, ChatItemAnimation> _animations = new HashMap<string, ChatItemAnimation>();
@@ -40,6 +42,22 @@ private class TranscriptDrawingArea : Widget
});
add_controller(_click_gesture);
_motion_controller.motion.connect((x, y) => {
if (self == null) {
return;
}
// Only print motion events if window is active/focused
var window = self.get_native() as Gtk.Window;
if (window == null || !window.is_active) {
return;
}
self.on_mouse_motion(x, y);
});
_motion_controller.set_propagation_phase(PropagationPhase.CAPTURE);
add_controller(_motion_controller);
SimpleAction copy_action = new SimpleAction("copy", null);
copy_action.activate.connect(() => {
if (_click_bounding_box != null) {
@@ -172,6 +190,10 @@ private class TranscriptDrawingArea : Widget
animation_tick();
}
private void on_mouse_motion(double x, double y) {
// TODO: Will be making temporary text views here.
}
private void on_right_click() {
var menu_model = new Menu();
menu_model.append("Copy", "transcript.copy");