Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add multi line text input and drawing input #35

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Dimi20cen
Copy link

Relevant to issue #17

The code is not working properly and there are still issues with transmiting the drawing and text to the shared activity instance.

As you can see in the commits, I used a custom gtk.TextView to replace the gtk Entry for the input field. One problem I faced was that, if I understand correctly, the sugar's gtk-widgets.css doesn't style textview in a similar way as entry. Would you suggest I manage the css for textview in the source code of chat's activity?

Also, currently when a user sends messages consecutively, they all bundle up in the same box. I was thinking that giving each separate message its own box, would look better. What do you think?

@chimosky @sourabhaa

…add multi line input and drawing input

- Add CustomTextView class extending Gtk.TextView and replace Gtk.entry with it
- Initialize event handlers and drawing attributes in CustomTextView
- Implement button-press-event for drawing in CustomTextView
- Implement button-release-event to stop drawing in CustomTextView
- Add motion-notify-event for continuous drawing in CustomTextView
- Override do_draw method to incorporate drawing functionality in CustomTextView
- Refactor _add_smiley_to_entry to support CustomTextView
- Refactor _make_entry_widgets to integrate CustomTextView and add drawing button
- Extend _entry_activate_cb to serialize drawings as JSON strings and concatenate them with text.
- Extend _entry_activate_cb to update logging to include both text and drawing data.
- Initialize empty list all_draw_paths in TextBox's __init__ for storing drawing paths.
- Modify add_text to parse both text and drawing data from the input string.
  Text and drawing data are separated by "||DRAWINGS||" in the input.
- Add do_draw method to render drawings stored in `all_draw_paths`.
- Update add_text to handle multi-line text inputs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant