made this: if Tray become disabled and startInTray was enabled, startInTray before blocks, goes disabled too

This commit is contained in:
kirillpt 2020-11-25 19:31:03 +03:00
parent c5419f8783
commit 041c01f3a4

View file

@ -549,8 +549,10 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge
cameraFrameRateCombo_ = new QComboBox{this}; cameraFrameRateCombo_ = new QComboBox{this};
timelineMaxWidthSpin_ = new QSpinBox{this}; timelineMaxWidthSpin_ = new QSpinBox{this};
if (!settings_->tray()) if (!settings_->tray()) {
startInTrayToggle_->setState(false);
startInTrayToggle_->setDisabled(true); startInTrayToggle_->setDisabled(true);
}
avatarCircles_->setFixedSize(64, 48); avatarCircles_->setFixedSize(64, 48);
@ -875,6 +877,7 @@ UserSettingsPage::UserSettingsPage(QSharedPointer<UserSettings> settings, QWidge
if (enabled) { if (enabled) {
startInTrayToggle_->setEnabled(true); startInTrayToggle_->setEnabled(true);
} else { } else {
startInTrayToggle_->setState(false);
startInTrayToggle_->setDisabled(true); startInTrayToggle_->setDisabled(true);
} }
emit trayOptionChanged(enabled); emit trayOptionChanged(enabled);
@ -971,7 +974,6 @@ UserSettingsPage::showEvent(QShowEvent *)
utils::restoreCombobox(themeCombo_, settings_->theme()); utils::restoreCombobox(themeCombo_, settings_->theme());
utils::restoreCombobox(ringtoneCombo_, settings_->ringtone()); utils::restoreCombobox(ringtoneCombo_, settings_->ringtone());
// FIXME: Toggle treats true as "off"
trayToggle_->setState(settings_->tray()); trayToggle_->setState(settings_->tray());
startInTrayToggle_->setState(settings_->startInTray()); startInTrayToggle_->setState(settings_->startInTray());
groupViewToggle_->setState(settings_->groupView()); groupViewToggle_->setState(settings_->groupView());