Browse Source

Remove the file manager button from the channel footer

master
evgeny 5 days ago
parent
commit
42efbbc7da
  1. 17
      tools/chatgui/src/channellist.cpp
  2. 3
      tools/chatgui/src/channellist.h

17
tools/chatgui/src/channellist.cpp

@ -193,21 +193,6 @@ ChannelList::ChannelList(DbManager* db, QWidget *parent)
connect(gearBtn, &QPushButton::clicked, this, [this] { emit settingsRequested(); });
m_ownFilesButton = new QPushButton(footer);
m_ownFilesButton->setObjectName("ownFilesButton");
m_ownFilesButton->setIcon(style()->standardIcon(QStyle::SP_DirOpenIcon));
m_ownFilesButton->setFixedSize(28, 28);
m_ownFilesButton->setToolTip(QCoreApplication::translate("ChatGui", "My files in the selected group"));
m_ownFilesButton->setAccessibleName(m_ownFilesButton->toolTip());
m_ownFilesButton->setStyleSheet(
"QPushButton { border: none; background: transparent; }"
"QPushButton:hover { background: rgba(51,144,236,20); border-radius: 14px; }");
m_ownFilesButton->setEnabled(false);
fl->addWidget(m_ownFilesButton);
connect(m_ownFilesButton, &QPushButton::clicked, this, [this] {
emit ownFilesRequested(m_listView->currentIndex().data(ChannelChannelIdRole).toString());
});
auto *monitorBtn = new QPushButton(QString::fromUtf8("\xF0\x9F\x94\x8D"), footer); /* 🔍 */
monitorBtn->setFixedSize(28, 28);
monitorBtn->setToolTip(QCoreApplication::translate("ChatGui", "Connection Monitor"));
@ -253,7 +238,6 @@ ChannelList::ChannelList(DbManager* db, QWidget *parent)
connect(m_listView->selectionModel(), &QItemSelectionModel::currentChanged,
this, [this](const QModelIndex &current, const QModelIndex &) {
m_ownFilesButton->setEnabled(current.data(ChannelChannelIdRole).toString().toULongLong() != 0);
if (current.isValid()) {
QString cid = current.data(ChannelChannelIdRole).toString();
emit channelSelected(cid);
@ -430,7 +414,6 @@ void ChannelList::loadChannels() {
sel->select(idx, QItemSelectionModel::ClearAndSelect);
sel->setCurrentIndex(idx, QItemSelectionModel::NoUpdate);
}
m_ownFilesButton->setEnabled(m_listView->currentIndex().data(ChannelChannelIdRole).toString().toULongLong() != 0);
}
void ChannelList::selectChannel(const QString& channelId) {

3
tools/chatgui/src/channellist.h

@ -11,7 +11,6 @@
#include <QTimer>
class DbManager;
class QPushButton;
class QLabel;
class ChannelList : public QWidget {
@ -35,7 +34,6 @@ signals:
void inviteByLinkRequested(const QString& channelId);
void channelSettingsRequested(const QString& channelId);
void filesRequested(const QString& channelId);
void ownFilesRequested(const QString& channelId);
void ownFilesDropped(const QString& channelId, const QStringList& paths);
void joinRequested();
void createGroupRequested();
@ -49,7 +47,6 @@ private:
QListView *m_listView;
QStandardItemModel *m_model;
DbManager *m_db;
QPushButton *m_ownFilesButton;
QWidget *m_footer;
QLabel *m_dropHint;
bool m_autoConnectActive = false;

Loading…
Cancel
Save