forked from Green-Sky/tomato
small contact list and status text
This commit is contained in:
parent
4b0d9595ac
commit
c887fdac8a
2
external/solanaceae_contact
vendored
2
external/solanaceae_contact
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 7710da6c89f975d7bf34efae340232fdb9a705a5
|
Subproject commit e8b069c803e81152c538c87c28a891717099b269
|
2
external/solanaceae_tox
vendored
2
external/solanaceae_tox
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 560eab1f6cceff122987646ffa927cd660bc0a73
|
Subproject commit 2807239dea0a84d0c598edf0c22560892b3039de
|
@ -215,19 +215,24 @@ bool renderContactBig(
|
|||||||
p0.y += ImGui::GetStyle().FramePadding.y;
|
p0.y += ImGui::GetStyle().FramePadding.y;
|
||||||
ImVec2 p1_o = {img_y, img_y}; // img_y is 1 line_height in this case
|
ImVec2 p1_o = {img_y, img_y}; // img_y is 1 line_height in this case
|
||||||
|
|
||||||
|
const ImU32 col_back = ImGui::GetColorU32(th.getColor<ThemeCol_Contact::icon_backdrop>());
|
||||||
if (cstate->state == Contact::Components::ConnectionState::direct) { // direct icon
|
if (cstate->state == Contact::Components::ConnectionState::direct) { // direct icon
|
||||||
const ImU32 col_back = ImGui::GetColorU32({0.0f, 0.0f, 0.0f, 0.4f});
|
drawIconDirect(
|
||||||
const ImU32 col_main = ImGui::GetColorU32({0.0f, 1.f, 0.0f, 1.0f});
|
p0,
|
||||||
|
p1_o,
|
||||||
drawIconDirect(p0, p1_o, col_main, col_back);
|
ImGui::GetColorU32(th.getColor<ThemeCol_Contact::avatar_online_direct>()),
|
||||||
|
col_back
|
||||||
|
);
|
||||||
} else if (cstate->state == Contact::Components::ConnectionState::cloud) { // cloud icon
|
} else if (cstate->state == Contact::Components::ConnectionState::cloud) { // cloud icon
|
||||||
const ImU32 col_back = ImGui::GetColorU32({0.0f, 0.0f, 0.0f, 0.4f});
|
drawIconCloud(
|
||||||
const ImU32 col_main = ImGui::GetColorU32({0.0f, 1.f, 0.0f, 1.0f});
|
p0,
|
||||||
|
p1_o,
|
||||||
drawIconCloud(p0, p1_o, col_main, col_back);
|
ImGui::GetColorU32(th.getColor<ThemeCol_Contact::avatar_online_cloud>()),
|
||||||
|
col_back
|
||||||
|
);
|
||||||
}
|
}
|
||||||
ImGui::Dummy(p1_o);
|
ImGui::Dummy(p1_o);
|
||||||
ImGui::SameLine();
|
ImGui::SameLine(0.f, ImGui::GetStyle().ItemSpacing.x*0.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::Text("%s%s", unread?"* ":"", (c.all_of<Contact::Components::Name>() ? c.get<Contact::Components::Name>().name.c_str() : "<unk>"));
|
ImGui::Text("%s%s", unread?"* ":"", (c.all_of<Contact::Components::Name>() ? c.get<Contact::Components::Name>().name.c_str() : "<unk>"));
|
||||||
@ -247,22 +252,39 @@ bool renderContactBig(
|
|||||||
const float box_hight = TEXT_BASE_HEIGHT - ImGui::GetStyle().FramePadding.y*2;
|
const float box_hight = TEXT_BASE_HEIGHT - ImGui::GetStyle().FramePadding.y*2;
|
||||||
ImVec2 p1_o = {box_hight, box_hight};
|
ImVec2 p1_o = {box_hight, box_hight};
|
||||||
|
|
||||||
|
const ImU32 col_back = ImGui::GetColorU32(th.getColor<ThemeCol_Contact::icon_backdrop>());
|
||||||
if (cstate->state == Contact::Components::ConnectionState::direct) { // direct icon
|
if (cstate->state == Contact::Components::ConnectionState::direct) { // direct icon
|
||||||
const ImU32 col_back = ImGui::GetColorU32({0.0f, 0.0f, 0.0f, 0.4f});
|
drawIconDirect(
|
||||||
const ImU32 col_main = ImGui::GetColorU32({0.0f, 1.f, 0.0f, 1.0f});
|
p0,
|
||||||
|
p1_o,
|
||||||
drawIconDirect(p0, p1_o, col_main, col_back);
|
ImGui::GetColorU32(th.getColor<ThemeCol_Contact::avatar_online_direct>()),
|
||||||
|
col_back
|
||||||
|
);
|
||||||
} else if (cstate->state == Contact::Components::ConnectionState::cloud) { // cloud icon
|
} else if (cstate->state == Contact::Components::ConnectionState::cloud) { // cloud icon
|
||||||
const ImU32 col_back = ImGui::GetColorU32({0.0f, 0.0f, 0.0f, 0.4f});
|
drawIconCloud(
|
||||||
const ImU32 col_main = ImGui::GetColorU32({0.0f, 1.f, 0.0f, 1.0f});
|
p0,
|
||||||
|
p1_o,
|
||||||
drawIconCloud(p0, p1_o, col_main, col_back);
|
ImGui::GetColorU32(th.getColor<ThemeCol_Contact::avatar_online_cloud>()),
|
||||||
|
col_back
|
||||||
|
);
|
||||||
}
|
}
|
||||||
ImGui::Dummy(p1_o);
|
ImGui::Dummy(p1_o);
|
||||||
ImGui::SameLine();
|
ImGui::SameLine(0.f, ImGui::GetStyle().ItemSpacing.x*0.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
ImGui::TextDisabled("status message...");
|
if (
|
||||||
|
const auto* slt = c.try_get<Contact::Components::StatusText>();
|
||||||
|
slt != nullptr &&
|
||||||
|
!slt->text.empty() &&
|
||||||
|
slt->first_line_length > 0 &&
|
||||||
|
slt->first_line_length <= slt->text.size()
|
||||||
|
) {
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Text, ImGui::GetStyle().Colors[ImGuiCol_TextDisabled]);
|
||||||
|
ImGui::TextUnformatted(slt->text.c_str(), slt->text.c_str() + slt->first_line_length);
|
||||||
|
ImGui::PopStyleColor();
|
||||||
|
} else {
|
||||||
|
ImGui::TextDisabled(""); // or dummy?
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// line 3
|
// line 3
|
||||||
|
@ -13,6 +13,8 @@ enum class ThemeCol_Contact {
|
|||||||
avatar_online_direct,
|
avatar_online_direct,
|
||||||
avatar_online_cloud,
|
avatar_online_cloud,
|
||||||
avatar_offline,
|
avatar_offline,
|
||||||
|
|
||||||
|
icon_backdrop,
|
||||||
};
|
};
|
||||||
|
|
||||||
// returns true if clicked, if selectable, will highlight on hover and respect selected
|
// returns true if clicked, if selectable, will highlight on hover and respect selected
|
||||||
|
@ -44,9 +44,11 @@ Theme getDefaultThemeDark(void) {
|
|||||||
t.setColor<ThemeCol_Contact::request_incoming >({0.98f, 0.41f, 0.26f, 0.52f});
|
t.setColor<ThemeCol_Contact::request_incoming >({0.98f, 0.41f, 0.26f, 0.52f});
|
||||||
t.setColor<ThemeCol_Contact::request_outgoing >({0.98f, 0.26f, 0.41f, 0.52f});
|
t.setColor<ThemeCol_Contact::request_outgoing >({0.98f, 0.26f, 0.41f, 0.52f});
|
||||||
|
|
||||||
t.setColor<ThemeCol_Contact::avatar_online_direct>({0.3, 1, 0, 1});
|
t.setColor<ThemeCol_Contact::avatar_online_direct >({0.3f, 1.0f, 0.0f, 1.0f});
|
||||||
t.setColor<ThemeCol_Contact::avatar_online_cloud>({0, 1, 0.8, 1});
|
t.setColor<ThemeCol_Contact::avatar_online_cloud >({0.0f, 1.0f, 0.8f, 1.0f});
|
||||||
t.setColor<ThemeCol_Contact::avatar_offline>({0.4, 0.4, 0.4, 1});
|
t.setColor<ThemeCol_Contact::avatar_offline >({0.4f, 0.4f, 0.4f, 1.0f});
|
||||||
|
|
||||||
|
t.setColor<ThemeCol_Contact::icon_backdrop >({0.0f, 0.0f, 0.0f, 0.4f});
|
||||||
|
|
||||||
return t;
|
return t;
|
||||||
}
|
}
|
||||||
|
@ -1116,6 +1116,7 @@ bool ChatGui4::renderContactListContactSmall(const Contact3 c, const bool select
|
|||||||
return ImGui::Selectable(label.c_str(), selected);
|
return ImGui::Selectable(label.c_str(), selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if 0
|
||||||
bool ChatGui4::renderSubContactListContact(const Contact3 c, const bool selected) const {
|
bool ChatGui4::renderSubContactListContact(const Contact3 c, const bool selected) const {
|
||||||
std::string label;
|
std::string label;
|
||||||
|
|
||||||
@ -1138,6 +1139,7 @@ bool ChatGui4::renderSubContactListContact(const Contact3 c, const bool selected
|
|||||||
|
|
||||||
return ImGui::Selectable(label.c_str(), selected);
|
return ImGui::Selectable(label.c_str(), selected);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void ChatGui4::pasteFile(const char* mime_type) {
|
void ChatGui4::pasteFile(const char* mime_type) {
|
||||||
size_t data_size = 0;
|
size_t data_size = 0;
|
||||||
|
@ -79,7 +79,7 @@ class ChatGui4 {
|
|||||||
|
|
||||||
void renderContactList(void);
|
void renderContactList(void);
|
||||||
bool renderContactListContactSmall(const Contact3 c, const bool selected) const;
|
bool renderContactListContactSmall(const Contact3 c, const bool selected) const;
|
||||||
bool renderSubContactListContact(const Contact3 c, const bool selected) const;
|
//bool renderSubContactListContact(const Contact3 c, const bool selected) const;
|
||||||
|
|
||||||
void pasteFile(const char* mime_type);
|
void pasteFile(const char* mime_type);
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user