enter key now works, fix room highlighting and add overlay

pull/493/head
Jedi18 4 years ago
parent 3f4ad1dd8b
commit b1dec6f6ac
  1. 7
      resources/qml/Completer.qml
  2. 9
      resources/qml/QuickSwitcher.qml
  3. 1
      resources/qml/TimelineView.qml
  4. 6
      src/ChatPage.cpp
  5. 1
      src/ChatPage.h
  6. 6
      src/timeline/TimelineViewManager.cpp
  7. 1
      src/timeline/TimelineViewManager.h

@ -52,6 +52,12 @@ Popup {
return null;
}
function finishCompletion() {
if(popup.completerName == "room") {
popup.completionSelected(listView.itemAtIndex(currentIndex).modelData.roomid)
}
}
onCompleterNameChanged: {
if (completerName) {
if (completerName == "user") {
@ -85,6 +91,7 @@ Popup {
color: model.index == popup.currentIndex ? colors.highlight : colors.base
height: chooser.childrenRect.height + 4
implicitWidth: fullWidth ? popup.width : chooser.childrenRect.width + 4
property variant modelData: model
MouseArea {
id: mouseArea

@ -11,6 +11,10 @@ Popup {
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
parent: Overlay.overlay
Overlay.modal: Rectangle {
color: "#aa1E1E1E"
}
TextInput {
id: roomTextInput
@ -29,6 +33,9 @@ Popup {
} else if (event.key == Qt.Key_Down && completerPopup.opened) {
event.accepted = true;
completerPopup.down();
} else if (event.matches(StandardKey.InsertParagraphSeparator)) {
completerPopup.finishCompletion()
event.accepted = true;
}
}
}
@ -57,7 +64,9 @@ Popup {
Connections {
onCompletionSelected: {
console.log(id)
TimelineManager.setHistoryView(id)
TimelineManager.highlightRoom(id)
quickSwitcher.close()
}
target: completerPopup

@ -72,7 +72,6 @@ Page {
id: quickSwitcherComponent
QuickSwitcher {
id: quickSwitcher
}
}

@ -1429,3 +1429,9 @@ ChatPage::handleMatrixUri(const QUrl &uri)
{
handleMatrixUri(uri.toString(QUrl::ComponentFormattingOption::FullyEncoded).toUtf8());
}
void
ChatPage::highlightRoom(const QString &room_id)
{
room_list_->highlightSelectedRoom(room_id);
}

@ -116,6 +116,7 @@ public slots:
void startChat(QString userid);
void leaveRoom(const QString &room_id);
void createRoom(const mtx::requests::CreateRoom &req);
void highlightRoom(const QString &room_id);
void joinRoom(const QString &room);
void joinRoomVia(const std::string &room_id, const std::vector<std::string> &via);

@ -333,6 +333,12 @@ TimelineViewManager::setHistoryView(const QString &room_id)
}
}
void
TimelineViewManager::highlightRoom(const QString &room_id)
{
ChatPage::instance()->highlightRoom(room_id);
}
QString
TimelineViewManager::escapeEmoji(QString str) const
{

@ -100,6 +100,7 @@ public slots:
}
void setHistoryView(const QString &room_id);
void highlightRoom(const QString &room_id);
TimelineModel *getHistoryView(const QString &room_id)
{
auto room = models.find(room_id);

Loading…
Cancel
Save