mirror of
https://github.com/Dark98/threeSD.git
synced 2026-07-02 16:49:04 +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
|
||||
}
|
||||
|
||||
#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;
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user