mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-06-25 02:04:12 +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
|
// liste des pages
|
||||||
pages_list = new QListWidget();
|
pages_list = new QListWidget();
|
||||||
pages_list -> setViewMode(QListView::IconMode);
|
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));
|
pages_list -> setIconSize(QSize(64, 64));
|
||||||
} else {
|
} else {
|
||||||
pages_list -> setIconSize(QSize(128, 128));
|
pages_list -> setIconSize(QSize(128, 128));
|
||||||
@@ -69,7 +69,7 @@ ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent) {
|
|||||||
|
|
||||||
// Add a layout for QDialog
|
// Add a layout for QDialog
|
||||||
QVBoxLayout *dialog_layout = new QVBoxLayout(this);
|
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);
|
dialog_layout -> addWidget(buttons);
|
||||||
setLayout(dialog_layout);
|
setLayout(dialog_layout);
|
||||||
|
|
||||||
@@ -79,9 +79,11 @@ 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)));
|
||||||
|
|
||||||
setMaximumSize(MachineInfo::instance()->i_max_screen_width(),
|
// set maximum a bit smaller than available size = (screen-size - Task-Bar):
|
||||||
MachineInfo::instance()->i_max_screen_height());
|
setMaximumSize((int)(0.94 * MachineInfo::instance()->i_max_available_width()),
|
||||||
resize(1400,1000);
|
(int)(0.94 * MachineInfo::instance()->i_max_available_height()));
|
||||||
|
resize(std::min(1400,maximumWidth()),
|
||||||
|
std::min(1000,maximumHeight()));
|
||||||
|
|
||||||
#ifdef Q_OS_MACOS
|
#ifdef Q_OS_MACOS
|
||||||
if (parent) {
|
if (parent) {
|
||||||
|
|||||||
@@ -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();
|
||||||
|
|
||||||
|
|||||||
+6
-1
@@ -1261,6 +1261,7 @@ QFont QETApp::diagramTextsFont(qreal size)
|
|||||||
QFont diagram_texts_font = QFont(diagram_texts_family);
|
QFont diagram_texts_font = QFont(diagram_texts_family);
|
||||||
diagram_texts_font.setPointSizeF(diagram_texts_size);
|
diagram_texts_font.setPointSizeF(diagram_texts_size);
|
||||||
diagram_texts_font.setWeight(diagram_texts_item_weight);
|
diagram_texts_font.setWeight(diagram_texts_item_weight);
|
||||||
|
diagram_texts_font.setStyleHint(QFont::SansSerif);
|
||||||
diagram_texts_font.setStyleName(diagram_texts_item_style);
|
diagram_texts_font.setStyleName(diagram_texts_item_style);
|
||||||
if (diagram_texts_size <= 4.0) {
|
if (diagram_texts_size <= 4.0) {
|
||||||
diagram_texts_font.setWeight(QFont::Light);
|
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);
|
QFont diagram_texts_item_font = QFont(diagram_texts_item_family);
|
||||||
diagram_texts_item_font.setPointSizeF(diagram_texts_item_size);
|
diagram_texts_item_font.setPointSizeF(diagram_texts_item_size);
|
||||||
diagram_texts_item_font.setWeight(diagram_texts_item_weight);
|
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);
|
diagram_texts_item_font.setStyleName(diagram_texts_item_style);
|
||||||
if (diagram_texts_item_size <= 4.0) {
|
if (diagram_texts_item_size <= 4.0) {
|
||||||
diagram_texts_item_font.setWeight(QFont::Light);
|
diagram_texts_item_font.setWeight(QFont::Light);
|
||||||
@@ -1934,7 +1936,10 @@ void QETApp::configureQET()
|
|||||||
// associe le dialogue a un eventuel widget parent
|
// associe le dialogue a un eventuel widget parent
|
||||||
if (parent_widget) {
|
if (parent_widget) {
|
||||||
cd.setParent(parent_widget, cd.windowFlags());
|
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
|
// display the dialog then avoid linking it to any parent widget
|
||||||
|
|||||||
Reference in New Issue
Block a user