mirror of https://github.com/nextcloud/desktop
Merge pull request #4283 from nextcloud/bugfix/folder-wizard-warn-color
Fix warn colour in dark mode
This commit is contained in:
commit
121f202b45
|
@ -77,6 +77,8 @@ FolderWizardLocalPath::FolderWizardLocalPath(const AccountPtr &account)
|
||||||
|
|
||||||
_ui.warnLabel->setTextFormat(Qt::RichText);
|
_ui.warnLabel->setTextFormat(Qt::RichText);
|
||||||
_ui.warnLabel->hide();
|
_ui.warnLabel->hide();
|
||||||
|
|
||||||
|
changeStyle();
|
||||||
}
|
}
|
||||||
|
|
||||||
FolderWizardLocalPath::~FolderWizardLocalPath() = default;
|
FolderWizardLocalPath::~FolderWizardLocalPath() = default;
|
||||||
|
@ -141,6 +143,31 @@ void FolderWizardLocalPath::slotChooseLocalFolder()
|
||||||
emit completeChanged();
|
emit completeChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void FolderWizardLocalPath::changeEvent(QEvent *e)
|
||||||
|
{
|
||||||
|
switch (e->type()) {
|
||||||
|
case QEvent::StyleChange:
|
||||||
|
case QEvent::PaletteChange:
|
||||||
|
case QEvent::ThemeChange:
|
||||||
|
// Notify the other widgets (Dark-/Light-Mode switching)
|
||||||
|
changeStyle();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
FormatWarningsWizardPage::changeEvent(e);
|
||||||
|
}
|
||||||
|
|
||||||
|
void FolderWizardLocalPath::changeStyle()
|
||||||
|
{
|
||||||
|
const auto warnYellow = Theme::isDarkColor(QGuiApplication::palette().base().color()) ? QColor(63, 63, 0) : QColor(255, 255, 192);
|
||||||
|
auto modifiedPalette = _ui.warnLabel->palette();
|
||||||
|
modifiedPalette.setColor(QPalette::Window, warnYellow);
|
||||||
|
_ui.warnLabel->setPalette(modifiedPalette);
|
||||||
|
}
|
||||||
|
|
||||||
// =================================================================================
|
// =================================================================================
|
||||||
FolderWizardRemotePath::FolderWizardRemotePath(const AccountPtr &account)
|
FolderWizardRemotePath::FolderWizardRemotePath(const AccountPtr &account)
|
||||||
: FormatWarningsWizardPage()
|
: FormatWarningsWizardPage()
|
||||||
|
|
|
@ -60,10 +60,16 @@ public:
|
||||||
void cleanupPage() override;
|
void cleanupPage() override;
|
||||||
|
|
||||||
void setFolderMap(const Folder::Map &fm) { _folderMap = fm; }
|
void setFolderMap(const Folder::Map &fm) { _folderMap = fm; }
|
||||||
|
|
||||||
|
protected:
|
||||||
|
void changeEvent(QEvent *) override;
|
||||||
|
|
||||||
protected slots:
|
protected slots:
|
||||||
void slotChooseLocalFolder();
|
void slotChooseLocalFolder();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void changeStyle();
|
||||||
|
|
||||||
Ui_FolderWizardSourcePage _ui;
|
Ui_FolderWizardSourcePage _ui;
|
||||||
Folder::Map _folderMap;
|
Folder::Map _folderMap;
|
||||||
AccountPtr _account;
|
AccountPtr _account;
|
||||||
|
|
Loading…
Reference in New Issue