Fix roomlist "jumping around".
Remove custom DPI code from main.cpp. Hide redacted event in roomlist.
This commit is contained in:
@@ -331,12 +331,12 @@ Item {
|
|||||||
acceptInvitationDialog.createObject(ApplicationWindow.overlay, {"room": currentRoom}).open()
|
acceptInvitationDialog.createObject(ApplicationWindow.overlay, {"room": currentRoom}).open()
|
||||||
} else {
|
} else {
|
||||||
if (enteredRoom) {
|
if (enteredRoom) {
|
||||||
enteredRoom.displayed = false
|
|
||||||
leaveRoom(enteredRoom)
|
leaveRoom(enteredRoom)
|
||||||
|
enteredRoom.displayed = false
|
||||||
}
|
}
|
||||||
currentRoom.displayed = true
|
|
||||||
enterRoom(currentRoom)
|
enterRoom(currentRoom)
|
||||||
enteredRoom = currentRoom
|
enteredRoom = currentRoom
|
||||||
|
currentRoom.displayed = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
onSecondaryClicked: roomListContextMenu.createObject(ApplicationWindow.overlay, {"room": currentRoom}).popup()
|
onSecondaryClicked: roomListContextMenu.createObject(ApplicationWindow.overlay, {"room": currentRoom}).popup()
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ Item {
|
|||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
||||||
text: "Choose local file"
|
text: "Choose local file"
|
||||||
|
color: MPalette.foreground
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
12
src/main.cpp
12
src/main.cpp
@@ -26,18 +26,6 @@
|
|||||||
using namespace QMatrixClient;
|
using namespace QMatrixClient;
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
#if defined(Q_OS_LINUX) || defined(Q_OS_WIN) || defined(Q_OS_FREEBSD)
|
|
||||||
if (qgetenv("QT_SCALE_FACTOR").size() == 0) {
|
|
||||||
QSettings settings("ENCOM", "Spectral");
|
|
||||||
float factor = settings.value("Interface/dpi", 100).toFloat() / 100;
|
|
||||||
|
|
||||||
qDebug() << "DPI:" << factor;
|
|
||||||
|
|
||||||
if (factor != -1)
|
|
||||||
qputenv("QT_SCALE_FACTOR", QString::number(factor).toUtf8());
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
|
QCoreApplication::setAttribute(Qt::AA_UseOpenGLES);
|
||||||
|
|
||||||
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
QNetworkProxyFactory::setUseSystemConfiguration(true);
|
||||||
|
|||||||
@@ -107,12 +107,26 @@ void SpectralRoom::sendTypingNotification(bool isTyping) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
QString SpectralRoom::lastEvent() {
|
QString SpectralRoom::lastEvent() {
|
||||||
if (timelineSize() == 0)
|
for (auto i = messageEvents().rbegin(); i < messageEvents().rend(); i++) {
|
||||||
return "";
|
const RoomEvent* evt = i->get();
|
||||||
const RoomEvent* lastEvent = messageEvents().rbegin()->get();
|
|
||||||
return user(lastEvent->senderId())->displayname() +
|
if (is<RedactionEvent>(*evt))
|
||||||
(lastEvent->isStateEvent() ? " " : ": ") +
|
continue;
|
||||||
utils::removeReply(eventToString(*lastEvent));
|
if (evt->isRedacted())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (evt->isStateEvent() &&
|
||||||
|
static_cast<const StateEventBase*>(evt)->repeatsState())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
if (connection()->isIgnored(user(evt->senderId())))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
return user(evt->senderId())->displayname() +
|
||||||
|
(evt->isStateEvent() ? " " : ": ") +
|
||||||
|
utils::removeReply(eventToString(*evt));
|
||||||
|
}
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool SpectralRoom::isEventHighlighted(const RoomEvent* e) const {
|
bool SpectralRoom::isEventHighlighted(const RoomEvent* e) const {
|
||||||
|
|||||||
Reference in New Issue
Block a user