Use Base components without namespace prefix

This commit is contained in:
miruka 2019-04-28 15:18:36 -04:00
parent 89fcfbea82
commit d0089df051
25 changed files with 123 additions and 128 deletions

12
TODO.md
View File

@ -6,9 +6,9 @@
- 100% CPU usage when hitting top edge to trigger messages loading - 100% CPU usage when hitting top edge to trigger messages loading
- Sending `![A picture](https://picsum.photos/256/256)` → not clickable? - Sending `![A picture](https://picsum.photos/256/256)` → not clickable?
- Icons aren't reloaded - Icons aren't reloaded
- Bug when resizing window being tiled (i3), can't figure it out
- HStyle singleton isn't reloaded - HStyle singleton isn't reloaded
- `MessageDelegate.qml:63: TypeError: 'reloadPreviousItem' not a function` - `MessageDelegate.qml:63: TypeError: 'reloadPreviousItem' not a function`
- Bug when resizing window being tiled (i3), can't figure it out
- UI - UI
- Use nested listview for categories instead of section property - Use nested listview for categories instead of section property
@ -17,17 +17,13 @@
- Scaling - Scaling
- See [Text.fontSizeMode](https://doc.qt.io/qt-5/qml-qtquick-text.html#fontSizeMode-prop) - See [Text.fontSizeMode](https://doc.qt.io/qt-5/qml-qtquick-text.html#fontSizeMode-prop)
- Test HGlassRectangle elements when no effects are available - Test HGlassRectangle elements when no effects are available
- Add room
- Leave room - Leave room
- Forget room warning popup - Forget room warning popup
- Use HRowLayout and its totalSpacing wherever possible
- Spacer component - Spacer component
- One line label componant
- Proper button background componant
- Collapsible roomList sections, + button
- Prevent using the SendBox if no permission (power levels) - Prevent using the SendBox if no permission (power levels)
- Spinner when loading past room events, images or clicking buttons - Spinner when loading past room events, images or clicking buttons
- Reorganize SidePane - Better theming/styling system
- Proper theme, with components taking their colors from theme settings
- Settings page - Settings page
- Multiaccount aliases - Multiaccount aliases
@ -69,4 +65,4 @@
- Distribution - Distribution
- Review setup.py, add dependencies - Review setup.py, add dependencies
- REAMDE.md - README.md

View File

@ -1,7 +1,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../Base" as Base import "../Base"
Rectangle { Rectangle {
property bool hidden: false property bool hidden: false
@ -23,12 +23,12 @@ Rectangle {
opacity: hidden ? 0 : 1 opacity: hidden ? 0 : 1
color: resolvedName === "?" ? color: resolvedName === "?" ?
Base.HStyle.avatar.background.unknown : HStyle.avatar.background.unknown :
Qt.hsla( Qt.hsla(
Backend.hueFromString(resolvedName), Backend.hueFromString(resolvedName),
Base.HStyle.avatar.background.saturation, HStyle.avatar.background.saturation,
Base.HStyle.avatar.background.lightness, HStyle.avatar.background.lightness,
Base.HStyle.avatar.background.alpha HStyle.avatar.background.alpha
) )
HLabel { HLabel {
@ -37,7 +37,7 @@ Rectangle {
visible: ! hidden visible: ! hidden
text: resolvedName.charAt(0) text: resolvedName.charAt(0)
color: Base.HStyle.avatar.letter color: HStyle.avatar.letter
font.pixelSize: parent.height / 1.4 font.pixelSize: parent.height / 1.4
} }

View File

@ -1,16 +1,16 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../Base" as Base import "../Base"
Base.HRowLayout { HRowLayout {
property alias text: noticeLabel.text property alias text: noticeLabel.text
property alias color: noticeLabel.color property alias color: noticeLabel.color
property alias font: noticeLabel.font property alias font: noticeLabel.font
property alias backgroundColor: noticeLabelBackground.color property alias backgroundColor: noticeLabelBackground.color
property alias radius: noticeLabelBackground.radius property alias radius: noticeLabelBackground.radius
Base.HLabel { HLabel {
id: noticeLabel id: noticeLabel
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap wrapMode: Text.Wrap
@ -24,8 +24,8 @@ Base.HRowLayout {
background: Rectangle { background: Rectangle {
id: noticeLabelBackground id: noticeLabelBackground
color: Base.HStyle.box.background color: HStyle.box.background
radius: Base.HStyle.box.radius radius: HStyle.box.radius
} }
} }
} }

View File

@ -1,9 +1,9 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../../Base" as Base import "../../Base"
Base.HGlassRectangle { HGlassRectangle {
id: banner id: banner
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 32 Layout.preferredHeight: 32
@ -14,16 +14,16 @@ Base.HGlassRectangle {
property alias buttonModel: bannerRepeater.model property alias buttonModel: bannerRepeater.model
property var buttonCallbacks: [] property var buttonCallbacks: []
Base.HRowLayout { HRowLayout {
id: bannerRow id: bannerRow
anchors.fill: parent anchors.fill: parent
Base.HAvatar { HAvatar {
id: bannerAvatar id: bannerAvatar
dimension: banner.Layout.preferredHeight dimension: banner.Layout.preferredHeight
} }
Base.HLabel { HLabel {
id: bannerLabel id: bannerLabel
textFormat: Text.StyledText textFormat: Text.StyledText
maximumLineCount: 1 maximumLineCount: 1
@ -43,7 +43,7 @@ Base.HGlassRectangle {
Item { Layout.fillWidth: true } Item { Layout.fillWidth: true }
Base.HRowLayout { HRowLayout {
id: bannerButtons id: bannerButtons
function getButtonsWidth() { function getButtonsWidth() {
@ -68,7 +68,7 @@ Base.HGlassRectangle {
id: bannerRepeater id: bannerRepeater
model: [] model: []
Base.HButton { HButton {
id: button id: button
text: modelData.text text: modelData.text
iconName: modelData.iconName iconName: modelData.iconName

View File

@ -1,12 +1,12 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../../Base" as Base import "../../Base"
Banner { Banner {
property var inviter: null property var inviter: null
color: Base.HStyle.chat.inviteBanner.background color: HStyle.chat.inviteBanner.background
avatarName: inviter ? inviter.displayname : "" avatarName: inviter ? inviter.displayname : ""
//avatarSource: inviter ? inviter.avatar_url : "" //avatarSource: inviter ? inviter.avatar_url : ""

View File

@ -1,13 +1,13 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../../Base" as Base import "../../Base"
import "../utils.js" as ChatJS import "../utils.js" as ChatJS
Banner { Banner {
property var leftEvent: null property var leftEvent: null
color: Base.HStyle.chat.leftBanner.background color: HStyle.chat.leftBanner.background
avatarName: ChatJS.getLeftBannerAvatarName(leftEvent, chatPage.userId) avatarName: ChatJS.getLeftBannerAvatarName(leftEvent, chatPage.userId)
labelText: ChatJS.getLeftBannerText(leftEvent) labelText: ChatJS.getLeftBannerText(leftEvent)

View File

@ -1,11 +1,11 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../Base" as Base import "../Base"
import "Banners" import "Banners"
import "RoomEventList" import "RoomEventList"
Base.HColumnLayout { HColumnLayout {
property string userId: "" property string userId: ""
property string roomId: "" property string roomId: ""

View File

@ -1,9 +1,9 @@
import QtQuick 2.7 import QtQuick 2.7
import "../../Base" as Base import "../../Base"
Base.HNoticeLabel { HNoticeLabel {
text: dateTime.toLocaleDateString() text: dateTime.toLocaleDateString()
color: Base.HStyle.chat.daybreak.foreground color: HStyle.chat.daybreak.foreground
backgroundColor: Base.HStyle.chat.daybreak.background backgroundColor: HStyle.chat.daybreak.background
radius: Base.HStyle.chat.daybreak.radius radius: HStyle.chat.daybreak.radius
} }

View File

@ -1,41 +1,41 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../../Base" as Base import "../../Base"
import "../utils.js" as ChatJS import "../utils.js" as ChatJS
Base.HRowLayout { HRowLayout {
id: eventContent id: eventContent
spacing: standardSpacing / 2 spacing: standardSpacing / 2
layoutDirection: isOwn ? Qt.RightToLeft : Qt.LeftToRight layoutDirection: isOwn ? Qt.RightToLeft : Qt.LeftToRight
Base.HAvatar { HAvatar {
id: avatar id: avatar
name: displayName name: displayName
hidden: combine hidden: combine
dimension: 28 dimension: 28
} }
Base.HLabel { HLabel {
id: contentLabel id: contentLabel
text: "<font color='" + text: "<font color='" +
Qt.hsla(Backend.hueFromString(displayName.value || dict.sender), Qt.hsla(Backend.hueFromString(displayName.value || dict.sender),
Base.HStyle.chat.event.saturation, HStyle.chat.event.saturation,
Base.HStyle.chat.event.lightness, HStyle.chat.event.lightness,
1) + 1) +
"'>" + "'>" +
(displayName.value || dict.sender) + " " + (displayName.value || dict.sender) + " " +
ChatJS.getEventText(type, dict) + ChatJS.getEventText(type, dict) +
"&nbsp;&nbsp;" + "&nbsp;&nbsp;" +
"<font size=" + Base.HStyle.fontSize.small + "px " + "<font size=" + HStyle.fontSize.small + "px " +
"color=" + Base.HStyle.chat.event.date + ">" + "color=" + HStyle.chat.event.date + ">" +
Qt.formatDateTime(dateTime, "hh:mm:ss") + Qt.formatDateTime(dateTime, "hh:mm:ss") +
"</font> " + "</font> " +
"</font>" "</font>"
textFormat: Text.RichText textFormat: Text.RichText
background: Rectangle {color: Base.HStyle.chat.event.background} background: Rectangle {color: HStyle.chat.event.background}
wrapMode: Text.Wrap wrapMode: Text.Wrap
leftPadding: horizontalPadding leftPadding: horizontalPadding

View File

@ -1,26 +1,26 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../../Base" as Base import "../../Base"
Row { Row {
id: row id: row
spacing: standardSpacing spacing: standardSpacing
layoutDirection: isOwn ? Qt.RightToLeft : Qt.LeftToRight layoutDirection: isOwn ? Qt.RightToLeft : Qt.LeftToRight
Base.HAvatar { id: avatar; hidden: combine; name: displayName } HAvatar { id: avatar; hidden: combine; name: displayName }
Base.HColumnLayout { HColumnLayout {
spacing: 0 spacing: 0
Base.HLabel { HLabel {
visible: ! combine visible: ! combine
id: nameLabel id: nameLabel
text: displayName.value || dict.sender text: displayName.value || dict.sender
background: Rectangle {color: Base.HStyle.chat.message.background} background: Rectangle {color: HStyle.chat.message.background}
color: Qt.hsla(Backend.hueFromString(text), color: Qt.hsla(Backend.hueFromString(text),
Base.HStyle.displayName.saturation, HStyle.displayName.saturation,
Base.HStyle.displayName.lightness, HStyle.displayName.lightness,
1) 1)
elide: Text.ElideRight elide: Text.ElideRight
maximumLineCount: 1 maximumLineCount: 1
@ -32,21 +32,21 @@ Row {
topPadding: verticalPadding topPadding: verticalPadding
} }
Base.HRichLabel { HRichLabel {
id: contentLabel id: contentLabel
text: (dict.formatted_body ? text: (dict.formatted_body ?
Backend.htmlFilter.filter(dict.formatted_body) : Backend.htmlFilter.filter(dict.formatted_body) :
dict.body) + dict.body) +
"&nbsp;&nbsp;<font size=" + Base.HStyle.fontSize.small + "&nbsp;&nbsp;<font size=" + HStyle.fontSize.small +
"px color=" + Base.HStyle.chat.message.date + ">" + "px color=" + HStyle.chat.message.date + ">" +
Qt.formatDateTime(dateTime, "hh:mm:ss") + Qt.formatDateTime(dateTime, "hh:mm:ss") +
"</font>" + "</font>" +
(isLocalEcho ? (isLocalEcho ?
"&nbsp;<font size=" + Base.HStyle.fontSize.small + "&nbsp;<font size=" + HStyle.fontSize.small +
"px>⏳</font>" : "") "px>⏳</font>" : "")
textFormat: Text.RichText textFormat: Text.RichText
background: Rectangle {color: Base.HStyle.chat.message.background} background: Rectangle {color: HStyle.chat.message.background}
color: Base.HStyle.chat.message.body color: HStyle.chat.message.body
wrapMode: Text.Wrap wrapMode: Text.Wrap
leftPadding: horizontalPadding leftPadding: horizontalPadding

View File

@ -1,7 +1,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../../Base" as Base import "../../Base"
import "../utils.js" as ChatJS import "../utils.js" as ChatJS
Column { Column {

View File

@ -1,13 +1,13 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../../Base" as Base import "../../Base"
Base.HGlassRectangle { HGlassRectangle {
property bool canLoadPastEvents: true property bool canLoadPastEvents: true
property int space: 8 property int space: 8
color: Base.HStyle.chat.roomEventList.background color: HStyle.chat.roomEventList.background
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
@ -40,7 +40,7 @@ Base.HGlassRectangle {
} }
} }
Base.HNoticeLabel { HNoticeLabel {
text: qsTr("Nothing to show here yet...") text: qsTr("Nothing to show here yet...")
visible: roomEventListView.model.count < 1 visible: roomEventListView.model.count < 1

View File

@ -1,43 +1,43 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../Base" as Base import "../Base"
Base.HGlassRectangle { HGlassRectangle {
property string displayName: "" property string displayName: ""
property string topic: "" property string topic: ""
id: roomHeader id: roomHeader
color: Base.HStyle.chat.roomHeader.background color: HStyle.chat.roomHeader.background
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 32 Layout.preferredHeight: 32
Base.HRowLayout { HRowLayout {
id: row id: row
spacing: 8 spacing: 8
anchors.fill: parent anchors.fill: parent
Base.HAvatar { HAvatar {
id: avatar id: avatar
name: displayName name: displayName
dimension: roomHeader.height dimension: roomHeader.height
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop
} }
Base.HLabel { HLabel {
id: roomName id: roomName
text: displayName text: displayName
font.pixelSize: Base.HStyle.fontSize.big font.pixelSize: HStyle.fontSize.big
elide: Text.ElideRight elide: Text.ElideRight
maximumLineCount: 1 maximumLineCount: 1
Layout.maximumWidth: row.width - row.totalSpacing - avatar.width Layout.maximumWidth: row.width - row.totalSpacing - avatar.width
} }
Base.HLabel { HLabel {
id: roomTopic id: roomTopic
text: topic text: topic
font.pixelSize: Base.HStyle.fontSize.small font.pixelSize: HStyle.fontSize.small
elide: Text.ElideRight elide: Text.ElideRight
maximumLineCount: 1 maximumLineCount: 1
Layout.maximumWidth: Layout.maximumWidth:

View File

@ -1,9 +1,9 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../Base" as Base import "../Base"
Base.HGlassRectangle { HGlassRectangle {
function setFocus() { textArea.forceActiveFocus() } function setFocus() { textArea.forceActiveFocus() }
id: root id: root
@ -12,18 +12,18 @@ Base.HGlassRectangle {
Layout.preferredHeight: textArea.implicitHeight Layout.preferredHeight: textArea.implicitHeight
// parent.height / 2 causes binding loop? // parent.height / 2 causes binding loop?
Layout.maximumHeight: pageStack.height / 2 Layout.maximumHeight: pageStack.height / 2
color: Base.HStyle.chat.sendBox.background color: HStyle.chat.sendBox.background
Base.HRowLayout { HRowLayout {
anchors.fill: parent anchors.fill: parent
Base.HAvatar { HAvatar {
id: avatar id: avatar
name: Backend.getUserDisplayName(chatPage.userId) name: Backend.getUserDisplayName(chatPage.userId)
dimension: root.Layout.minimumHeight dimension: root.Layout.minimumHeight
} }
Base.HScrollableTextArea { HScrollableTextArea {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true

View File

@ -1,19 +1,19 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../Base" as Base import "../Base"
import "utils.js" as ChatJS import "utils.js" as ChatJS
Base.HGlassRectangle { HGlassRectangle {
property var typingUsers: chatPage.roomInfo.typingUsers property var typingUsers: chatPage.roomInfo.typingUsers
color: Base.HStyle.chat.typingUsers.background color: HStyle.chat.typingUsers.background
Layout.fillWidth: true Layout.fillWidth: true
Layout.minimumHeight: usersLabel.text ? usersLabel.implicitHeight : 0 Layout.minimumHeight: usersLabel.text ? usersLabel.implicitHeight : 0
Layout.maximumHeight: Layout.minimumHeight Layout.maximumHeight: Layout.minimumHeight
Base.HLabel { HLabel {
id: usersLabel id: usersLabel
anchors.fill: parent anchors.fill: parent

View File

@ -1,8 +1,8 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../Base" as Base import "../Base"
Base.HNoticeLabel { HNoticeLabel {
text: "Select or add a room to start." text: "Select or add a room to start."
} }

View File

@ -1,13 +1,13 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../Base" as Base import "../Base"
Item { Item {
property string loginWith: "username" property string loginWith: "username"
property var client: null property var client: null
Base.HInterfaceBox { HInterfaceBox {
id: rememberBox id: rememberBox
title: "Sign in" title: "Sign in"
anchors.centerIn: parent anchors.centerIn: parent
@ -27,7 +27,7 @@ Item {
"no": function(button) { pageStack.showPage("Default") }, "no": function(button) { pageStack.showPage("Default") },
} }
Base.HLabel { HLabel {
text: qsTr( text: qsTr(
"Do you want to remember this account?\n\n" + "Do you want to remember this account?\n\n" +
"If yes, the " + loginWith + " and an access token will be " + "If yes, the " + loginWith + " and an access token will be " +

View File

@ -1,7 +1,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../Base" as Base import "../Base"
Item { Item {
property string loginWith: "username" property string loginWith: "username"
@ -10,7 +10,7 @@ Item {
property int wi: x property int wi: x
onWiChanged: console.log("loginI", wi) onWiChanged: console.log("loginI", wi)
Base.HInterfaceBox { HInterfaceBox {
id: signInBox id: signInBox
title: "Sign in" title: "Sign in"
anchors.centerIn: parent anchors.centerIn: parent
@ -42,7 +42,7 @@ Item {
"forgot": function(button) {} "forgot": function(button) {}
} }
Base.HRowLayout { HRowLayout {
spacing: signInBox.margins * 1.25 spacing: signInBox.margins * 1.25
Layout.margins: signInBox.margins Layout.margins: signInBox.margins
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
@ -50,7 +50,7 @@ Item {
Repeater { Repeater {
model: ["username", "email", "phone"] model: ["username", "email", "phone"]
Base.HButton { HButton {
iconName: modelData iconName: modelData
circle: true circle: true
checked: loginWith == modelData checked: loginWith == modelData
@ -60,7 +60,7 @@ Item {
} }
} }
Base.HTextField { HTextField {
id: identifierField id: identifierField
placeholderText: qsTr( placeholderText: qsTr(
loginWith === "email" ? "Email" : loginWith === "email" ? "Email" :
@ -73,7 +73,7 @@ Item {
Layout.margins: signInBox.margins Layout.margins: signInBox.margins
} }
Base.HTextField { HTextField {
id: passwordField id: passwordField
placeholderText: qsTr("Password") placeholderText: qsTr("Password")
echoMode: TextField.Password echoMode: TextField.Password

View File

@ -1,24 +1,24 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../Base" as Base import "../Base"
Base.HColumnLayout { HColumnLayout {
id: accountDelegate id: accountDelegate
width: parent.width width: parent.width
property string roomListUserId: userId property string roomListUserId: userId
Base.HRowLayout { HRowLayout {
id: row id: row
Base.HAvatar { id: avatar; name: displayName; dimension: 36 } HAvatar { id: avatar; name: displayName; dimension: 36 }
Base.HColumnLayout { HColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
Base.HLabel { HLabel {
id: accountLabel id: accountLabel
text: displayName.value || userId text: displayName.value || userId
elide: Text.ElideRight elide: Text.ElideRight
@ -28,11 +28,11 @@ Base.HColumnLayout {
rightPadding: leftPadding rightPadding: leftPadding
} }
Base.HTextField { HTextField {
id: statusEdit id: statusEdit
text: statusMessage || "" text: statusMessage || ""
placeholderText: qsTr("Set status message") placeholderText: qsTr("Set status message")
font.pixelSize: Base.HStyle.fontSize.small font.pixelSize: HStyle.fontSize.small
background: null background: null
padding: 0 padding: 0
@ -47,7 +47,7 @@ Base.HColumnLayout {
} }
} }
Base.HButton { HButton {
id: toggleExpand id: toggleExpand
iconName: roomList.visible ? "up" : "down" iconName: roomList.visible ? "up" : "down"
iconDimension: 16 iconDimension: 16

View File

@ -1,23 +1,23 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../Base" as Base import "../Base"
Base.HRowLayout { HRowLayout {
id: toolBar id: toolBar
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 32 Layout.preferredHeight: 32
Base.HButton { HButton {
iconName: "settings" iconName: "settings"
backgroundColor: Base.HStyle.sidePane.settingsButton.background backgroundColor: HStyle.sidePane.settingsButton.background
} }
Base.HTextField { HTextField {
id: filterField id: filterField
placeholderText: qsTr("Filter rooms") placeholderText: qsTr("Filter rooms")
backgroundColor: Base.HStyle.sidePane.filterRooms.background backgroundColor: HStyle.sidePane.filterRooms.background
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 32 Layout.preferredHeight: 32

View File

@ -1,7 +1,7 @@
import QtQuick 2.7 import QtQuick 2.7
import "../Base" as Base import "../Base"
Base.HLabel { HLabel {
width: roomList.width width: roomList.width
// topPadding is provided by the roomList spacing // topPadding is provided by the roomList spacing

View File

@ -1,7 +1,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.0 import QtQuick.Controls 2.0
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../Base" as Base import "../Base"
import "utils.js" as SidePaneJS import "utils.js" as SidePaneJS
MouseArea { MouseArea {
@ -11,19 +11,19 @@ MouseArea {
onClicked: pageStack.showRoom(roomList.userId, roomId) onClicked: pageStack.showRoom(roomList.userId, roomId)
Base.HRowLayout { HRowLayout {
anchors.fill: parent anchors.fill: parent
id: row id: row
spacing: 1 spacing: 1
Base.HAvatar { HAvatar {
id: roomAvatar id: roomAvatar
name: displayName name: displayName
dimension: roomDelegate.height dimension: roomDelegate.height
} }
Base.HColumnLayout { HColumnLayout {
Base.HLabel { HLabel {
id: roomLabel id: roomLabel
text: displayName ? displayName : "<i>Empty room</i>" text: displayName ? displayName : "<i>Empty room</i>"
textFormat: Text.StyledText textFormat: Text.StyledText
@ -39,7 +39,7 @@ MouseArea {
rightPadding: leftPadding rightPadding: leftPadding
} }
Base.HLabel { HLabel {
function getText() { function getText() {
return SidePaneJS.getLastRoomEventText( return SidePaneJS.getLastRoomEventText(
roomId, roomList.userId roomId, roomList.userId
@ -56,7 +56,7 @@ MouseArea {
text: getText() text: getText()
textFormat: Text.StyledText textFormat: Text.StyledText
font.pixelSize: Base.HStyle.fontSize.small font.pixelSize: HStyle.fontSize.small
elide: Text.ElideRight elide: Text.ElideRight
maximumLineCount: 1 maximumLineCount: 1
Layout.maximumWidth: roomLabel.Layout.maximumWidth Layout.maximumWidth: roomLabel.Layout.maximumWidth

View File

@ -1,7 +1,7 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "../Base" as Base import "../Base"
ListView { ListView {
property var userId: null property var userId: null

View File

@ -2,15 +2,15 @@ import QtQuick 2.7
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import "../Base" as Base import "../Base"
Base.HGlassRectangle { HGlassRectangle {
id: sidePane id: sidePane
clip: true // Avoid artifacts when resizing pane width to minimum clip: true // Avoid artifacts when resizing pane width to minimum
isPageStackDescendant: false isPageStackDescendant: false
Base.HColumnLayout { HColumnLayout {
anchors.fill: parent anchors.fill: parent
AccountList { AccountList {

View File

@ -1,14 +1,13 @@
import QtQuick 2.7 import QtQuick 2.7
import QtQuick.Controls 2.2 import QtQuick.Controls 2.2
import QtQuick.Layouts 1.4 import QtQuick.Layouts 1.4
import "Base" as Base import "Base"
import "SidePane" as SidePane import "SidePane"
import "Chat" as Chat
Item { Item {
id: mainUI id: mainUI
Base.HImage { HImage {
id: mainUIBackground id: mainUIBackground
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
source: "../images/login_background.jpg" source: "../images/login_background.jpg"
@ -17,10 +16,10 @@ Item {
property bool accountsLoggedIn: Backend.clientManager.clientCount > 0 property bool accountsLoggedIn: Backend.clientManager.clientCount > 0
Base.HSplitView { HSplitView {
anchors.fill: parent anchors.fill: parent
SidePane.SidePane { SidePane {
property int parentWidth: parent.width property int parentWidth: parent.width
onParentWidthChanged: width = Math.min(parent.width * 0.3, 300) onParentWidthChanged: width = Math.min(parent.width * 0.3, 300)