Commit Graph

77 Commits

Author SHA1 Message Date
miruka
2cb64c5346 Turn utils.js into a Utils.qml QtObject
When a .js module is used, every single file that imports it creates
its own duplicated environment in memory for that module.

Instead, use a simple QtObject with all the functions, and declare it in
Window.qml so that it is available to all children everywhere in the
app.
2019-12-17 17:59:53 -04:00
miruka
b307b596d2 Animators are buggy crap, drop them 2019-12-16 04:42:41 -04:00
miruka
888df282a8 Rename side pane stuff to main pane 2019-12-10 15:17:41 -04:00
miruka
bd8bf6120e Fix taking focus for chat 2019-12-09 14:13:38 -04:00
miruka
2e780d7c6a HDrawer: provide real visible size prop→fix issues 2019-12-09 13:54:05 -04:00
miruka
13d3f19997 Replace all ==/!= by ===/!== 2019-12-09 11:35:50 -04:00
miruka
5609ae2817 Refactor Chat/RoomSidePane 2019-12-09 05:25:31 -04:00
miruka
06a6a4c08d Rewrite SidePane using QQC Drawer
Cleaner approach, gets rid of the HPage swipe view hack, better
performances, a lot less complex
2019-12-08 14:43:41 -04:00
miruka
7235611d54 Refactor SignIn, adjustments to HCheckBox & HBox 2019-12-07 09:38:36 -04:00
miruka
c5a8be9ef9 Use new HScaleAnimator instead of HNumberAnimation 2019-11-30 14:59:48 -04:00
miruka
5a70adcc93 Use ES6 template strings 2019-11-18 03:57:13 -04:00
miruka
de59948214 When leaving room, try to go to previous page 2019-11-09 14:25:48 -04:00
miruka
b53acb3113 Implement pageLoader history + CreateRoom cancel 2019-11-08 15:56:20 -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
692749e72f Support video events, new media player 2019-09-17 16:30:04 -04:00
miruka
af17151c11 Fix shortcut focus issue? 2019-09-09 06:47:36 -04:00
miruka
131a20e9c5 Add context menu to copy selected messages 2019-09-06 15:06:35 -04:00
miruka
58d491a2b3 Add basic JS/QML debug console 2019-09-05 15:43:00 -04:00
miruka
92f6274458 Use QtGraphicalEffects.LinearGradient
Instead of using a Rectangle and its gradient prop, since there's no
need for the rotation/scale hack and it gives better quality.
2019-08-30 19:21:51 -04:00
miruka
f25a0d7c87 mainUI: be an Item instead of Rectangle 2019-08-30 19:09:21 -04:00
miruka
e506a70767 Fix random shortcuts getting triggered
Caused the "window bounces when typing text" bug
2019-08-30 19:06:42 -04:00
miruka
3a6ecce4f7 Improve background gradient 2019-08-29 21:06:24 -04:00
miruka
ff9f8127d7 UI gradient background, adjust some colors 2019-08-28 19:34:50 -04:00
miruka
560981a97e Remove uneeded HRectangle component 2019-08-27 22:46:31 -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
109082c8d8 Use a Loader instead of StackView for pageStack 2019-08-19 15:38:45 -04:00
miruka
7319c8d7b4 Highlight currently select account/room delegate 2019-08-17 16:59:13 -04:00
miruka
2e89dcae9e Add shortcut to focus filter rooms field 2019-08-17 15:58:32 -04:00
miruka
72b5954ce3 Simplify startup and improve its animation
- Remove Python.loadingAccounts/willLoadAccounts
- Fix HPage SwipeView bug that caused its inner SidePane to steal focus

- Use overshoot for animation
- Get rid of sidepane flickering
- Set default HNumberAnimation easing.type to OutQuad, specify InOutQuad
  for HCheckBox
2019-08-17 14:14:18 -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
5dc6c071d6 Add animation when reloading config file 2019-07-24 17:40:06 -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
c0b51b574c ui-settings: Rename write_aliases to writeAliases 2019-07-21 08:57:17 -04:00
miruka
df920da2a6 Save & restore previous page when relaunching app 2019-07-21 08:55:25 -04:00
miruka
246058e647 Make Chat show spinner until ready
Like EditAccount, instead of crashing if the room isn't loaded yet.
2019-07-21 08:38:49 -04:00
miruka
853bb350b4 Make EditAccount show a spinner until ready
Instead of crashing if userInfo is not yet available.

statusMessage is removed for now from UserUpdated events,
and the users model items will have a "loading" property.
2019-07-21 07:14:16 -04:00
miruka
71f78feec6 Define UIState config file 2019-07-21 06:05:01 -04:00
miruka
414082d258 Make EditAccount keyboard-flickable, fix function 2019-07-20 18:28:00 -04:00
miruka
41eea44fff Add keyboard shortcuts to flick the events list 2019-07-20 18:08:58 -04:00
miruka
58079a4ac2 Support RoomMessageEmote events 2019-07-19 19:19:43 -04:00
miruka
a3e2233391 Fix window/content sizes for EditAccount page 2019-07-18 23:59:05 -04:00
miruka
2cf0864b18 Implement multi-account writing for sendbox 2019-07-18 23:50:23 -04:00
miruka
ff7c2413df Change "Save" button to "Apply" in EditAccount 2019-07-18 20:58:38 -04:00
miruka
4d32adaa41 Animate event side change 2019-07-18 07:22:41 -04:00
miruka
1fa8b70359 ES5 → 7: Use for in/of and let 2019-07-18 05:18:13 -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
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