manage display event corectly
This commit is contained in:
1 parent
92c520dc08
commit
6491f723ff
8 files changed
+22
-38
No files matched your search
@@ -106,6 +106,11 @@ CityTypeDlg::CityTypeDlg(QWidget *parent) : FramedDlg(parent), ui(new Ui::CityTy
|
||||
changed = true;
|
||||
smartUpdateContent();
|
||||
};
|
||||
onShow = [this] {
|
||||
loadType(0);
|
||||
dragiix = -1;
|
||||
offscreenPaint();
|
||||
};
|
||||
}
|
||||
|
||||
CityTypeDlg::~CityTypeDlg()
|
||||
@@ -140,14 +145,6 @@ void CityTypeDlg::saveType()
|
||||
changed = false;
|
||||
}
|
||||
|
||||
void CityTypeDlg::showEvent(QShowEvent *event)
|
||||
{
|
||||
FramedDlg::showEvent(event);
|
||||
loadType(0);
|
||||
dragiix = -1;
|
||||
offscreenPaint();
|
||||
}
|
||||
|
||||
void CityTypeDlg::closeEvent(QCloseEvent *event)
|
||||
{
|
||||
saveType();
|
||||
|
||||
@@ -55,7 +55,6 @@ public:
|
||||
protected:
|
||||
void offscreenPaint() override;
|
||||
void vpaint(Dpi::Canvas &canvas) override;
|
||||
void showEvent(QShowEvent *event) override;
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
void closeEvent(QCloseEvent *event) override;
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
|
||||
@@ -164,6 +164,11 @@ DiaDlg::DiaDlg(QWidget *parent) : FramedDlg(parent), ui(new Ui::DiaDlg)
|
||||
|
||||
ui->closeBtn->onClick = [this] { close(); };
|
||||
ui->toggleBtn->onClick = [this] { toggleBtnClicked(); };
|
||||
onShow = [this] {
|
||||
if (windowMode() == WindowMode::Modal)
|
||||
centerToScreen();
|
||||
offscreenPaint();
|
||||
};
|
||||
}
|
||||
|
||||
DiaDlg::~DiaDlg()
|
||||
@@ -281,14 +286,6 @@ void DiaDlg::vpaint(Dpi::Canvas &canvas)
|
||||
loweredTextOut(canvas, -1, *MainTexture, (width() - biColorTextWidth(canvas, s)) / 2, 31, s);
|
||||
}
|
||||
|
||||
void DiaDlg::showEvent(QShowEvent *event)
|
||||
{
|
||||
FramedDlg::showEvent(event);
|
||||
if (windowMode() == WindowMode::Modal)
|
||||
centerToScreen();
|
||||
offscreenPaint();
|
||||
}
|
||||
|
||||
void DiaDlg::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
FramedDlg::resizeEvent(event);
|
||||
|
||||
@@ -57,7 +57,6 @@ public:
|
||||
protected:
|
||||
void offscreenPaint() override;
|
||||
void vpaint(Dpi::Canvas &canvas) override;
|
||||
void showEvent(QShowEvent *event) override;
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
void keyPressEvent(QKeyEvent *event) override;
|
||||
|
||||
|
||||
@@ -73,6 +73,13 @@ RatesDlg::RatesDlg(QWidget *parent) : BufferedDrawDlg(parent), ui(new Ui::RatesD
|
||||
ui->taxDownBtn->onClick = [this] { taxLuxBtnClick(1); };
|
||||
ui->scienceBtn->onClick = [this] { taxLuxBtnClick(2); };
|
||||
ui->luxBtn->onClick = [this] { taxLuxBtnClick(3); };
|
||||
onShow = [this] {
|
||||
setWindowTitle(phrase(QStringLiteral("TITLE_RATES")));
|
||||
const bool hasLiberty = ClientTools::myRO->Wonder[woLiberty].EffectiveOwner == ClientTools::me;
|
||||
ui->scienceBtn->setVisible(!hasLiberty);
|
||||
ui->luxBtn->setVisible(!hasLiberty);
|
||||
offscreenPaint();
|
||||
};
|
||||
}
|
||||
|
||||
RatesDlg::~RatesDlg()
|
||||
@@ -164,16 +171,6 @@ void RatesDlg::resizeEvent(QResizeEvent *event)
|
||||
ui->closeBtn->move(width() - 38, ui->closeBtn->y());
|
||||
}
|
||||
|
||||
void RatesDlg::showEvent(QShowEvent *event)
|
||||
{
|
||||
BufferedDrawDlg::showEvent(event);
|
||||
setWindowTitle(phrase(QStringLiteral("TITLE_RATES")));
|
||||
const bool hasLiberty = ClientTools::myRO->Wonder[woLiberty].EffectiveOwner == ClientTools::me;
|
||||
ui->scienceBtn->setVisible(!hasLiberty);
|
||||
ui->luxBtn->setVisible(!hasLiberty);
|
||||
offscreenPaint();
|
||||
}
|
||||
|
||||
void RatesDlg::taxLuxBtnClick(int which)
|
||||
{
|
||||
int newTax = ClientTools::myRO->TaxRate / 10;
|
||||
|
||||
@@ -51,7 +51,6 @@ public:
|
||||
|
||||
protected:
|
||||
void offscreenPaint() override;
|
||||
void showEvent(QShowEvent *event) override;
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
|
||||
private:
|
||||
|
||||
@@ -92,6 +92,11 @@ WondersDlg::WondersDlg(QWidget *parent) : BufferedDrawDlg(parent), ui(new Ui::Wo
|
||||
ui->closeBtn->setButtonIndex(0);
|
||||
ui->closeBtn->onClick = [this] { close(); };
|
||||
initButtons();
|
||||
onShow = [this] {
|
||||
setWindowTitle(phrase(QStringLiteral("TITLE_WONDERS")));
|
||||
selection = -1;
|
||||
offscreenPaint();
|
||||
};
|
||||
}
|
||||
|
||||
WondersDlg::~WondersDlg()
|
||||
@@ -281,14 +286,6 @@ void WondersDlg::vpaint(Dpi::Canvas &canvas)
|
||||
loweredTextOut(canvas, -1, *MainTexture, (width() - biColorTextWidth(canvas, s)) / 2, height() - 3 - 36 + 10, s);
|
||||
}
|
||||
|
||||
void WondersDlg::showEvent(QShowEvent *event)
|
||||
{
|
||||
BufferedDrawDlg::showEvent(event);
|
||||
setWindowTitle(phrase(QStringLiteral("TITLE_WONDERS")));
|
||||
selection = -1;
|
||||
offscreenPaint();
|
||||
}
|
||||
|
||||
void WondersDlg::resizeEvent(QResizeEvent *event)
|
||||
{
|
||||
BufferedDrawDlg::resizeEvent(event);
|
||||
|
||||
@@ -54,7 +54,6 @@ public:
|
||||
protected:
|
||||
void offscreenPaint() override;
|
||||
void vpaint(Dpi::Canvas &canvas) override;
|
||||
void showEvent(QShowEvent *event) override;
|
||||
void resizeEvent(QResizeEvent *event) override;
|
||||
void mouseMoveEvent(QMouseEvent *event) override;
|
||||
void mousePressEvent(QMouseEvent *event) override;
|
||||
|
||||
Reference in new issue
Block a user