2019-07-23 17:14:02 +10:00
|
|
|
// vim: syntax=qml
|
|
|
|
|
2019-07-25 04:58:16 +10:00
|
|
|
// Base variables
|
|
|
|
|
2019-07-24 16:14:34 +10:00
|
|
|
real uiScale: 1.0 /* TODO: Implement correctly, do not change for now */
|
|
|
|
real fontScale: uiScale
|
2019-07-23 17:14:02 +10:00
|
|
|
|
2019-07-24 16:14:34 +10:00
|
|
|
Behavior on uiScale { HNumberAnimation {} }
|
|
|
|
Behavior on fontScale { HNumberAnimation {} }
|
2019-07-23 17:14:02 +10:00
|
|
|
|
2019-07-24 16:14:34 +10:00
|
|
|
int minimumSupportedWidth: 240 * uiScale
|
|
|
|
int minimumSupportedHeight: 120 * uiScale
|
|
|
|
int contentIsWideAbove: 439 * uiScale
|
2019-07-23 17:14:02 +10:00
|
|
|
|
2019-07-24 16:14:34 +10:00
|
|
|
int minimumSupportedWidthPlusSpacing: minimumSupportedWidth + spacing * 2
|
|
|
|
int minimumSupportedHeightPlusSpacing: minimumSupportedHeight + spacing * 2
|
|
|
|
|
2019-08-21 08:31:20 +10:00
|
|
|
int baseElementsHeight: 36 * uiScale
|
|
|
|
int spacing: 12 * uiScale
|
|
|
|
int radius: 5
|
|
|
|
int animationDuration: 100
|
|
|
|
real disabledElementsOpacity: 0.3
|
2019-07-24 16:14:34 +10:00
|
|
|
|
|
|
|
string preferredIconPack: "light-thin"
|
2019-07-23 17:14:02 +10:00
|
|
|
|
|
|
|
fontSize:
|
2019-08-18 04:54:34 +10:00
|
|
|
int smaller: 13 * fontScale
|
2019-07-24 16:14:34 +10:00
|
|
|
int small: 13 * fontScale
|
|
|
|
int normal: 16 * fontScale
|
|
|
|
int big: 22 * fontScale
|
|
|
|
int bigger: 32 * fontScale
|
|
|
|
int biggest: 48 * fontScale
|
2019-07-23 17:14:02 +10:00
|
|
|
|
|
|
|
fontFamily:
|
2019-07-24 16:14:34 +10:00
|
|
|
string sans: "Roboto"
|
2019-07-23 17:14:02 +10:00
|
|
|
string serif: "Roboto Slab"
|
2019-07-24 16:14:34 +10:00
|
|
|
string mono: "Hack"
|
2019-07-23 17:14:02 +10:00
|
|
|
|
|
|
|
colors:
|
2019-07-24 16:14:34 +10:00
|
|
|
int hue: 260
|
|
|
|
int saturation: 40
|
|
|
|
real intensity: 1.0
|
|
|
|
real opacity: 1.0
|
|
|
|
|
|
|
|
color weakBackground: hsluv(hue, saturation, intensity * 12, opacity)
|
|
|
|
color mediumBackground: hsluv(hue, saturation, intensity * 9, opacity)
|
|
|
|
color strongBackground: hsluv(hue, saturation, intensity * 6, opacity)
|
2019-07-25 06:21:34 +10:00
|
|
|
|
|
|
|
color inputBackground:
|
|
|
|
hsluv(hue, saturation, intensity * 2, Math.min(0.6, opacity))
|
2019-07-24 16:14:34 +10:00
|
|
|
|
2019-08-18 17:27:00 +10:00
|
|
|
color accentBackground:
|
|
|
|
hsluv(hue, saturation * 1.25, intensity * 42, Math.min(0.6, opacity))
|
|
|
|
|
|
|
|
color strongAccentBackground:
|
|
|
|
hsluv(hue, saturation * 2, intensity * 52, Math.min(0.6, opacity))
|
|
|
|
|
2019-08-17 02:07:22 +10:00
|
|
|
color brightText: hsluv(0, 0, intensity * 100)
|
|
|
|
color text: hsluv(0, 0, intensity * 80)
|
|
|
|
color halfDimText: hsluv(0, 0, intensity * 70)
|
|
|
|
color dimText: hsluv(0, 0, intensity * 55)
|
|
|
|
color dimmerText: hsluv(0, 0, intensity * 30)
|
2019-08-17 06:30:18 +10:00
|
|
|
|
|
|
|
color errorText: hsluv(0, saturation * 2.25, 50)
|
2019-08-17 03:24:48 +10:00
|
|
|
color accentText: hsluv(hue - 80, saturation * 2.25, 60)
|
2019-08-17 02:07:22 +10:00
|
|
|
color link: accentText
|
|
|
|
color code: hsluv(hue + 5, saturation * 1.5, intensity * 60)
|
2019-07-24 16:14:34 +10:00
|
|
|
|
2019-07-25 08:09:28 +10:00
|
|
|
// Example of an animation, set running: true to enable
|
|
|
|
NumberAnimation on hue
|
2019-08-16 02:06:51 +10:00
|
|
|
running: false
|
|
|
|
from: 0
|
|
|
|
to: 360
|
2019-07-25 08:09:28 +10:00
|
|
|
duration: 10000
|
2019-08-16 02:06:51 +10:00
|
|
|
loops: Animation.Infinite
|
2019-07-24 16:14:34 +10:00
|
|
|
|
2019-07-23 17:14:02 +10:00
|
|
|
|
2019-07-25 04:58:16 +10:00
|
|
|
// Generic UI controls
|
|
|
|
|
2019-07-23 17:14:02 +10:00
|
|
|
controls:
|
2019-07-24 16:14:34 +10:00
|
|
|
box:
|
|
|
|
color background: colors.strongBackground
|
|
|
|
int radius: theme.radius
|
|
|
|
|
2019-07-25 16:43:52 +10:00
|
|
|
popup:
|
|
|
|
color background: colors.strongBackground
|
|
|
|
|
2019-07-24 16:14:34 +10:00
|
|
|
header:
|
2019-07-25 06:21:34 +10:00
|
|
|
color background: colors.strongBackground
|
2019-07-24 16:14:34 +10:00
|
|
|
|
2019-07-23 17:14:02 +10:00
|
|
|
button:
|
2019-08-21 08:31:20 +10:00
|
|
|
color background: colors.inputBackground
|
|
|
|
color text: colors.text
|
2019-08-21 07:41:24 +10:00
|
|
|
|
|
|
|
color hoveredOverlay: hsluv(0, 0, 50, 0.3)
|
|
|
|
color pressedOverlay: hsluv(0, 0, 50, 0.6)
|
|
|
|
color checkedOverlay: colors.accentBackground
|
2019-07-23 17:14:02 +10:00
|
|
|
|
2019-08-21 08:31:20 +10:00
|
|
|
checkBox:
|
|
|
|
color checkIconColor: colors.strongAccentBackground
|
|
|
|
color boxBackground: colors.inputBackground
|
|
|
|
|
|
|
|
color boxBorder: hsluv(0, 0, 50, 0.3)
|
|
|
|
color boxHoveredBorder: colors.accentBackground
|
|
|
|
color boxPressedBorder: colors.strongAccentBackground
|
|
|
|
|
|
|
|
color text: colors.text
|
|
|
|
|
2019-08-21 18:58:34 +10:00
|
|
|
listView:
|
|
|
|
color highlight: hsluv(0, 0, 50, 0.3)
|
|
|
|
|
2019-07-23 17:14:02 +10:00
|
|
|
textField:
|
2019-07-25 06:21:34 +10:00
|
|
|
color background: colors.inputBackground
|
2019-07-23 17:14:02 +10:00
|
|
|
color focusedBackground: background
|
2019-07-24 16:14:34 +10:00
|
|
|
|
|
|
|
int borderWidth: 1
|
|
|
|
color border: "transparent"
|
2019-08-18 17:27:00 +10:00
|
|
|
color focusedBorder: colors.strongAccentBackground
|
2019-07-24 16:14:34 +10:00
|
|
|
|
|
|
|
color text: colors.text
|
|
|
|
color focusedText: colors.text
|
2019-07-23 17:14:02 +10:00
|
|
|
|
|
|
|
textArea:
|
2019-07-25 06:21:34 +10:00
|
|
|
color background: colors.inputBackground
|
2019-07-24 16:14:34 +10:00
|
|
|
color text: colors.text
|
|
|
|
|
|
|
|
avatar:
|
|
|
|
int size: baseElementsHeight
|
|
|
|
int radius: theme.radius
|
|
|
|
|
|
|
|
background:
|
|
|
|
int saturation: colors.saturation - 5
|
|
|
|
int lightness: Math.min(50, colors.intensity * 20)
|
|
|
|
real opacity: 1.0
|
|
|
|
|
|
|
|
letter:
|
|
|
|
int saturation: colors.saturation * 1.5
|
|
|
|
int lightness: colors.intensity * 60
|
|
|
|
real opacity: 1.0
|
|
|
|
|
|
|
|
displayName:
|
2019-07-25 06:28:56 +10:00
|
|
|
int saturation: colors.saturation
|
|
|
|
int lightness: Math.min(55, colors.intensity * 55)
|
2019-07-24 16:14:34 +10:00
|
|
|
|
|
|
|
|
2019-07-25 04:58:16 +10:00
|
|
|
// Special UI parts
|
|
|
|
|
2019-07-24 16:14:34 +10:00
|
|
|
ui:
|
2019-07-25 04:58:16 +10:00
|
|
|
// Supported: local file path or web URL
|
|
|
|
url image: ""
|
2019-07-24 16:14:34 +10:00
|
|
|
color background: colors.weakBackground
|
|
|
|
|
2019-07-23 17:14:02 +10:00
|
|
|
|
|
|
|
sidePane:
|
2019-07-24 16:14:34 +10:00
|
|
|
real autoWidthRatio: 0.33 * uiScale
|
|
|
|
int maximumAutoWidth: 320 * uiScale
|
2019-07-23 17:14:02 +10:00
|
|
|
|
2019-07-24 16:14:34 +10:00
|
|
|
int autoCollapseBelowWidth: 128 * uiScale
|
|
|
|
int collapsedWidth: controls.avatar.size
|
2019-07-23 17:14:02 +10:00
|
|
|
|
|
|
|
int autoReduceBelowWindowWidth:
|
|
|
|
minimumSupportedWidthPlusSpacing + collapsedWidth
|
|
|
|
|
2019-07-24 16:14:34 +10:00
|
|
|
color background: colors.strongBackground
|
2019-07-23 17:14:02 +10:00
|
|
|
|
|
|
|
account:
|
2019-08-18 17:27:00 +10:00
|
|
|
real collapsedOpacity: 0.3
|
|
|
|
color background: "transparent"
|
|
|
|
color name: colors.text
|
2019-07-24 16:14:34 +10:00
|
|
|
|
|
|
|
room:
|
2019-08-17 03:04:54 +10:00
|
|
|
real leftRoomOpacity: 0.65
|
|
|
|
|
|
|
|
color background: "transparent"
|
|
|
|
color name: colors.text
|
|
|
|
color subtitle: colors.dimText
|
|
|
|
color lastEventDate: colors.halfDimText
|
2019-07-23 17:14:02 +10:00
|
|
|
|
2019-08-21 18:39:07 +10:00
|
|
|
member:
|
|
|
|
color background: "transparent"
|
|
|
|
color name: colors.text
|
|
|
|
|
2019-07-23 17:14:02 +10:00
|
|
|
settingsButton:
|
2019-08-16 02:06:51 +10:00
|
|
|
color background: colors.inputBackground
|
2019-07-23 17:14:02 +10:00
|
|
|
|
|
|
|
filterRooms:
|
2019-08-16 02:06:51 +10:00
|
|
|
color background: colors.inputBackground
|
2019-07-23 17:14:02 +10:00
|
|
|
|
|
|
|
|
2019-07-24 16:14:34 +10:00
|
|
|
chat:
|
2019-07-23 17:14:02 +10:00
|
|
|
roomHeader:
|
2019-07-24 16:14:34 +10:00
|
|
|
color background: colors.strongBackground
|
|
|
|
color name: colors.text
|
|
|
|
color topic: colors.dimText
|
|
|
|
|
|
|
|
roomSidePane:
|
|
|
|
color background: colors.mediumBackground
|
|
|
|
|
2019-07-23 17:14:02 +10:00
|
|
|
eventList:
|
|
|
|
int ownEventsOnRightUnderWidth: 768
|
2019-07-24 16:14:34 +10:00
|
|
|
color background: "transparent"
|
2019-07-23 17:14:02 +10:00
|
|
|
|
|
|
|
message:
|
2019-07-24 16:14:34 +10:00
|
|
|
int radius: theme.radius
|
|
|
|
color background: colors.strongBackground
|
2019-07-25 14:10:07 +10:00
|
|
|
color ownBackground: hsluv(
|
|
|
|
colors.hue, colors.saturation + 30, colors.intensity * 6, opacity
|
|
|
|
)
|
|
|
|
|
2019-07-24 16:14:34 +10:00
|
|
|
color body: colors.text
|
|
|
|
color date: colors.dimText
|
2019-07-23 17:14:02 +10:00
|
|
|
|
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 22:01:22 +10:00
|
|
|
color greenText: hsluv(135, colors.saturation * 2.25, 80)
|
2019-07-24 16:14:34 +10:00
|
|
|
color link: colors.link
|
|
|
|
color code: colors.code
|
2019-07-23 17:14:02 +10:00
|
|
|
|
|
|
|
string styleSheet:
|
|
|
|
"a { color: " + link + " }" +
|
|
|
|
|
|
|
|
"code { font-family: " + fontFamily.mono + "; " +
|
|
|
|
"color: " + code + " }" +
|
|
|
|
|
2019-07-24 16:14:34 +10:00
|
|
|
"h1, h2, h3 { font-weight: normal }" +
|
|
|
|
"h1 { font-size: " + fontSize.biggest + "px }" +
|
|
|
|
"h2 { font-size: " + fontSize.bigger + "px }" +
|
|
|
|
"h3 { font-size: " + fontSize.big + "px }" +
|
|
|
|
"h4 { font-size: " + fontSize.normal + "px }" +
|
|
|
|
"h5 { font-size: " + fontSize.small + "px }" +
|
|
|
|
"h6 { font-size: " + fontSize.smaller + "px }" +
|
2019-07-23 17:14:02 +10:00
|
|
|
|
|
|
|
".greentext { color: " + greenText + " }"
|
|
|
|
|
|
|
|
string styleInclude:
|
|
|
|
'<style type"text/css">\n' + styleSheet + '\n</style>\n'
|
|
|
|
|
|
|
|
daybreak:
|
2019-07-24 16:14:34 +10:00
|
|
|
color background: colors.strongBackground
|
|
|
|
color text: colors.text
|
|
|
|
int radius: theme.radius
|
2019-07-23 17:14:02 +10:00
|
|
|
|
|
|
|
inviteBanner:
|
2019-07-24 16:14:34 +10:00
|
|
|
color background: colors.mediumBackground
|
2019-07-23 17:14:02 +10:00
|
|
|
|
|
|
|
leftBanner:
|
2019-07-24 16:14:34 +10:00
|
|
|
color background: colors.mediumBackground
|
2019-07-23 17:14:02 +10:00
|
|
|
|
|
|
|
unknownDevices:
|
2019-07-24 16:14:34 +10:00
|
|
|
color background: colors.mediumBackground
|
2019-07-23 17:14:02 +10:00
|
|
|
|
|
|
|
typingMembers:
|
2019-07-24 16:14:34 +10:00
|
|
|
color background: colors.mediumBackground
|
2019-07-23 17:14:02 +10:00
|
|
|
|
|
|
|
sendBox:
|
2019-07-24 16:14:34 +10:00
|
|
|
color background: colors.strongBackground
|