icons: replace emoji text with PNG resources + add media_dir debug logs

This commit is contained in:
evgeny committed 2026-07-29 01:27:23 +03:00
1 parent 491fa84db8
commit 3c75c8f687
7 files changed
+24 -10

No files matched your search

+13 -10
View File
@@ -18,15 +18,18 @@
#include <QResizeEvent>
#include <QDir>
#include <QProgressBar>
#include <QIcon>
#include <cmath>
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();