Init theming support.
This commit is contained in:
@@ -222,3 +222,11 @@ QImage Controller::safeImage(QImage image) {
|
||||
if (image.isNull()) return QImage();
|
||||
return image;
|
||||
}
|
||||
|
||||
QColor Controller::color(QString userId) {
|
||||
return QColor(SettingsGroup("UI/Color").value(userId, "#498882").toString());
|
||||
}
|
||||
|
||||
void Controller::setColor(QString userId, QColor newColor) {
|
||||
SettingsGroup("UI/Color").setValue(userId, newColor.name());
|
||||
}
|
||||
|
||||
@@ -40,12 +40,14 @@ class Controller : public QObject {
|
||||
}
|
||||
}
|
||||
|
||||
QVector<Connection*> m_connections;
|
||||
Q_INVOKABLE QColor color(QString userId);
|
||||
Q_INVOKABLE void setColor(QString userId, QColor newColor);
|
||||
|
||||
private:
|
||||
QClipboard* m_clipboard = QApplication::clipboard();
|
||||
QSystemTrayIcon* tray = new QSystemTrayIcon();
|
||||
QMenu* trayMenu = new QMenu();
|
||||
QVector<Connection*> m_connections;
|
||||
|
||||
bool m_busy = false;
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ class MatriqueRoom : public Room {
|
||||
explicit MatriqueRoom(Connection* connection, QString roomId,
|
||||
JoinState joinState = {});
|
||||
|
||||
QImage getAvatar() { return avatar(64); }
|
||||
QImage getAvatar() { return avatar(128); }
|
||||
|
||||
const QString& cachedInput() const { return m_cachedInput; }
|
||||
void setCachedInput(const QString& input) {
|
||||
|
||||
@@ -14,7 +14,7 @@ class MatriqueUser : public User {
|
||||
public:
|
||||
MatriqueUser(QString userId, Connection* connection);
|
||||
|
||||
QImage getAvatar() { return avatar(64); }
|
||||
QImage getAvatar() { return avatar(128); }
|
||||
|
||||
signals:
|
||||
void inheritedAvatarChanged(User* user, const Room* roomContext); // https://bugreports.qt.io/browse/QTBUG-7684
|
||||
|
||||
@@ -15,7 +15,7 @@ RoomListModel::~RoomListModel() {}
|
||||
|
||||
void RoomListModel::setConnection(Connection* connection) {
|
||||
if (connection == m_connection) return;
|
||||
m_connection->disconnect(this);
|
||||
if (m_connection) m_connection->disconnect(this);
|
||||
if (!connection) {
|
||||
qDebug() << "Removing current connection...";
|
||||
m_connection = nullptr;
|
||||
|
||||
@@ -69,7 +69,7 @@ QVariant UserListModel::data(const QModelIndex& index, int role) const {
|
||||
}
|
||||
if (role == AvatarRole) {
|
||||
if (!user->avatarUrl(m_currentRoom).isEmpty())
|
||||
return user->avatar(32, m_currentRoom);
|
||||
return user->avatar(64, m_currentRoom);
|
||||
return QImage();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user