From 3c75c8f687a9a506c03cc280176f76851cb10839 Mon Sep 17 00:00:00 2001 From: evgeny Date: Wed, 29 Jul 2026 01:27:23 +0300 Subject: [PATCH] icons: replace emoji text with PNG resources + add media_dir debug logs --- src/chat/chat_msg.c | 6 ++++++ tools/chatgui/resources/chatgui.qrc | 5 +++++ tools/chatgui/resources/icons/attach.png | Bin 0 -> 199 bytes tools/chatgui/resources/icons/emoji.png | Bin 0 -> 269 bytes tools/chatgui/resources/icons/mic.png | Bin 0 -> 185 bytes tools/chatgui/resources/icons/send.png | Bin 0 -> 181 bytes tools/chatgui/src/inputbar.cpp | 23 +++++++++++++---------- 7 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 tools/chatgui/resources/icons/attach.png create mode 100644 tools/chatgui/resources/icons/emoji.png create mode 100644 tools/chatgui/resources/icons/mic.png create mode 100644 tools/chatgui/resources/icons/send.png diff --git a/src/chat/chat_msg.c b/src/chat/chat_msg.c index f44fe5a1..20f71fba 100644 --- a/src/chat/chat_msg.c +++ b/src/chat/chat_msg.c @@ -97,6 +97,9 @@ static void chat_core_submit_media_message(struct chat_msg_submit* req) { CC_ID, req->channel_id, req->content_type, req->media_dt, req->media_basename, req->media_ext, req->media_num_blocks); + DEBUG_DEBUG(DEBUG_CATEGORY_DB_SYNC, "%s: db_path='%s' initialized=%d", + CC_ID, g_cc.db_path, g_cc.initialized); + struct DB_SYNC_INSTANCE* si = si_find(req->channel_id); if (!si) { DEBUG_ERROR(DEBUG_CATEGORY_DB_SYNC, "%s: no db_sync instance for ch=%s", CC_ID, req->channel_id); return; } @@ -112,6 +115,9 @@ static void chat_core_submit_media_message(struct chat_msg_submit* req) { snprintf(media_dir, sizeof(media_dir), "%s/media/%s", g_cc.db_path, req->channel_id); } + DEBUG_DEBUG(DEBUG_CATEGORY_DB_SYNC, "%s: media_dir='%s' dt='%s' stem='%s' ext='%s'", + CC_ID, media_dir, req->media_dt, req->media_basename, req->media_ext); + uint32_t num_blocks = req->media_num_blocks; uint64_t block_size = 0; uint64_t file_size = 0; diff --git a/tools/chatgui/resources/chatgui.qrc b/tools/chatgui/resources/chatgui.qrc index 24f828e8..dcda5edc 100644 --- a/tools/chatgui/resources/chatgui.qrc +++ b/tools/chatgui/resources/chatgui.qrc @@ -5,5 +5,10 @@ animations/greeting.tgs animations/stop.tgs animations/robot.tgs + icons/attach.png + icons/emoji.png + icons/mic.png + icons/send.png + bg.jpg diff --git a/tools/chatgui/resources/icons/attach.png b/tools/chatgui/resources/icons/attach.png new file mode 100644 index 0000000000000000000000000000000000000000..7c8d545e0fd27038864e6cf8dfdab3a69a753558 GIT binary patch literal 199 zcmeAS@N?(olHy`uVBq!ia0vp^N+8U^1|+TAxeo!UK2I0Nkcv5Prv>sgDDXI6++6Tq z_^sYAZ?QWsSd5eI%RA@JJ-bB2iR0MEXK8{vOV(bKs(NO5xg|6{>4ZOl`vVZ>X%7~NsH|jT?Q|lF6)Yx>j?K0QX7p1zHMw^xkzMg)6wZ1i5 x#G<{XP8nQ%9E*g_t_b?87(Kfz)5CGIO?rBoi$Z6;t2)qS44$rjF6*2UngA$MP7DA5 literal 0 HcmV?d00001 diff --git a/tools/chatgui/resources/icons/emoji.png b/tools/chatgui/resources/icons/emoji.png new file mode 100644 index 0000000000000000000000000000000000000000..686ba3fde3c1a6289146240285bee9624ec192eb GIT binary patch literal 269 zcmV+o0rLKdP)zD T;#C}z00000NkvXXu0mjf*|=|B literal 0 HcmV?d00001 diff --git a/tools/chatgui/resources/icons/mic.png b/tools/chatgui/resources/icons/mic.png new file mode 100644 index 0000000000000000000000000000000000000000..d5b7206380907b31e54cd03798b10e1cc3b923d0 GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0vp^N+8U^1|+TAxeo!U22U5qkcv5Prv!2xP~dUCdn0hq z|IRA$@7k#uQrbPb?}KxsFHH(+5isnVnq-{)Z|ya&uS>e-u~aN-(sMhJA)#c%YMi|} z@r3;ONy; #include #include +#include #include -static QPushButton *makeIconBtn(const QString &text, const QString &tooltip, QWidget *parent) { - auto *btn = new QPushButton(text, parent); +static QPushButton *makeIconBtn(const QIcon& icon, const QString &tooltip, QWidget *parent) { + auto *btn = new QPushButton(parent); + btn->setIcon(icon); + btn->setIconSize(QSize(20, 20)); btn->setFixedSize(34, 34); btn->setCursor(Qt::PointingHandCursor); btn->setToolTip(tooltip); btn->setStyleSheet( - "QPushButton { border: none; border-radius: 4px; font-size: 18px; background: transparent; }" + "QPushButton { border: none; border-radius: 4px; background: transparent; }" "QPushButton:hover { background: palette(light); }" ); return btn; @@ -54,7 +57,7 @@ InputBar::InputBar(EmojiPanel *emojiPanel, AudioRecorder *recorder, QWidget *par layout->setContentsMargins(8, 4, 8, 4); layout->setSpacing(4); - m_attachBtn = makeIconBtn(QString::fromUtf8("\xF0\x9F\x93\x8E"), + m_attachBtn = makeIconBtn(QIcon(":/icons/attach.png"), QString::fromUtf8("Прикрепить"), this); connect(m_attachBtn, &QPushButton::clicked, this, &InputBar::onAttachClicked); layout->addWidget(wrapBottomBtn(m_attachBtn, 3), 0, Qt::AlignBottom); @@ -72,18 +75,18 @@ InputBar::InputBar(EmojiPanel *emojiPanel, AudioRecorder *recorder, QWidget *par m_input->setFixedHeight(fm.lineSpacing() + 12); layout->addWidget(m_input, 1); - m_emojiBtn = makeIconBtn(QString::fromUtf8("\xF0\x9F\x99\x82"), + m_emojiBtn = makeIconBtn(QIcon(":/icons/emoji.png"), QString::fromUtf8("Смайлики"), this); layout->addWidget(wrapBottomBtn(m_emojiBtn, 3), 0, Qt::AlignBottom); - m_pttBtn = makeIconBtn(QString::fromUtf8("\xF0\x9F\x8E\xA4"), + m_pttBtn = makeIconBtn(QIcon(":/icons/mic.png"), QString::fromUtf8("Голосовое сообщение (удерживайте)"), this); layout->addWidget(wrapBottomBtn(m_pttBtn, 3), 0, Qt::AlignBottom); - auto *sendBtn = makeIconBtn(QString::fromUtf8("\xE2\x9E\xA4"), + auto *sendBtn = makeIconBtn(QIcon(":/icons/send.png"), QString::fromUtf8("Отправить"), this); sendBtn->setStyleSheet(sendBtn->styleSheet() + - "QPushButton { color: palette(highlight); font-weight: bold; }"); + "QPushButton { border: 1px solid palette(highlight); }"); layout->addWidget(sendBtn, 0, Qt::AlignBottom); connect(m_input, &QTextEdit::textChanged, this, &InputBar::adjustInputHeight); @@ -203,7 +206,7 @@ void InputBar::onPttPressed() { m_recorder->startRecording(); m_pttActive = true; m_pttBtn->setStyleSheet(m_pttBtn->styleSheet() + - "QPushButton { background: #e74c3c; color: white; border-radius: 4px; }"); + "QPushButton { background: #e74c3c; border-radius: 4px; }"); } void InputBar::onPttReleased() { @@ -211,7 +214,7 @@ void InputBar::onPttReleased() { m_pttActive = false; m_recorder->stopRecording(); m_pttBtn->setStyleSheet( - "QPushButton { border: none; border-radius: 4px; font-size: 18px; background: transparent; }" + "QPushButton { border: none; border-radius: 4px; background: transparent; }" "QPushButton:hover { background: palette(light); }"); int durationMs = m_recorder->durationMs();