Commit Graph

57 Commits

Author SHA1 Message Date
miruka
6953239bc3 Add shortcut to send file from path in clipboard 2019-11-06 17:03:34 -04:00
miruka
7408322fbe Fix/improve image sizes 2019-11-05 09:19:48 -04:00
miruka
2d682516e8 Support encrypted file reading & caching
Also don't convert palette images to JPEG when creating thumbnails.
2019-11-04 14:37:48 -04:00
miruka
2f19ff493b Rewrite media caching (old image provider)
- Doesn't use pyotherside's image provider feature, for more flexibility
  and simplicity
- Suitable for supporting matrix media events and more later
- Avoid a lot of duplicate files that the old cache created due to
  server not returning what we expect, mistakes in Python/QML code, etc
- Changed file structure
  (e.g. thumbnails/32x32/<mxc id> instead of
   thumbnails/<mxc id>.32.32.crop)

- Backend.wait_until_account_exist: start issuing warnings if the
  function runs for more than 10s, which means in most case a bad user
  ID was passed

- New HMxcImage QML component, used in H(User/Room)Avatar
2019-11-03 13:48:12 -04:00
miruka
6aac5a9edb Replace QML clipboard hack by proper new Clipboard 2019-10-25 08:42:04 -04:00
miruka
756edc90dd JS: use slice() instead of splice()
slice() does the same as splice() without the unintended effect of
transforming the array.
2019-10-24 08:09:33 -04:00
miruka
652cd059c4 Prevent makeObject callback from running twice 2019-10-22 03:40:09 -04:00
miruka
7b482de727 DebugConsole must now be created from components
Remove the default console from UI.qml and add a utils.js function
to create one quickly.
Using this function from the component we actually want to debug gives
the console full access to that component's scope, children IDs, etc.
2019-09-19 16:47:35 -04:00
miruka
d20ab5a348 Refactor EventContent
Use proper layouts and get rid of multiple annoyances/bugs like
text-wrapping randomly happening in the middle of words, background
rectangles being too large, a certain binding loop, etc
2019-09-19 15:49:29 -04:00
miruka
692749e72f Support video events, new media player 2019-09-17 16:30:04 -04:00
miruka
0db34cc3c8 Add EventMediaLoader
Handles loading of URL previews and will handle all
matrix media messages types.
2019-09-14 00:36:19 -04:00
miruka
988ab94772 Fix ForgetRoomPopup destruction/callback 2019-09-09 20:56:10 -04:00
miruka
e5893c5569 HBox: Add arrow keys navigation
Also rename enterButtonTarget to clickButtonOnEnter
2019-09-09 07:41:48 -04:00
miruka
2611e86517 Confirmation popup to clear messages 2019-09-09 06:23:46 -04:00
miruka
a731013a8c Fix Utils.minutesBetween()
minutesBetween(
    new Date(2019, 01, 01, 13, 20, 00), new Date(2019, 01, 01, 14, 20, 00)
)
returned 0 instead of 60, the fixed function property return numbers of
minutes after 60.
2019-09-07 16:33:16 -04:00
miruka
66129a9eb2 Remove seconds from message dates
Makes them easier to read
2019-09-07 15:16:03 -04:00
miruka
d353056db9 Fix scroll to top/bottom 2019-09-06 15:20:22 -04:00
miruka
f6a24ec020 Remove overshoot check for smartVerticalFlick()
Keyboard flicking feels better witohut rather than just abruptly
stopping or not doing anything if the user is already at the top/bottom
of the flickable.
2019-09-06 15:07:19 -04:00
miruka
922eac4ea9 Pseudo-clipboard safety modifications 2019-09-06 15:07:19 -04:00
miruka
131a20e9c5 Add context menu to copy selected messages 2019-09-06 15:06:35 -04:00
miruka
016f76167f Initial implementation of message selection 2019-09-06 15:06:35 -04:00
miruka
70b82b7b59 Add scroll to top/bottom keybinds 2019-08-30 13:40:56 -04:00
miruka
4587599cf5 Fix sending typing state when no configured alias 2019-08-30 10:49:41 -04:00
miruka
06d75a18fc Remove useless print 2019-08-30 10:33:58 -04:00
miruka
4ff3ebe255 Fix room subtitle for local echoes 2019-08-28 13:29:49 -04:00
miruka
8de26c11a1 HShortcutHandler & HShortcut components
Provide more powerful shortcuts handling than what's available with
QML's Shortcut component, notably being able to react differently to key
presses, releases and auto-repeats.
2019-08-22 13:03:26 -04:00
miruka
206f5494c8 Use hsluv for display names & remove hsl funcs 2019-08-21 12:43:07 -04:00
miruka
7624ce5fcb hsluv/hsl(a) functions: wrap around hue 2019-08-21 12:32:14 -04:00
miruka
1886303481 Fix member filtering 2019-08-21 12:17:12 -04:00
miruka
de4d984ded Use smart case for filters 2019-08-19 18:25:00 -04:00
miruka
165c1b797e Repair room filter, performance improvements
Chnaging delegate heights is a terrible idea that leads to graphic bugs.
Handle filtering (both room and accounts) and collapsing from a function
that sets the JsonListModel source.
2019-08-19 10:28:49 -04:00
miruka
2bb3952225 Show last event time in RoomDelegate
Also respect locale for message times
2019-08-16 12:07: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
7e9106ee9c Utils.hsla(): use py.callSync 2019-07-25 19:19:24 -04:00
miruka
ec27ecf498 Initial themes implementation, new default theme 2019-07-24 02:14:34 -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
1fa8b70359 ES5 → 7: Use for in/of and let 2019-07-18 05:18:13 -04:00
miruka
8a38274280 Make all JS functions and variables camelCase
According to conventions.
2019-07-18 04:48:34 -04:00
miruka
3939470679 Add "use strict" directive to all .js files 2019-07-18 04:38:22 -04:00
miruka
4920ff6212 ES5 → 7: Use function default parameters 2019-07-18 03:35:30 -04:00
miruka
8f53d2e018 Qt 5.12 ES5 → 7: Use "() =>" and array.includes 2019-07-18 03:13:34 -04:00
miruka
cf13315d4f Add normal hsl and hsla functions 2019-07-18 01:27:14 -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
751a27157c Add account settings page
Display name change working
2019-07-13 20:15:20 -04:00
miruka
861347ce64 Fix "tarfindId" sed rename mistakes 2019-07-08 13:24:05 -04:00
miruka
0f6474532b Add LGPL license headers 2019-07-07 23:53:08 -04:00
miruka
2170b16175 Rename users.getUser to users.find 2019-07-07 22:41:32 -04:00
miruka
47327c64cf Working filter field for room members 2019-07-07 05:50:42 -04:00
miruka
683ee3e1cf Add HUserAvatar and HRoomAvatar components 2019-07-07 00:24:23 -04:00