This also makes long messages unreadable, because we don't shorten long
usernames anymore. We may eventually want to do that again, but it is
hard with translations and we probably want to shorten the displayname
more, as before this change the message was only ever as long as the
timestamp, which is usually just 5 characters...
Pagination could get stuck, if the messages request failed.
Section height seemes to have been calculated to late, which would make
some section overlap the next message in some cases. Fix that by doing
the height calculation manually.
Mentions are now loaded from the cache instead of
directly from the web request. Mentions are also
properly saved to the cache now (instead of as empty
strings). Still lots of tweaks left on this feature.
On first launch, before the user has configured any settings,
check the value of the QT_QPA_PLATFORMTHEME environment var.
If it is set, use the system theme as the default instead of the
light theme. This fixes#72.
Cache user mentions when they are retrieved from the server.
This logic currently isn't being utilized by the UI. Additionally,
the app should use a 'since' value to only get mentions newer
than those stored in the DB, to avoid excessive web requests.
This will be implemented in a future commit.
Mentions are now separated into 'this room' and 'all rooms'
tab., which allows the user to filter on the current room
if they desire. Should add additional logic in the future
to show which room the mention was in the for the 'all rooms'
view.
I'm not sure, if that is the right way, but Qt doesn't really have a way
to format custom localised dates, so I tried to find the closest
approximations to what we currently have.
Relates to #69
Respect system styling
Increase size of emojis (to remove empty space)
Add hover effect (partially adresses #41)
Less hardcoding of sizes
Use emoji font (color)
If the QMimeData contains an image, it actually has a mime type of
application/x-qt-image. At least in some cases accessing the image/*
data returns a 0 length array. Accessing the data via ->imageData works
however. So we use that as our accessor and pass it to the preview
dialog.
Add a RoomListItem-like button that opens a dialog
containing all of the messages that would result in a
highlight from the server (for example, the user is mentioned,
or @room is mentioned).
This is VERY rudimentary and will be completely reworked in the future
to take advantage of the existing TimelineView class, instead of
using a dialog like it does now. The button to show the mentions
also needs work.
Quoted replies now include matrix.to links for the event and the user.
UI Rendering has been (slightly) improved... still very WIP.
Restructured the reply structure in the code for future usability
improvements.
Add placeholder UI for showing replies in the text entry widget.
Existing quoting capability has been removed (Temporarily), as
it was replaced with the new reply capability. Replies sent from
nheko do not currently appear correctly in the timeline (this
will be fixed in a future commit).
Parsing html as xml has inherent problems, most notable there are many
matrix clients that don't escape ampersands in urls of mx-replies, etc.
(See issue #18)
This also removes the replacement of <mx-reply> as it isn't strictly
needed.
Also the QRegExp is replaced with the Qt5 QRegularExpression for
perfomance and because it supports lookahead and lookbehind.
I'm pretty sure that the original code also replaced href="" with
href=\"\", which was probably wrong, but I'm not to sure about that.
Fixes#18
Colors are generated asynchronously now and the TimelineItem is
updated when the color generation finishes. This allows the UI
to stay responsive while new colors are being generated.
When opening images in the full-screen overlay, there is now
a download button next to the close button. This button utilizes
the same functionality as the right-click->save image button.
Restored the emoji picker, but it now falls back to the system
instead of forcing Emoji One. The allows users to user the
picker for convenience, but doesn't enforce the emoji style on them.
Add initial loading of qt jdenticon plugin:
https://github.com/redsky17/qt-jdenticon
Currently, the library's functionality has not been integrated
into the rest of nheko. Next step is to add a configuration
item in the User Settings and use the plugin to generate
avatars for users without their own picture. These avatars
should be cached in the Cache object.
User colors are now stored in cache. This is consistent
with other similar variables. I think there's a bug
right now where it doesn't properly refresh colors
for the TimeLineItem when the theme is changed.
When user is mentioned (via matrix 'highlight_count'), inactive
rooms will use a different color for the notification circle than
when only general unread messages exist.
Author color is now cached so that it will not be re-calculated
each time a new message is posted. This cache gets cleared when
the theme is changed.
Additionally, the author color is now automatically refreshed
when the theme is changed, fixing the issue where you had to
change rooms before the colors would switch.
Update the author color generation. Now, instead of generating
an entire hex string based on the user id, the user id instead
is used to generate a hue value. After this hue value is created,
there is some logic to tweak first the lightness and then saturation
values to achieve a readable color (in contrast to the background).
This change makes it so that user colors will not vary as wildly
between the different themes.
The values still are not cached and still do not update
initially when the theme is changed. Both of these things
will be resolved.
Theme and Font Family settings will now correctly display the stored
settings when nheko is re-launched. Previously, these combo boxes
would default to the first thing in the combo box, even if that
wasn't what the user selected.
User can now select a font from the installed fonts on their system
This font currently will only be applied when nheko is restarted
(similar to how font size and scaling currently work). This will
be addressed in a future commit. Additionally, the dropdown
does not correctly select the previously-chosen user font, and
instead defaults to the first font available on the system
(alphabetically). This is similar to the issue with the 'Theme'
combo defaulting to 'Light' even when another theme is selected.
work regardless of the theme choices the user makes. The code
now incorporates the contrast between the background color and the
color generated by the user_name when picking colors. It currently
has two 'big' issues:
1. Colors are not cached. I am planning on adding a QHash for this
a little later. This should improve performance by not calculating
the color for the same users over and over and over again.
2. Theme changes do not trigger the colors to get refreshed.
Currently, you will have to switch to a different room and back
to get the colors to refresh.
This fixes#2, but reverts mujx#438. I do not think mujx#438 was a
valid issue, as it complained about the display of valid HTML on riot,
which speaks more to how Riot styles things than about an issue in
nheko itself.