Commit Graph

627 Commits

Author SHA1 Message Date
miruka
2001fcf70a openImageViewer(): take an optional callback 2020-07-19 20:33:40 -04:00
miruka
48014cb8e5 Allow right clicking outside of image to close it 2020-07-19 20:22:36 -04:00
miruka
8053bd7d01 EventFile: respond to middle click (same as left) 2020-07-19 20:21:26 -04:00
miruka
b8833af3f9 HTile: add middleClicked() signal 2020-07-19 20:20:53 -04:00
miruka
de6d8fa59d Make media openable with the openLinks keybind
This involved a refactoring to move all the media handling functions
(downloading, opening externally, etc) out of the Event delegates and
into the EventList, which manage keybinds instead.

This should also be better for performance since all these functions are
no longer duplicated for every Event in view.

Other user-noticable change: clicking on non-image media will
always download and open them no matter if the room is encrypted or not,
instead of opening non-encrypted files in browser like before. It will
be possible to still do that with an "open externally" command later.
2020-07-19 20:10:31 -04:00
miruka
2dbb155a22 Fix clicking in image viewer always closing GIFs 2020-07-19 16:02:38 -04:00
miruka
465d31790f Image viewer: handle images without known w/h
There's no way to know in advance the real size for
HTTP image previews and m.image events sent by some clients
2020-07-19 15:50:10 -04:00
miruka
f1055ce5b9 Fix loading m.image events in encrypted rooms
Fix bug introduced in 11fb32:

When loading an encrypted thumbnail, QML lacks the decryption dict for
half a second at first.

When calling python like this, python calls the wrong matrix API
for fetching the encrypted thumbnail, and the added retry code
would be forever stuck.

The retry code has been moved to QML, and now works for all HImage.
2020-07-19 14:49:41 -04:00
miruka
26a4d76fc2 Implement basic image viewer popup
Current features:

- Show scaled up thumbnail while the full image is loading
- Click to alternate between scaling mode (or reset zoom if not 1x)
- Click outside of image to close
- Double click to toggle fullscreen
- Middle click to open externally (also for thumbnail in timeline)
- Right click anywhere to close
- Ctrl+wheel to zoom
- Click-drag to pan when image larger than window
2020-07-19 03:26:33 -04:00
miruka
d4fb38fd1a Use layout margin instead of Item after Daybreak 2020-07-18 15:02:19 -04:00
miruka
03af1da1d4 Remove power level apply/cancel button texts
Lazy fix for the layout problem
2020-07-17 06:40:15 -04:00
miruka
7f478efc40 Topic area, power level text: fix disabled opacity 2020-07-17 05:29:25 -04:00
miruka
716ac2a0af Refer to custom components to access their enums 2020-07-17 01:45:02 -04:00
miruka
6c4ee17e40 Retrieve last seen time for offline room members 2020-07-17 00:46:46 -04:00
miruka
aff5f45ca0 utils.h: check for Q_OS_LINUX, not _UNIX 2020-07-16 23:05:02 -04:00
miruka
189b325a2b Document X11 dependencies in INSTALL.md 2020-07-16 19:26:21 -04:00
miruka
abcea2244d Make libX11 & libXScrnSaver optional on Linux 2020-07-16 19:09:09 -04:00
miruka
42791f32d3 Enter member profile → focus power level control 2020-07-16 18:17:44 -04:00
miruka
bcf93a6f36 Disable member power level control when offline 2020-07-16 18:11:37 -04:00
miruka
74c4d63c16 Add C++ clipboard image provider
Will be used to show a preview before uploading image from clipboard.
Transforming the clipboard image to PNG (or any other real format) is
slow and freezes the GUI, with the provider we can display it directly.
2020-07-16 14:26:09 -04:00
miruka
60832b2fcd Confirm uploading from path in clipboard 2020-07-16 12:42:42 -04:00
miruka
04692179f9 MemberProfile: admins can't demote other admins 2020-07-15 10:04:31 -04:00
miruka
62ea61380a Split avatar presence orb into its own component 2020-07-15 00:39:16 -04:00
miruka
5007a5d97c Fix reply bar height 2020-07-14 05:25:32 -04:00
miruka
c018c04cab Auto-expand room pane to show settings/profiles
If the room pane is below the default width (by user resizing or because
of narrow window), go to the room settings or a member profile will
automatically expand it as needed.

