Commit Graph

200 Commits

Author SHA1 Message Date
miruka
5f72397afe HLoader component, use Loader.asynchronous prop 2019-08-11 23:25:22 -04:00
miruka
3c35616eaa Remove copyright headers in code 2019-08-11 08:34:36 -04:00
miruka
67dde68126 Big performance refactoring & various improvements
Instead of passing all sorts of events for the JS to handle and manually
add to different data models, we now handle everything we can in Python.

For any change, the python models send a sync event with their
contents (no more than 4 times per second) to JS, and the QSyncable
library's JsonListModel takes care of converting it to a QML ListModel
and sending the appropriate signals.

The SortFilterProxyModel library is not used anymore, the only case
where we need to filter/sort something now is when the user interacts
with the "Filter rooms" or "Filter members" fields. These cases are
handled by a simple JS function.

We now keep separated room and timeline models for different accounts,
the previous approach of sharing all the data we could between accounts
created a lot of complications (local echoes, decrypted messages
replacing others, etc).

The users's own account profile changes are now hidden in the timeline.
On startup, if all events for a room were only own profile changes, more
events will be loaded.

Any kind of image format supported by Qt is now handled by the
pyotherside image provider, instead of just PNG/JPG.
SVGs which previously caused errors are supported as well.

The typing members bar paddings/margins are fixed.

The behavior of the avatar/"upload a profile picture" overlay is fixed.

Config files read from disk are now cached (TODO: make them reloadable
again).

Pylint is not used anymore because of all its annoying false warnings
and lack of understanding for dataclasses, it is replaced by flake8 with
a custom config and various plugins.

Debug mode is now considered on if the program was compiled with
the right option, instead of taking an argument from CLI.
When on, C++ will set a flag in the Window QML component.

The loading screen is now unloaded after the UI is ready, where
previously it just stayed in the background invisible and wasted CPU.

The overall refactoring and improvements make us now able to handle
rooms with thousand of members and no lazy-loading, where previously
everything would freeze and simply scrolling up to load past events
in any room would block the UI for a few seconds.
2019-08-11 08:27:53 -04:00
miruka
ef36cc6e7a Add missing dependencies to README 2019-07-25 19:19:39 -04:00
miruka
858c9f337d Add decryption keys import in account settings 2019-07-25 02:43:52 -04:00
miruka
93a6867735 Set own messages color 2019-07-25 00:10:07 -04:00
miruka
a2469bd994 Don't use user theme in debug mode 2019-07-24 18:46:13 -04:00
miruka
b6290ad3c9 Fix SignIn circle buttons colors 2019-07-24 18:41:40 -04:00
miruka
6638a66578 Finish replacing light-thin icons 2019-07-24 18:25:12 -04:00
miruka
de11b53c4e Copy default theme to user data dir if not exist 2019-07-24 18:14:43 -04:00
miruka
efa4ad0ae0 Add keybinds to config file 2019-07-24 17:05:27 -04:00
miruka
2be23128b1 Fix button hover overlay colors 2019-07-24 16:44:35 -04:00
miruka
cb25c30cb9 Fix EditAccount currentSpacing 2019-07-24 16:41:32 -04:00
miruka
921a0586cf Add background image variable to theme 2019-07-24 14:58:16 -04:00
miruka
ec27ecf498 Initial themes implementation, new default theme 2019-07-24 02:14:34 -04:00
miruka
9397687122 Parse theme from a custom simpler format 2019-07-23 03:14:02 -04:00
miruka
cb1b95766c Remove indents in sendbox with backspace 2019-07-22 18:06:34 -04:00
miruka
4c7815554c Auto-indent new line in sendbox 2019-07-21 19:12:32 -04:00
miruka
67e06aa739 Remove debug print 2019-07-21 18:26:53 -04:00
miruka
ab2a73dbfc Set html style for code 2019-07-21 18:17:51 -04:00
miruka
2bd8514e9b Label link colors 2019-07-21 17:50:01 -04:00
miruka
6e65376612 markdown: don't parse "> ..." as blockquote 2019-07-21 16:08:40 -04:00
miruka
f7d286cdc2 Save/load which accounts are collapsed 2019-07-21 09:26:47 -04:00
miruka
71f78feec6 Define UIState config file 2019-07-21 06:05:01 -04:00
miruka
41eea44fff Add keyboard shortcuts to flick the events list 2019-07-20 18:08:58 -04:00
miruka
1ffca37021 Fix sendbox modifier+enter for newline not working 2019-07-20 14:37:21 -04:00
miruka
cf54c0a29f Never show our own users in typing bar 2019-07-20 02:33:02 -04:00
miruka
cea586120e Rework how messages and events are handled
- No more translatable, content_type, show_name_line attrs for
  TimelineEventReceived.
  Since they are UI concerns, they are handled directly in QML.

- Refactor the EventDelegate and get rid of errors when new items
  are added to the timeline

- Messages, events and emotes all combine correctly.

- No more 28px wide avatars for events, to make them uniform with
  messages.
2019-07-20 01:30:58 -04:00
miruka
ecc2c099f1 Add /me command 2019-07-19 20:55:52 -04:00
miruka
a10a395e0b Only send a formatted_body if it's truly needed 2019-07-19 18:13:04 -04:00
miruka
db3a9efe8a Hide status field for now, adjust big font size 2019-07-19 00:12:23 -04:00
miruka
2cf0864b18 Implement multi-account writing for sendbox 2019-07-18 23:50:23 -04:00
miruka
93bc2ff5a9 Add multiaccount write-as alias account setting 2019-07-18 21:58:21 -04:00
miruka
9decd58992 Use aiofiles for image provider file writes 2019-07-18 20:44:17 -04:00
miruka
d597e1dda8 Refactor Backend and config file operations 2019-07-18 20:30:41 -04:00
miruka
a842981406 Improve README 2019-07-18 18:35:47 -04:00
miruka
67efde9116 Show own events on right only under certain width 2019-07-18 06:33:09 -04:00
miruka
ea02ce2316 ES5 → 7: Use enhanced object properties
http://es6-features.org/#PropertyShorthand

Instead of doing {"foo": foo, "bar": bar, ...}, we can just do
{foo, bar} now.

The function parameters of EventHandlers have all been renamed to
camelCase to make use of this, as the JS style conventions intend.
Other functions will follow in a later commit.
2019-07-18 04:17:35 -04:00
miruka
f5d747cbc4 Fix wrong avatar for unamed rooms 2019-07-18 02:36:08 -04:00
miruka
4c0b947d1a Handle nio.ThumbnailError cases
Return a 1x1 transparent PNG for now.
2019-07-18 02:08:01 -04:00
miruka
44a998f31b Rename HHighlightRectangle → HInteractiveRectangle 2019-07-18 01:56:58 -04:00
miruka
d8295302a5 HTextField active color, HColorAnimation + factor 2019-07-18 01:53:28 -04:00
miruka
fa61e8f0e3 Standard way of knowing if window "is wide" 2019-07-18 01:18:06 -04:00
miruka
332b6f1c0d Big improvements on sidepane auto/manual sizing
See gui-tests.md for the expected sidepane behaviors.
2019-07-17 13:34:56 -04:00
miruka
e173253f74 Sidebar size fixes 2019-07-16 17:08:06 -04:00
miruka
96745902f3 Move header definition from EditAccount to HPage 2019-07-16 12:53:52 -04:00
miruka
a813b1c715 HPage with SwipeView to show reduced side pane 2019-07-16 12:37:11 -04:00
miruka
29e21bc7c2 Fix avatar upload overlay overflow at small size 2019-07-16 11:48:57 -04:00
miruka
5cc701113e Fix banners, adapt to app width 2019-07-16 08:10:37 -04:00
miruka
1abec4cf2c Remove some useless Layout.maximumWidth props 2019-07-16 05:55:07 -04:00
miruka
d2dfafb4e7 Standardize spacings 2019-07-16 05:29:47 -04:00
miruka
d302a5cf5f Rename bottomElementsHeight to baseElementsHeight 2019-07-16 05:13:19 -04:00
miruka
d5dd1292ff wrap/elide: use Layout.fillWidth when possible 2019-07-16 05:08:27 -04:00
miruka
4b2cbffc83 Auto-set maximumLineCount for elide in HLabel 2019-07-16 04:47:56 -04:00
miruka
6ae37dc31f Always center button text (for now) 2019-07-16 04:41:26 -04:00
miruka
aef777d853 Fix image selection and overlay bugs 2019-07-16 04:37:39 -04:00
miruka
73ecbaad10 Add upload avatar hover overlay
Also fix name colors and always use fit-crop mode for avatars.
2019-07-15 20:10:43 -04:00
miruka
62056b6124 Avatar change working 2019-07-15 16:14:08 -04:00
miruka
751a27157c Add account settings page
Display name change working
2019-07-13 20:15:20 -04:00
miruka
6916039546 Add "Edit Account" interface skeleton 2019-07-13 05:34:58 -04:00
miruka
cb0d7e8a77 Highlight account and room delegates 2019-07-12 17:07:45 -04:00
miruka
a2ae569511 Split HButton into HBaseButton and HButton 2019-07-10 15:00:57 -04:00
miruka
62ec4a9ae8 Caught up to the old backend
Lines before (PyQt):

Language     files   blank   comment   code
Python       21      787     114       2076
QML          49      393     14        1689
JavaScript   2       59      3         177
SUM:         72      1239    131       3942

