Fixed #219.
This commit is contained in:
parent
37109a47ff
commit
6c34f1a925
Binary file not shown.
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 18 KiB |
Binary file not shown.
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 1.0 KiB |
@ -6,8 +6,13 @@
|
|||||||
<file>text/COPYING_GNU_GPL_HTML</file>
|
<file>text/COPYING_GNU_GPL_HTML</file>
|
||||||
|
|
||||||
<file>graphics/rssguard.ico</file>
|
<file>graphics/rssguard.ico</file>
|
||||||
|
|
||||||
<file>graphics/rssguard.png</file>
|
<file>graphics/rssguard.png</file>
|
||||||
<file>graphics/rssguard_plain.png</file>
|
<file>graphics/rssguard_plain.png</file>
|
||||||
|
|
||||||
|
<file>graphics/rssguard_mono.png</file>
|
||||||
|
<file>graphics/rssguard_plain_mono.png</file>
|
||||||
|
|
||||||
<file>graphics/misc/adblock.png</file>
|
<file>graphics/misc/adblock.png</file>
|
||||||
<file>graphics/misc/adblock-disabled.png</file>
|
<file>graphics/misc/adblock-disabled.png</file>
|
||||||
<file>graphics/misc/gmail.png</file>
|
<file>graphics/misc/gmail.png</file>
|
||||||
|
@ -13,7 +13,6 @@
|
|||||||
|
|
||||||
#define ARGUMENTS_LIST_SEPARATOR "\n"
|
#define ARGUMENTS_LIST_SEPARATOR "\n"
|
||||||
|
|
||||||
#define DESKTOP_FILE_NAME "com.github.rssguard.desktop"
|
|
||||||
#define LOCALHOST_ADDRESS "http://localhost"
|
#define LOCALHOST_ADDRESS "http://localhost"
|
||||||
#define ADBLOCK_ADBLOCKED_PAGE "adblockedpage"
|
#define ADBLOCK_ADBLOCKED_PAGE "adblockedpage"
|
||||||
#define ADBLOCK_HOWTO_FILTERS "http://adblockplus.org/en/filters"
|
#define ADBLOCK_HOWTO_FILTERS "http://adblockplus.org/en/filters"
|
||||||
@ -228,8 +227,13 @@
|
|||||||
#define APP_THEME_PATH QSL(":/graphics")
|
#define APP_THEME_PATH QSL(":/graphics")
|
||||||
#define APP_SQL_PATH QSL(":/sql")
|
#define APP_SQL_PATH QSL(":/sql")
|
||||||
#define APP_INFO_PATH QSL(":/text")
|
#define APP_INFO_PATH QSL(":/text")
|
||||||
|
|
||||||
#define APP_ICON_PATH QSL(":/graphics/rssguard.png")
|
#define APP_ICON_PATH QSL(":/graphics/rssguard.png")
|
||||||
#define APP_ICON_PLAIN_PATH QSL(":/graphics/rssguard_plain.png")
|
#define APP_ICON_PLAIN_PATH QSL(":/graphics/rssguard_plain.png")
|
||||||
|
|
||||||
|
#define APP_ICON_MONO_PATH QSL(":/graphics/rssguard_mono.png")
|
||||||
|
#define APP_ICON_MONO_PLAIN_PATH QSL(":/graphics/rssguard_plain_mono.png")
|
||||||
|
|
||||||
#define APP_SKIN_PATH QSL(":/skins")
|
#define APP_SKIN_PATH QSL(":/skins")
|
||||||
#define APP_INITIAL_FEEDS_PATH QSL(":/initial_feeds")
|
#define APP_INITIAL_FEEDS_PATH QSL(":/initial_feeds")
|
||||||
#define APP_LANG_PATH QSL(":/localization")
|
#define APP_LANG_PATH QSL(":/localization")
|
||||||
|
@ -42,6 +42,7 @@ SettingsGui::SettingsGui(Settings* settings, QWidget* parent) : SettingsPanel(se
|
|||||||
connect(m_ui->m_grpTray, &QGroupBox::toggled, this, &SettingsGui::dirtifySettings);
|
connect(m_ui->m_grpTray, &QGroupBox::toggled, this, &SettingsGui::dirtifySettings);
|
||||||
connect(m_ui->m_checkEnableNotifications, &QCheckBox::toggled, this, &SettingsGui::dirtifySettings);
|
connect(m_ui->m_checkEnableNotifications, &QCheckBox::toggled, this, &SettingsGui::dirtifySettings);
|
||||||
connect(m_ui->m_checkHidden, &QCheckBox::toggled, this, &SettingsGui::dirtifySettings);
|
connect(m_ui->m_checkHidden, &QCheckBox::toggled, this, &SettingsGui::dirtifySettings);
|
||||||
|
connect(m_ui->m_checkMonochromeIcons, &QCheckBox::toggled, this, &SettingsGui::dirtifySettings);
|
||||||
connect(m_ui->m_checkHideWhenMinimized, &QCheckBox::toggled, this, &SettingsGui::dirtifySettings);
|
connect(m_ui->m_checkHideWhenMinimized, &QCheckBox::toggled, this, &SettingsGui::dirtifySettings);
|
||||||
connect(m_ui->m_checkHideTabBarIfOneTabVisible, &QCheckBox::toggled, this, &SettingsGui::dirtifySettings);
|
connect(m_ui->m_checkHideTabBarIfOneTabVisible, &QCheckBox::toggled, this, &SettingsGui::dirtifySettings);
|
||||||
connect(m_ui->m_checkCloseTabsDoubleClick, &QCheckBox::toggled, this, &SettingsGui::dirtifySettings);
|
connect(m_ui->m_checkCloseTabsDoubleClick, &QCheckBox::toggled, this, &SettingsGui::dirtifySettings);
|
||||||
@ -114,6 +115,8 @@ void SettingsGui::loadSettings() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_ui->m_checkMonochromeIcons->setChecked(settings()->value(GROUP(GUI), SETTING(GUI::MonochromeTrayIcon)).toBool());
|
||||||
|
|
||||||
// Mark active theme.
|
// Mark active theme.
|
||||||
if (current_theme == QSL(APP_NO_THEME)) {
|
if (current_theme == QSL(APP_NO_THEME)) {
|
||||||
// Because "no icon theme" lies at the index 0.
|
// Because "no icon theme" lies at the index 0.
|
||||||
@ -204,6 +207,13 @@ void SettingsGui::saveSettings() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto old_monochrome = settings()->value(GROUP(GUI), SETTING(GUI::MonochromeTrayIcon)).toBool();
|
||||||
|
|
||||||
|
if (old_monochrome != m_ui->m_checkMonochromeIcons->isChecked()) {
|
||||||
|
requireRestart();
|
||||||
|
settings()->setValue(GROUP(GUI), GUI::MonochromeTrayIcon, m_ui->m_checkMonochromeIcons->isChecked());
|
||||||
|
}
|
||||||
|
|
||||||
settings()->setValue(GROUP(GUI), GUI::MainWindowStartsHidden, m_ui->m_checkHidden->isChecked());
|
settings()->setValue(GROUP(GUI), GUI::MainWindowStartsHidden, m_ui->m_checkHidden->isChecked());
|
||||||
settings()->setValue(GROUP(GUI), GUI::HideMainWindowWhenMinimized, m_ui->m_checkHideWhenMinimized->isChecked());
|
settings()->setValue(GROUP(GUI), GUI::HideMainWindowWhenMinimized, m_ui->m_checkHideWhenMinimized->isChecked());
|
||||||
|
|
||||||
|
@ -152,27 +152,34 @@
|
|||||||
<property name="fieldGrowthPolicy">
|
<property name="fieldGrowthPolicy">
|
||||||
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
<enum>QFormLayout::ExpandingFieldsGrow</enum>
|
||||||
</property>
|
</property>
|
||||||
<item row="1" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QCheckBox" name="m_checkHideWhenMinimized">
|
<widget class="QCheckBox" name="m_checkHideWhenMinimized">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Hide main window when it is minimized</string>
|
<string>Hide main window when it is minimized</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0" colspan="2">
|
<item row="3" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="m_checkHidden">
|
<widget class="QCheckBox" name="m_checkHidden">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Start application hidden</string>
|
<string>Start application hidden</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QCheckBox" name="m_checkEnableNotifications">
|
<widget class="QCheckBox" name="m_checkEnableNotifications">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Enable popup balloon tooltips</string>
|
<string>Enable popup balloon tooltips</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QCheckBox" name="m_checkMonochromeIcons">
|
||||||
|
<property name="text">
|
||||||
|
<string>Use monochrome icon</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -359,16 +366,17 @@
|
|||||||
<tabstop>m_cmbIconTheme</tabstop>
|
<tabstop>m_cmbIconTheme</tabstop>
|
||||||
<tabstop>m_listStyles</tabstop>
|
<tabstop>m_listStyles</tabstop>
|
||||||
<tabstop>m_treeSkins</tabstop>
|
<tabstop>m_treeSkins</tabstop>
|
||||||
|
<tabstop>m_grpTray</tabstop>
|
||||||
|
<tabstop>m_checkMonochromeIcons</tabstop>
|
||||||
|
<tabstop>m_checkEnableNotifications</tabstop>
|
||||||
<tabstop>m_checkHideWhenMinimized</tabstop>
|
<tabstop>m_checkHideWhenMinimized</tabstop>
|
||||||
<tabstop>m_checkHidden</tabstop>
|
<tabstop>m_checkHidden</tabstop>
|
||||||
<tabstop>m_checkEnableNotifications</tabstop>
|
|
||||||
<tabstop>m_checkNewTabDoubleClick</tabstop>
|
|
||||||
<tabstop>m_checkHideTabBarIfOneTabVisible</tabstop>
|
|
||||||
<tabstop>m_checkCloseTabsDoubleClick</tabstop>
|
<tabstop>m_checkCloseTabsDoubleClick</tabstop>
|
||||||
<tabstop>m_checkCloseTabsMiddleClick</tabstop>
|
<tabstop>m_checkCloseTabsMiddleClick</tabstop>
|
||||||
|
<tabstop>m_checkNewTabDoubleClick</tabstop>
|
||||||
|
<tabstop>m_checkHideTabBarIfOneTabVisible</tabstop>
|
||||||
<tabstop>m_cmbToolbarButtonStyle</tabstop>
|
<tabstop>m_cmbToolbarButtonStyle</tabstop>
|
||||||
<tabstop>m_cmbSelectToolBar</tabstop>
|
<tabstop>m_cmbSelectToolBar</tabstop>
|
||||||
<tabstop>m_grpTray</tabstop>
|
|
||||||
</tabstops>
|
</tabstops>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
@ -114,9 +114,16 @@ void SystemTrayIcon::setNumber(int number, bool any_new_message) {
|
|||||||
QPainter tray_painter;
|
QPainter tray_painter;
|
||||||
|
|
||||||
tray_painter.begin(&background);
|
tray_painter.begin(&background);
|
||||||
tray_painter.setPen(Qt::black);
|
|
||||||
tray_painter.setRenderHint(QPainter::SmoothPixmapTransform, true);
|
if (qApp->settings()->value(GROUP(GUI), SETTING(GUI::MonochromeTrayIcon)).toBool()) {
|
||||||
tray_painter.setRenderHint(QPainter::TextAntialiasing, true);
|
tray_painter.setPen(Qt::GlobalColor::white);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
tray_painter.setPen(Qt::GlobalColor::black);
|
||||||
|
}
|
||||||
|
|
||||||
|
tray_painter.setRenderHint(QPainter::RenderHint::SmoothPixmapTransform, true);
|
||||||
|
tray_painter.setRenderHint(QPainter::RenderHint::TextAntialiasing, true);
|
||||||
|
|
||||||
// Numbers with more than 2 digits won't be readable, display
|
// Numbers with more than 2 digits won't be readable, display
|
||||||
// infinity symbol in that case.
|
// infinity symbol in that case.
|
||||||
@ -140,7 +147,9 @@ void SystemTrayIcon::setNumber(int number, bool any_new_message) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tray_painter.setFont(m_font);
|
tray_painter.setFont(m_font);
|
||||||
tray_painter.drawText(QRect(0, 0, 128, 128), Qt::AlignVCenter | Qt::AlignCenter, QString::number(number));
|
tray_painter.drawText(QRect(0, 0, 128, 128),
|
||||||
|
Qt::AlignmentFlag::AlignVCenter | Qt::AlignmentFlag::AlignCenter,
|
||||||
|
QString::number(number));
|
||||||
}
|
}
|
||||||
|
|
||||||
tray_painter.end();
|
tray_painter.end();
|
||||||
|
@ -353,7 +353,13 @@ void Application::processExecutionMessage(const QString& message) {
|
|||||||
|
|
||||||
SystemTrayIcon* Application::trayIcon() {
|
SystemTrayIcon* Application::trayIcon() {
|
||||||
if (m_trayIcon == nullptr) {
|
if (m_trayIcon == nullptr) {
|
||||||
|
if (qApp->settings()->value(GROUP(GUI), SETTING(GUI::MonochromeTrayIcon)).toBool()) {
|
||||||
|
m_trayIcon = new SystemTrayIcon(APP_ICON_MONO_PATH, APP_ICON_MONO_PLAIN_PATH, m_mainForm);
|
||||||
|
}
|
||||||
|
else {
|
||||||
m_trayIcon = new SystemTrayIcon(APP_ICON_PATH, APP_ICON_PLAIN_PATH, m_mainForm);
|
m_trayIcon = new SystemTrayIcon(APP_ICON_PATH, APP_ICON_PLAIN_PATH, m_mainForm);
|
||||||
|
}
|
||||||
|
|
||||||
connect(m_trayIcon, &SystemTrayIcon::shown, m_feedReader->feedsModel(), &FeedsModel::notifyWithCounts);
|
connect(m_trayIcon, &SystemTrayIcon::shown, m_feedReader->feedsModel(), &FeedsModel::notifyWithCounts);
|
||||||
connect(m_feedReader->feedsModel(), &FeedsModel::messageCountsChanged, m_trayIcon, &SystemTrayIcon::setNumber);
|
connect(m_feedReader->feedsModel(), &FeedsModel::messageCountsChanged, m_trayIcon, &SystemTrayIcon::setNumber);
|
||||||
}
|
}
|
||||||
|
@ -176,6 +176,10 @@ DKEY GUI::HideMainWindowWhenMinimized = "hide_when_minimized";
|
|||||||
|
|
||||||
DVALUE(bool) GUI::HideMainWindowWhenMinimizedDef = false;
|
DVALUE(bool) GUI::HideMainWindowWhenMinimizedDef = false;
|
||||||
|
|
||||||
|
DKEY GUI::MonochromeTrayIcon = "monochrome_tray_icon";
|
||||||
|
|
||||||
|
DVALUE(bool) GUI::MonochromeTrayIconDef = false;
|
||||||
|
|
||||||
DKEY GUI::UseTrayIcon = "use_tray_icon";
|
DKEY GUI::UseTrayIcon = "use_tray_icon";
|
||||||
|
|
||||||
DVALUE(bool) GUI::UseTrayIconDef = true;
|
DVALUE(bool) GUI::UseTrayIconDef = true;
|
||||||
|
@ -196,6 +196,10 @@ namespace GUI {
|
|||||||
|
|
||||||
VALUE(bool) UseTrayIconDef;
|
VALUE(bool) UseTrayIconDef;
|
||||||
|
|
||||||
|
KEY MonochromeTrayIcon;
|
||||||
|
|
||||||
|
VALUE(bool) MonochromeTrayIconDef;
|
||||||
|
|
||||||
KEY EnableNotifications;
|
KEY EnableNotifications;
|
||||||
|
|
||||||
VALUE(bool) EnableNotificationsDef;
|
VALUE(bool) EnableNotificationsDef;
|
||||||
|
@ -29,7 +29,7 @@ int main(int argc, char* argv[]) {
|
|||||||
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
|
|
||||||
#if defined (Q_OS_LINUX)
|
#if defined (Q_OS_LINUX)
|
||||||
QApplication::setDesktopFileName(DESKTOP_FILE_NAME);
|
QApplication::setDesktopFileName(APP_DESKTOP_ENTRY_FILE);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Ensure that ini format is used as application settings storage on Mac OS.
|
// Ensure that ini format is used as application settings storage on Mac OS.
|
||||||
@ -78,8 +78,8 @@ int main(int argc, char* argv[]) {
|
|||||||
|
|
||||||
qApp->loadDynamicShortcuts();
|
qApp->loadDynamicShortcuts();
|
||||||
qApp->hideOrShowMainForm();
|
qApp->hideOrShowMainForm();
|
||||||
qApp->showTrayIcon();
|
|
||||||
qApp->feedReader()->feedsModel()->loadActivatedServiceAccounts();
|
qApp->feedReader()->feedsModel()->loadActivatedServiceAccounts();
|
||||||
|
qApp->showTrayIcon();
|
||||||
qApp->offerChanges();
|
qApp->offerChanges();
|
||||||
qApp->showPolls();
|
qApp->showPolls();
|
||||||
qApp->mainForm()->tabWidget()->feedMessageViewer()->feedsView()->loadAllExpandStates();
|
qApp->mainForm()->tabWidget()->feedMessageViewer()->feedsView()->loadAllExpandStates();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user