mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-19 23:20:52 +01:00
improve maximum config-dialog-size (no QT5 version-check needed)
This commit is contained in:
@@ -79,16 +79,9 @@ ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent) {
|
|||||||
connect(pages_list, SIGNAL(currentRowChanged(int)),
|
connect(pages_list, SIGNAL(currentRowChanged(int)),
|
||||||
pages_widget, SLOT(setCurrentIndex(int)));
|
pages_widget, SLOT(setCurrentIndex(int)));
|
||||||
|
|
||||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
|
|
||||||
// set maximum a bit smaller than available size = (screen-size - Task-Bar):
|
// set maximum a bit smaller than available size = (screen-size - Task-Bar):
|
||||||
// "primaryScreen" <-> the screen where the main widget of application resides
|
setMaximumSize((int)(0.94 * MachineInfo::instance()->i_max_available_width()),
|
||||||
setMaximumSize((int)(0.95 * QGuiApplication::primaryScreen()->availableSize().width()),
|
(int)(0.94 * MachineInfo::instance()->i_max_available_height()));
|
||||||
(int)(0.95 * QGuiApplication::primaryScreen()->availableSize().height()));
|
|
||||||
#else
|
|
||||||
// set maximum smaller than screen-size
|
|
||||||
setMaximumSize((int)(0.85 * MachineInfo::instance()->i_max_screen_width()),
|
|
||||||
(int)(0.85 * MachineInfo::instance()->i_max_screen_height()));
|
|
||||||
#endif
|
|
||||||
resize(std::min(1400,maximumWidth()),
|
resize(std::min(1400,maximumWidth()),
|
||||||
std::min(1000,maximumHeight()));
|
std::min(1000,maximumHeight()));
|
||||||
|
|
||||||
|
|||||||
@@ -446,6 +446,22 @@ int32_t MachineInfo::i_max_screen_height() {
|
|||||||
return pc.screen.Max_height;
|
return pc.screen.Max_height;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief MachineInfo::i_max_available_width
|
||||||
|
@return max available width
|
||||||
|
*/
|
||||||
|
int32_t MachineInfo::i_max_available_width() {
|
||||||
|
return QGuiApplication::primaryScreen()->availableSize().width();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief MachineInfo::i_max_available_height
|
||||||
|
@return max available height
|
||||||
|
*/
|
||||||
|
int32_t MachineInfo::i_max_available_height() {
|
||||||
|
return QGuiApplication::primaryScreen()->availableSize().height();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief MachineInfo::compilation_info
|
@brief MachineInfo::compilation_info
|
||||||
@return compilation_info
|
@return compilation_info
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ class MachineInfo
|
|||||||
|
|
||||||
int32_t i_max_screen_width();
|
int32_t i_max_screen_width();
|
||||||
int32_t i_max_screen_height();
|
int32_t i_max_screen_height();
|
||||||
|
int32_t i_max_available_width();
|
||||||
|
int32_t i_max_available_height();
|
||||||
QString compilation_info();
|
QString compilation_info();
|
||||||
void send_info_to_debug();
|
void send_info_to_debug();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user