Fix clang, and clean up apple-specific code

This commit is contained in:
Pengfei
2021-08-17 00:47:26 +08:00
parent e2cd3f117a
commit fb182f2627
2 changed files with 9 additions and 6 deletions
+1 -1
View File
@@ -36,12 +36,12 @@ void DPIAwareDialog::showEvent(QShowEvent* event) {
#endif
}
#ifndef __APPLE__
void DPIAwareDialog::resizeEvent(QResizeEvent* event) {
QDialog::resizeEvent(event);
resized = true;
}
#ifndef __APPLE__
void DPIAwareDialog::OnScreenChanged() {
// Resize according to DPI
const double scaleX = window_handle->screen()->logicalDotsPerInchX() / 96.0;
+8 -5
View File
@@ -13,24 +13,27 @@ public:
protected:
void showEvent(QShowEvent* event) override;
void resizeEvent(QResizeEvent* event) override;
// Called with two zeroes to set up content sizes that are relative to dialog size. Also called
// when screen is changed, to update those sizes.
virtual void SetContentSizes(int previous_width = 0, int previous_height = 0){};
private:
#ifndef __APPLE__
void OnScreenChanged();
#endif
QWindow* window_handle{};
const int original_width{};
const int original_height{};
#ifndef __APPLE__
protected:
void resizeEvent(QResizeEvent* event) override;
private:
void OnScreenChanged();
bool resized = false; // whether this dialog has been manually resized
double previous_scaleX{};
double previous_scaleY{};
int previous_width{};
int previous_height{};
#endif
};