Skip to content

Commit

Permalink
Switch to classic style and remove paint events
Browse files Browse the repository at this point in the history
  • Loading branch information
Eugen Fischer authored and Eugen Fischer committed Dec 18, 2023
1 parent 86c01a9 commit 7eee017
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 24 deletions.
9 changes: 1 addition & 8 deletions src/gui/nmcgui/nmcowncloudadvancedsetuppage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,8 @@ NMCOwncloudAdvancedSetupPage::NMCOwncloudAdvancedSetupPage(OwncloudWizard *wizar

_ui.verticalLayout->removeWidget(_ui.errorLabel);
_ui.wSyncStrategy->insertWidget(0, _ui.errorLabel);
}

void NMCOwncloudAdvancedSetupPage::paintEvent(QPaintEvent *event)
{
QPainter painter;
painter.begin(this);
painter.fillRect(rect(), Qt::white);
painter.end();
OwncloudAdvancedSetupPage::paintEvent(event);
_ui.lServerIcon->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Expanding);
}

} // namespace OCC
3 changes: 0 additions & 3 deletions src/gui/nmcgui/nmcowncloudadvancedsetuppage.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@ class NMCOwncloudAdvancedSetupPage : public OwncloudAdvancedSetupPage
public:
NMCOwncloudAdvancedSetupPage(OwncloudWizard *wizard);
~NMCOwncloudAdvancedSetupPage() = default;

protected:
void paintEvent(QPaintEvent *event) override;
};

} // namespace OCC
Expand Down
9 changes: 0 additions & 9 deletions src/gui/wizard/flow2authcredspage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,13 +146,4 @@ void Flow2AuthCredsPage::slotStyleChanged()
emit styleChanged();
}

void Flow2AuthCredsPage::paintEvent(QPaintEvent *event)
{
QPainter painter;
painter.begin(this);
painter.fillRect(rect(), Qt::white);
painter.end();
AbstractCredentialsWizardPage::paintEvent(event);
}

} // namespace OCC
3 changes: 0 additions & 3 deletions src/gui/wizard/flow2authcredspage.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,6 @@ public Q_SLOTS:
QString _user;
QString _appPassword;

protected:
void paintEvent(QPaintEvent *event) override;

private:
Flow2AuthWidget *_flow2AuthWidget = nullptr;
QVBoxLayout *_layout = nullptr;
Expand Down
11 changes: 10 additions & 1 deletion src/gui/wizard/owncloudwizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ OwncloudWizard::OwncloudWizard(QWidget *parent)

Theme *theme = Theme::instance();
setWindowTitle(tr("Add %1 account").arg(theme->appNameGUI()));
setWizardStyle(QWizard::ModernStyle);
setWizardStyle(QWizard::ClassicStyle);
setOption(QWizard::NoBackButtonOnStartPage);
setOption(QWizard::NoCancelButton);
setButtonText(QWizard::CustomButton1, tr("Skip folders configuration"));
Expand Down Expand Up @@ -387,6 +387,15 @@ void OwncloudWizard::changeEvent(QEvent *e)
QWizard::changeEvent(e);
}

void OwncloudWizard::paintEvent(QPaintEvent *event)
{
QPainter painter;
painter.begin(this);
painter.fillRect(rect(), Qt::white);
painter.end();
QWizard::paintEvent(event);
}

void OwncloudWizard::customizeStyle()
{
// HINT: Customize wizard's own style here, if necessary in the future (Dark-/Light-Mode switching)
Expand Down
1 change: 1 addition & 0 deletions src/gui/wizard/owncloudwizard.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public slots:

protected:
void changeEvent(QEvent *) override;
void paintEvent(QPaintEvent *event) override;

private:
void customizeStyle();
Expand Down

0 comments on commit 7eee017

Please sign in to comment.