forked from blue/squawk
missing fallback icons
This commit is contained in:
parent
9834fc33e8
commit
30c59fbb91
53 changed files with 992 additions and 17 deletions
|
@ -255,7 +255,7 @@ void Conversation::onSliderValueChanged(int value)
|
|||
scroll = down;
|
||||
} else {
|
||||
if (!requestingHistory && value == 0) {
|
||||
m_ui->historyStatus->setPixmap(QIcon::fromTheme("view-refresh").pixmap(25));
|
||||
m_ui->historyStatus->setPixmap(Shared::icon("view-refresh", true).pixmap(25));
|
||||
requestingHistory = true;
|
||||
emit requestArchive(line->firstMessageId());
|
||||
}
|
||||
|
@ -279,7 +279,7 @@ void Conversation::showEvent(QShowEvent* event)
|
|||
{
|
||||
if (!everShown) {
|
||||
everShown = true;
|
||||
m_ui->historyStatus->setPixmap(QIcon::fromTheme("view-refresh").pixmap(25));
|
||||
m_ui->historyStatus->setPixmap(Shared::icon("view-refresh", true).pixmap(25));
|
||||
requestingHistory = true;
|
||||
emit requestArchive(line->firstMessageId());
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ QIcon Models::Account::getStatusIcon(bool big) const
|
|||
} else if (state == Shared::disconnected) {
|
||||
return Shared::availabilityIcon(Shared::offline, big);
|
||||
} else {
|
||||
return QIcon::fromTheme(Shared::connectionStateThemeIcons[state]);
|
||||
return Shared::connectionStateIcon(state);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ QVariant Models::Accounts::data (const QModelIndex& index, int role) const
|
|||
break;
|
||||
case Qt::DecorationRole:
|
||||
if (index.column() == 2) {
|
||||
answer = QIcon::fromTheme(Shared::connectionStateThemeIcons[accs[index.row()]->getState()]);
|
||||
answer = Shared::connectionStateIcon(accs[index.row()]->getState());
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -219,7 +219,7 @@ void Models::Contact::setState(Shared::SubscriptionState p_state)
|
|||
QIcon Models::Contact::getStatusIcon(bool big) const
|
||||
{
|
||||
if (getMessagesCount() > 0) {
|
||||
return QIcon::fromTheme("mail-message");
|
||||
return Shared::icon("mail-message");
|
||||
} else if (state == Shared::both) {
|
||||
return Shared::availabilityIcon(availability, big);;
|
||||
} else {
|
||||
|
|
|
@ -143,7 +143,7 @@ void Models::Presence::dropMessages()
|
|||
QIcon Models::Presence::getStatusIcon(bool big) const
|
||||
{
|
||||
if (getMessagesCount() > 0) {
|
||||
return QIcon::fromTheme("mail-message");
|
||||
return Shared::icon("mail-message");
|
||||
} else {
|
||||
return Shared::availabilityIcon(availability, big);
|
||||
}
|
||||
|
|
|
@ -16,9 +16,9 @@ Squawk::Squawk(QWidget *parent) :
|
|||
m_ui->roster->setModel(&rosterModel);
|
||||
m_ui->roster->setContextMenuPolicy(Qt::CustomContextMenu);
|
||||
|
||||
const std::deque<QString>& fallback = palette().window().color().lightnessF() > 0.5 ? Shared::fallbackAvailabilityThemeIconsDarkSmall : Shared::fallbackAvailabilityThemeIconsLightSmall;
|
||||
for (int i = 0; i < Shared::availabilityNames.size(); ++i) {
|
||||
m_ui->comboBox->addItem(QIcon::fromTheme(Shared::availabilityThemeIcons[i], QIcon(fallback[i])), Shared::availabilityNames[i]);
|
||||
for (unsigned int i = Shared::availabilityLowest; i < Shared::availabilityHighest + 1; ++i) {
|
||||
Shared::Availability av = static_cast<Shared::Availability>(i);
|
||||
m_ui->comboBox->addItem(Shared::availabilityIcon(av), Shared::availabilityNames[av]);
|
||||
}
|
||||
m_ui->comboBox->setCurrentIndex(Shared::offline);
|
||||
|
||||
|
@ -356,18 +356,18 @@ void Squawk::onRosterContextMenu(const QPoint& point)
|
|||
QString name = acc->getName();
|
||||
|
||||
if (acc->getState() != Shared::disconnected) {
|
||||
QAction* con = contextMenu->addAction(QIcon::fromTheme("network-disconnect"), "Disconnect");
|
||||
QAction* con = contextMenu->addAction(Shared::icon("network-disconnect"), "Disconnect");
|
||||
connect(con, &QAction::triggered, [this, name]() {
|
||||
emit disconnectAccount(name);
|
||||
});
|
||||
} else {
|
||||
QAction* con = contextMenu->addAction(QIcon::fromTheme("network-connect"), "Connect");
|
||||
QAction* con = contextMenu->addAction(Shared::icon("network-connect"), "Connect");
|
||||
connect(con, &QAction::triggered, [this, name]() {
|
||||
emit connectAccount(name);
|
||||
});
|
||||
}
|
||||
|
||||
QAction* remove = contextMenu->addAction(QIcon::fromTheme("edit-delete"), "Remove");
|
||||
QAction* remove = contextMenu->addAction(Shared::icon("edit-delete"), "Remove");
|
||||
connect(remove, &QAction::triggered, [this, name]() {
|
||||
emit removeAccount(name);
|
||||
});
|
||||
|
@ -378,7 +378,7 @@ void Squawk::onRosterContextMenu(const QPoint& point)
|
|||
Models::Contact* cnt = static_cast<Models::Contact*>(item);
|
||||
hasMenu = true;
|
||||
|
||||
QAction* dialog = contextMenu->addAction(QIcon::fromTheme("mail-message"), "Open dialog");
|
||||
QAction* dialog = contextMenu->addAction(Shared::icon("mail-message"), "Open dialog");
|
||||
connect(dialog, &QAction::triggered, [this, index]() {
|
||||
onRosterItemDoubleClicked(index);
|
||||
});
|
||||
|
@ -387,7 +387,7 @@ void Squawk::onRosterContextMenu(const QPoint& point)
|
|||
switch (state) {
|
||||
case Shared::both:
|
||||
case Shared::to: {
|
||||
QAction* unsub = contextMenu->addAction(QIcon::fromTheme("news-unsubscribe"), "Unsubscribe");
|
||||
QAction* unsub = contextMenu->addAction(Shared::icon("news-unsubscribe"), "Unsubscribe");
|
||||
connect(unsub, &QAction::triggered, [this, cnt]() {
|
||||
emit unsubscribeContact(cnt->getAccountName(), cnt->getJid(), "");
|
||||
});
|
||||
|
@ -396,14 +396,14 @@ void Squawk::onRosterContextMenu(const QPoint& point)
|
|||
case Shared::from:
|
||||
case Shared::unknown:
|
||||
case Shared::none: {
|
||||
QAction* sub = contextMenu->addAction(QIcon::fromTheme("news-subscribe"), "Subscribe");
|
||||
QAction* sub = contextMenu->addAction(Shared::icon("news-subscribe"), "Subscribe");
|
||||
connect(sub, &QAction::triggered, [this, cnt]() {
|
||||
emit subscribeContact(cnt->getAccountName(), cnt->getJid(), "");
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
QAction* remove = contextMenu->addAction(QIcon::fromTheme("edit-delete"), "Remove");
|
||||
QAction* remove = contextMenu->addAction(Shared::icon("edit-delete"), "Remove");
|
||||
connect(remove, &QAction::triggered, [this, cnt]() {
|
||||
emit removeContactRequest(cnt->getAccountName(), cnt->getJid());
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue