mirror of
https://github.com/Dark98/threeSD.git
synced 2026-07-03 00:38:58 +00:00
Fix clang, and clean up apple-specific code
This commit is contained in:
@@ -36,12 +36,12 @@ void DPIAwareDialog::showEvent(QShowEvent* event) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef __APPLE__
|
||||||
void DPIAwareDialog::resizeEvent(QResizeEvent* event) {
|
void DPIAwareDialog::resizeEvent(QResizeEvent* event) {
|
||||||
QDialog::resizeEvent(event);
|
QDialog::resizeEvent(event);
|
||||||
resized = true;
|
resized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef __APPLE__
|
|
||||||
void DPIAwareDialog::OnScreenChanged() {
|
void DPIAwareDialog::OnScreenChanged() {
|
||||||
// Resize according to DPI
|
// Resize according to DPI
|
||||||
const double scaleX = window_handle->screen()->logicalDotsPerInchX() / 96.0;
|
const double scaleX = window_handle->screen()->logicalDotsPerInchX() / 96.0;
|
||||||
|
|||||||
@@ -13,24 +13,27 @@ public:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
void showEvent(QShowEvent* event) override;
|
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
|
// 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.
|
// when screen is changed, to update those sizes.
|
||||||
virtual void SetContentSizes(int previous_width = 0, int previous_height = 0){};
|
virtual void SetContentSizes(int previous_width = 0, int previous_height = 0){};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
#ifndef __APPLE__
|
|
||||||
void OnScreenChanged();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QWindow* window_handle{};
|
QWindow* window_handle{};
|
||||||
const int original_width{};
|
const int original_width{};
|
||||||
const int original_height{};
|
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
|
bool resized = false; // whether this dialog has been manually resized
|
||||||
double previous_scaleX{};
|
double previous_scaleX{};
|
||||||
double previous_scaleY{};
|
double previous_scaleY{};
|
||||||
int previous_width{};
|
int previous_width{};
|
||||||
int previous_height{};
|
int previous_height{};
|
||||||
|
#endif
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user