Lines now (pyotherside, asyncio):

Language     files   blank   comment   code
QML          59      516     159       1962
Python       11      306     53        739
JavaScript   5       64      24        211
C++          1       6       2         18
SUM:         76      892     238       2930
2019-07-08 13:32:53 -04:00
miruka
7f7a7621cf Cleanup TODO.md 2019-07-08 12:52:07 -04:00
miruka
4314767ac2 Fix creating UserUpdated events from nio rooms 2019-07-08 12:28:49 -04:00
miruka
0f6474532b Add LGPL license headers 2019-07-07 23:53:08 -04:00
miruka
4f0ba24373 Send typing notifications from sendbox 2019-07-07 23:28:10 -04:00
miruka
d26f087df9 More checks to avoid errors on forgetting room 2019-07-07 22:49:28 -04:00
miruka
fcd492ff2d Fix room categories sorting 2019-07-07 22:25:30 -04:00
miruka
b02fc11903 Remove forgotten rooms from the view 2019-07-07 22:19:45 -04:00
miruka
be152c3acf Fix getUser binding loops & coro race conditions 2019-07-07 01:37:13 -04:00
miruka
03d9079d63 Show LeftBanner with a generic left text 2019-07-06 23:43:51 -04:00
miruka
2ac1d6da17 Remove "readonly"s from Theme for readability 2019-07-06 21:06:18 -04:00
miruka
34d68af51f Rename SendBox root id 2019-07-06 17:56:04 -04:00
miruka
388967c737 Improve TypingMembersBar 2019-07-06 17:29:45 -04:00
miruka
f09e1491c4 Fix spacing when sidepane is collapsed 2019-07-05 16:55:25 -04:00
miruka
ee4e6470a9 Invite banner (callbacks not implemented yet) 2019-07-05 16:48:30 -04:00
miruka
ecba7c47ec Past events loading (with two bugs) 2019-07-05 03:12:27 -04:00
miruka
78663df09e Always linkify <img> tags, no matter the src 2019-07-04 23:21:27 -04:00
miruka
dbcfad1c50 Keep local echo delegates at the bottom 2019-07-04 23:12:21 -04:00
miruka
1db406d9af Add LimitExceededError nio callback 2019-07-04 22:49:37 -04:00
miruka
a1b4d8900f New backend work
Models, account connection, fetching user profiles,
show connected accounts in sidebar
2019-06-28 18:12:45 -04:00
miruka
3344debbbf Start rewriting backend with pyotherside+asyncio 2019-06-27 02:31:03 -04:00
miruka
0b85252dd6 Remove "querying user" debug print 2019-05-17 17:18:01 -04:00
miruka
de9140cdb2 Reduce useless setTypingState calls on lost focus 2019-05-17 16:02:26 -04:00
miruka
5ab588f40c Prevent RoomEventDelegate startup position glitch 2019-05-17 14:24:03 -04:00
miruka
19c69b406a Fix room banners height 2019-05-16 15:57:09 -04:00
miruka
532e5a4375 Make RoomCategoryDelegate expand icons smaller 2019-05-16 15:53:17 -04:00
miruka
7f3ced682f Fix RoomHeader title width calculation 2019-05-16 15:50:14 -04:00
miruka
1a4ac0f432 Make Room.members a properly updating ListModel 2019-05-14 20:20:54 -04:00
miruka
a3e080c9a0 Fix local echoed messages having a wrong time 2019-05-14 15:03:12 -04:00
miruka
f9a5902545 Improve SidePane auto-sizing and appearance 2019-05-12 15:57:18 -04:00
miruka
97c1dda4ba Add a basic member list pane to rooms 2019-05-12 13:17:42 -04:00
miruka
8f965a3e72 Remove blur effect, causes too much trouble 2019-05-11 17:51:49 -04:00
miruka
d82cb50e30 Implement room filtering 2019-05-11 17:13:53 -04:00
miruka
bb86c39fe7 Simplify SortFilterProxy init 2019-05-11 16:40:53 -04:00
miruka
bbc4c15ad3 Rework Backend, models and items organization 2019-05-11 15:52:56 -04:00
miruka
dcdf165c4f Update TODO.md 2019-05-09 19:48:49 -04:00
miruka
1a90bb4331 Add Backend.devices ListModelMap
The Device ListModels will be populated after login.
2019-05-09 14:07:57 -04:00
miruka
d08f43e6be Add new queuing features to @futurize
- max_instances renamed to max_running

- consider_args parameter:
  if True, $max_running of this function with the same arguments can be
  running, else:
  $max_running of this function, no matter the arguments, can be running

- discard_if_max_running:
  if True and there are already the maximum possible number of running
  functions running, cancel this task (previous default behavior), else:
  Wait for a spot to be free before running
2019-05-08 10:32:45 -04:00