aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-10-22 22:58:38 +0200
committerdec05eba <dec05eba@protonmail.com>2020-10-22 22:58:38 +0200
commit290ca90416e96febdc4ae8bafccbbdd4cea01351 (patch)
tree42ebcfbcf04c1cbc0c07d2c0a564e349214d1ee4 /src
parent97564d40636aafb251644f61a0b990e392afd7a4 (diff)
Matrix: improve pinned messages view
Diffstat (limited to 'src')
-rw-r--r--src/QuickMedia.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 5c1bdfa..7a95ee6 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -3236,6 +3236,7 @@ namespace QuickMedia {
std::vector<std::string> pinned_events;
matrix->get_all_pinned_events(current_room, pinned_events);
process_new_pinned_events(pinned_events);
+ tabs[PINNED_TAB_INDEX].body->select_last_item();
room_name_text.setString(static_cast<BodyItem*>(current_room->userdata)->get_title());
room_avatar_thumbnail_data = std::make_shared<ThumbnailData>();
@@ -3488,7 +3489,7 @@ namespace QuickMedia {
}
};
- auto add_new_rooms = [&tabs, &current_room, &room_name_text, &room_search_bar](Rooms &rooms) {
+ auto add_new_rooms = [&tabs, &current_room, &room_search_bar, &room_name_text](Rooms &rooms) {
if(rooms.empty())
return;
@@ -3865,13 +3866,13 @@ namespace QuickMedia {
}
float room_name_padding_y = 0.0f;
- if(selected_tab == MESSAGES_TAB_INDEX)
+ if(selected_tab == MESSAGES_TAB_INDEX || selected_tab == PINNED_TAB_INDEX)
room_name_padding_y = room_name_total_height;
else if(selected_tab == ROOMS_TAB_INDEX)
room_name_padding_y = room_search_bar.getBottomWithoutShadow();
chat_input_height_full = chat_input.get_height() + chat_input_padding_y * 2.0f;
- if(selected_tab != MESSAGES_TAB_INDEX)
+ if(selected_tab != MESSAGES_TAB_INDEX || selected_tab == PINNED_TAB_INDEX)
chat_input_height_full = 0.0f;
const float chat_height = chat_input.get_height();
@@ -3886,15 +3887,13 @@ namespace QuickMedia {
float room_name_padding_y = 0.0f;
float padding_bottom = 0.0f;
- if(selected_tab == MESSAGES_TAB_INDEX) {
+ if(selected_tab == MESSAGES_TAB_INDEX || selected_tab == PINNED_TAB_INDEX) {
room_name_padding_y = 10.0f + room_name_total_height;
tab_vertical_offset = 10.0f;
} else if(selected_tab == ROOMS_TAB_INDEX) {
room_name_padding_y = room_search_bar.getBottomWithoutShadow();
tab_vertical_offset = 0.0f;
padding_bottom = 10.0f;
- } else if(selected_tab == PINNED_TAB_INDEX) {
- padding_bottom = 10.0f;
}
tab_shade_height = tab_spacer_height + std::floor(tab_vertical_offset) + tab_height + room_name_padding_y + padding_bottom;
@@ -3998,6 +3997,7 @@ namespace QuickMedia {
event_data->status = PinnedEventStatus::FINISHED_LOADING;
fetch_body_item->userdata = event_data;
} else {
+ fetch_body_item->set_description("Failed to load message!");
event_data->status = PinnedEventStatus::FAILED_TO_LOAD;
}
} else if(fetch_message_tab == MESSAGES_TAB_INDEX) {
@@ -4029,7 +4029,7 @@ namespace QuickMedia {
tab_shade.setSize(sf::Vector2f(window_size.x, tab_shade_height));
window.draw(tab_shade);
- if(selected_tab == MESSAGES_TAB_INDEX) {
+ if(selected_tab == MESSAGES_TAB_INDEX || selected_tab == PINNED_TAB_INDEX) {
float room_name_text_offset_x = 0.0f;
if(room_avatar_sprite.getTexture() && room_avatar_sprite.getTexture()->getNativeHandle() != 0) {
auto room_avatar_texture_size = room_avatar_sprite.getTexture()->getSize();