mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-06-09 20:23:13 +02:00
Compare commits
7 Commits
ca8f4650a3
...
0663aa55e8
| Author | SHA1 | Date | |
|---|---|---|---|
| 0663aa55e8 | |||
| 67185f173e | |||
| 2c5e5c6b78 | |||
| 689b101c55 | |||
| 3aa760e3cd | |||
| 82f3167d40 | |||
| 5b2c861d02 |
@@ -35,7 +35,7 @@ ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent) {
|
||||
// liste des pages
|
||||
pages_list = new QListWidget();
|
||||
pages_list -> setViewMode(QListView::IconMode);
|
||||
if(MachineInfo::instance()->i_max_screen_height()<1000){
|
||||
if(MachineInfo::instance()->i_max_screen_height() <= 1080){
|
||||
pages_list -> setIconSize(QSize(64, 64));
|
||||
} else {
|
||||
pages_list -> setIconSize(QSize(128, 128));
|
||||
@@ -69,7 +69,7 @@ ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent) {
|
||||
|
||||
// Add a layout for QDialog
|
||||
QVBoxLayout *dialog_layout = new QVBoxLayout(this);
|
||||
dialog_layout->addWidget(scroll); // add scroll to the QDialog's layout
|
||||
dialog_layout -> addWidget(scroll); // add scroll to the QDialog's layout
|
||||
dialog_layout -> addWidget(buttons);
|
||||
setLayout(dialog_layout);
|
||||
|
||||
@@ -79,9 +79,11 @@ ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent) {
|
||||
connect(pages_list, SIGNAL(currentRowChanged(int)),
|
||||
pages_widget, SLOT(setCurrentIndex(int)));
|
||||
|
||||
setMaximumSize(MachineInfo::instance()->i_max_screen_width(),
|
||||
MachineInfo::instance()->i_max_screen_height());
|
||||
resize(1400,1000);
|
||||
// set maximum a bit smaller than available size = (screen-size - Task-Bar):
|
||||
setMaximumSize((int)(0.94 * MachineInfo::instance()->i_max_available_width()),
|
||||
(int)(0.94 * MachineInfo::instance()->i_max_available_height()));
|
||||
resize(std::min(1400,maximumWidth()),
|
||||
std::min(1000,maximumHeight()));
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
if (parent) {
|
||||
|
||||
@@ -446,6 +446,22 @@ int32_t MachineInfo::i_max_screen_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
|
||||
@return compilation_info
|
||||
|
||||
@@ -57,6 +57,8 @@ class MachineInfo
|
||||
|
||||
int32_t i_max_screen_width();
|
||||
int32_t i_max_screen_height();
|
||||
int32_t i_max_available_width();
|
||||
int32_t i_max_available_height();
|
||||
QString compilation_info();
|
||||
void send_info_to_debug();
|
||||
|
||||
|
||||
+6
-1
@@ -1261,6 +1261,7 @@ QFont QETApp::diagramTextsFont(qreal size)
|
||||
QFont diagram_texts_font = QFont(diagram_texts_family);
|
||||
diagram_texts_font.setPointSizeF(diagram_texts_size);
|
||||
diagram_texts_font.setWeight(diagram_texts_item_weight);
|
||||
diagram_texts_font.setStyleHint(QFont::SansSerif);
|
||||
diagram_texts_font.setStyleName(diagram_texts_item_style);
|
||||
if (diagram_texts_size <= 4.0) {
|
||||
diagram_texts_font.setWeight(QFont::Light);
|
||||
@@ -1294,6 +1295,7 @@ QFont QETApp::diagramTextsItemFont(qreal size)
|
||||
QFont diagram_texts_item_font = QFont(diagram_texts_item_family);
|
||||
diagram_texts_item_font.setPointSizeF(diagram_texts_item_size);
|
||||
diagram_texts_item_font.setWeight(diagram_texts_item_weight);
|
||||
diagram_texts_item_font.setStyleHint(QFont::SansSerif);
|
||||
diagram_texts_item_font.setStyleName(diagram_texts_item_style);
|
||||
if (diagram_texts_item_size <= 4.0) {
|
||||
diagram_texts_item_font.setWeight(QFont::Light);
|
||||
@@ -1934,7 +1936,10 @@ void QETApp::configureQET()
|
||||
// associe le dialogue a un eventuel widget parent
|
||||
if (parent_widget) {
|
||||
cd.setParent(parent_widget, cd.windowFlags());
|
||||
cd.setMaximumSize(parent_widget->size());
|
||||
cd.setMaximumWidth(std::min(parent_widget->width(),
|
||||
(int)(0.94 * MachineInfo::instance()->i_max_available_width())));
|
||||
cd.setMaximumHeight(std::min(parent_widget->height(),
|
||||
(int)(0.94 * MachineInfo::instance()->i_max_available_height())));
|
||||
}
|
||||
|
||||
// display the dialog then avoid linking it to any parent widget
|
||||
|
||||
Reference in New Issue
Block a user