The pane goes back to its previous size once the settings/profile is
left.

If the window is narrow enough that expanding the pane normally would
reduce the timeline's width past its minimum, the pane is shown as an
overlay instead.
2020-07-14 03:00:10 -04:00
miruka
ec9004101a Show details in timeline for power level events 2020-07-13 23:36:18 -04:00
miruka
bd50cd46fa Fix old power events sent when setting user level 2020-07-13 21:14:14 -04:00
miruka
7277b5d198 PowerLevelControl: add error and warning texts 2020-07-13 19:21:50 -04:00
miruka
757679a6e0 Make power level control permission-aware 2020-07-13 18:57:42 -04:00
miruka
0459657575 Room default power level awareness 2020-07-13 18:54:30 -04:00
miruka
9d397b62c5 Update room member models on power levels event 2020-07-13 18:54:30 -04:00
miruka
966070b4d6 MemberDeviceSection: elide txt instead of wrapping
Wrapping the text just makes the section overflow when
the member pane gets too narrow.
2020-07-12 17:22:28 -04:00
miruka
fe831e7865 Add power level display to member profile 2020-07-12 16:14:24 -04:00
miruka
2644e6d8b0 Fix account update method for unasaved accounts
If the account passed to `saved_accounts.update()` doesn't exist in the
config file, return instead of failing with a KeyError.

An account can be absent from the file if "Remember my account" was
unchecked on login, or if the file hasn't been updated yet on disk after
login (race condition).
2020-07-11 17:11:04 -04:00
miruka
f05f2357c7 Fix accounts.json update with missing enabled key 2020-07-11 14:38:10 -04:00
miruka
3c620f6fd1 Add auto-away feature for Linux X11 2020-07-11 14:38:08 -04:00
miruka
159f4e3d15 Set a maximum width on member profile avatar 2020-07-10 16:45:31 -04:00
miruka
c53aa5ffa9 Add presence details to member profile 2020-07-10 16:44:08 -04:00
miruka
fec1026346 Add direct keybinds for presence states 2020-07-10 15:15:53 -04:00
miruka
e5b67c722e Disable inviting members while offline 2020-07-10 13:15:01 -04:00
miruka
79fdc710c3 Fix & improve send_file handling of offline account
- Show a transfer stuck at 0kb uploaded in the GUI instead of waiting to
  be online to show anything

- Fix getting online not making the upload start
2020-07-10 13:15:01 -04:00
miruka
f03ac77595 Improve Presence docstring 2020-07-10 13:14:18 -04:00
miruka
435bbdaf22 Fix highlight when ctrl-tabbing to AddNewChat page 2020-07-10 13:14:18 -04:00
miruka
099c20c138 Add keyboard navigation for account device list
Enter/Return/Menu: open device menu
Space: toggle check device
Escape: uncheck all
Alt+R/F5: refresh device list
Alt+S/Delete: sign out checked or all sessions
2020-07-10 13:14:18 -04:00
miruka
9612470c9c Highlight first item when opening context menu 2020-07-10 13:14:18 -04:00
miruka
3e92b882c9 Open event context menu on menu keypress 2020-07-10 13:14:18 -04:00
miruka
affd0d0bd3 Improve member list highlighted item behavior
- When focusing the "Filter members" field, highlight the first item if
  none already is

- When pressing esc in the field, clear any highlight
2020-07-10 13:14:17 -04:00
miruka
c35894e4c8 HTile: trigger leftClicked() on enter/return/space
This makes it possible to activate any tab-focused HTile with the
keyboard.
2020-07-10 13:14:17 -04:00
miruka
92cbc4b006 Add keyboard controls for members list & profile 2020-07-10 13:14:17 -04:00
miruka
dc2a7b8ee1 HMenuItem: always use onTriggered, not onClicked 2020-07-10 13:14:17 -04:00