diff --git a/src/gui_impl/commands/help_gui_command.cpp b/src/gui_impl/commands/help_gui_command.cpp index f1cfb3ee..6464ad7e 100644 --- a/src/gui_impl/commands/help_gui_command.cpp +++ b/src/gui_impl/commands/help_gui_command.cpp @@ -8,7 +8,7 @@ #include "ui_about_dialog.h" #include - +#include namespace sigviewer { @@ -48,7 +48,12 @@ void HelpGuiCommand::showAboutDialog () ui.aboutLabel->setText(ui.aboutLabel->text().replace(QString("VERSION_MAJOR"), QString::number(VERSION_MAJOR)) .replace(QString("VERSION_MINOR"), QString::number(VERSION_MINOR)) .replace(QString("VERSION_BUILD"), QString::number(VERSION_BUILD))); - dialog_->setFixedSize(dialog_->minimumSizeHint()); + + QDesktopWidget dw; + int x=dw.width()*0.2; + int y=dw.height()*0.2; + dialog_->setFixedSize(x,y); + dialog_->show(); } diff --git a/src/gui_impl/dialogs/basic_header_info_dialog.cpp b/src/gui_impl/dialogs/basic_header_info_dialog.cpp index a781396d..7dd82622 100644 --- a/src/gui_impl/dialogs/basic_header_info_dialog.cpp +++ b/src/gui_impl/dialogs/basic_header_info_dialog.cpp @@ -17,6 +17,7 @@ #include #include #include +#include namespace sigviewer { @@ -42,8 +43,14 @@ BasicHeaderInfoDialog::BasicHeaderInfoDialog(QSharedPointer header, button_layout->addWidget(toggle_button_); button_layout->addWidget(close_button_); button_layout->addStretch(1); + + QDesktopWidget dw; + int x=dw.width()*0.45; + int y=dw.height()*0.8; + resize(x,y); + buildTree(); - resize(850, 850); + top_layout->activate(); readSettings(); connect(close_button_, SIGNAL(clicked()), this, SLOT(closeInfoDialog())); @@ -121,7 +128,7 @@ void BasicHeaderInfoDialog::buildTree() info_tree_widget_->setHeaderLabels(header_labels); info_tree_widget_->header()->setSectionResizeMode(QHeaderView::Interactive); - info_tree_widget_->setColumnWidth(0, width() * 0.65); + info_tree_widget_->setColumnWidth(0, width() * 0.5); info_tree_widget_->setAnimated(true); QTreeWidgetItem* root_item; diff --git a/src/gui_impl/dialogs/channel_selection_dialog.cpp b/src/gui_impl/dialogs/channel_selection_dialog.cpp index 143209c6..b52f14a9 100644 --- a/src/gui_impl/dialogs/channel_selection_dialog.cpp +++ b/src/gui_impl/dialogs/channel_selection_dialog.cpp @@ -8,7 +8,7 @@ #include "application_context_impl.h" #include - +#include namespace sigviewer { @@ -34,7 +34,13 @@ ChannelSelectionDialog::ChannelSelectionDialog(ChannelManager const& channel_man headerLabels << tr("Channel") << tr("Color"); ui_.treeWidget->setHeaderLabels(headerLabels); ui_.treeWidget->setColumnCount(2); - ui_.treeWidget->header()->resizeSection(0, width() * 0.6); + + QDesktopWidget dw; + int x=dw.width()*0.35; + int y=dw.height()*0.7; + resize(x,y); + + ui_.treeWidget->header()->resizeSection(0, width() * 0.4); ui_.treeWidget->setAnimated(true); if (ApplicationContextImpl::getInstance()->getCurrentFileContext()->getFileName().endsWith("XDF", Qt::CaseInsensitive)) diff --git a/src/gui_impl/dialogs/event_time_selection_dialog.cpp b/src/gui_impl/dialogs/event_time_selection_dialog.cpp index 59702049..c71db6f8 100644 --- a/src/gui_impl/dialogs/event_time_selection_dialog.cpp +++ b/src/gui_impl/dialogs/event_time_selection_dialog.cpp @@ -7,6 +7,7 @@ #include "file_handling/event_manager.h" #include +#include #include namespace sigviewer @@ -24,6 +25,11 @@ EventTimeSelectionDialog::EventTimeSelectionDialog (std::set const& s { ui_.setupUi (this); + QDesktopWidget dw; + int x=dw.width()*0.3; + int y=dw.height()*0.6; + resize(x,y); + foreach (ChannelID channel_id, shown_channels) { QListWidgetItem* item = new QListWidgetItem (channel_manager.getChannelLabel(channel_id), ui_.list_widget_); diff --git a/src/gui_impl/dialogs/event_types_selection_dialog.cpp b/src/gui_impl/dialogs/event_types_selection_dialog.cpp index d8982baf..c581a094 100644 --- a/src/gui_impl/dialogs/event_types_selection_dialog.cpp +++ b/src/gui_impl/dialogs/event_types_selection_dialog.cpp @@ -7,6 +7,7 @@ #include #include +#include #define max(a,b) ((a) > (b) ? (a) : (b)) @@ -39,6 +40,11 @@ void EventTypesSelectionDialog::buildTree (bool only_existing_events) ui_.tree_widget_->setHeaderLabels (header_labels); ui_.tree_widget_->setColumnWidth(ID_COLUMN_INDEX_, 0); + QDesktopWidget dw; + int x=dw.width()*0.35; + int y=dw.height()*0.7; + resize(x,y); + ui_.tree_widget_->header()->setSectionResizeMode (QHeaderView::Interactive); ui_.tree_widget_->header()->resizeSection (NAME_COLUMN_INDEX_, width() * 0.6); ui_.tree_widget_->header()->resizeSection (COLOR_COLUMN_INDEX_, width() * 0.18); diff --git a/src/gui_impl/dialogs/resampling_dialog.cpp b/src/gui_impl/dialogs/resampling_dialog.cpp index 66a8e4f1..20e12f6b 100644 --- a/src/gui_impl/dialogs/resampling_dialog.cpp +++ b/src/gui_impl/dialogs/resampling_dialog.cpp @@ -7,6 +7,8 @@ #include "ui_resampling_dialog.h" #include "file_handling_impl/xdf_reader.h" +#include + namespace sigviewer { ResamplingDialog::ResamplingDialog(QWidget *parent) : @@ -23,6 +25,12 @@ ResamplingDialog::ResamplingDialog(int nativeSrate, int highestSampleRate, QWidg ui->setupUi(this); this->setWindowTitle("Resampling"); + QDesktopWidget dw; + int x=dw.width()*0.35; + int y=dw.height()*0.6; + resize(x,y); + + if (XDFdata->sampleRateMap.size() > 1) { QString text = "This file contains signals of multiple sample rates.
" @@ -42,7 +50,7 @@ ResamplingDialog::ResamplingDialog(int nativeSrate, int highestSampleRate, QWidg ui->label->setText(text); } ui->treeWidget->setColumnCount(2); - ui->treeWidget->setColumnWidth(0, this->width()/2.15); + ui->treeWidget->setColumnWidth(0, this->width() * 0.48); ui->treeWidget->setAnimated(true); QStringList headers; headers << "Stream" << "Info"; diff --git a/src/gui_impl/dialogs/scale_channel_dialog.cpp b/src/gui_impl/dialogs/scale_channel_dialog.cpp index 123e79c4..2337b296 100644 --- a/src/gui_impl/dialogs/scale_channel_dialog.cpp +++ b/src/gui_impl/dialogs/scale_channel_dialog.cpp @@ -7,6 +7,7 @@ #include #include +#include #include @@ -25,6 +26,11 @@ ScaleChannelDialog::ScaleChannelDialog (ChannelID preselected_channel, { ui_.setupUi (this); + QDesktopWidget dw; + int x=dw.width()*0.22; + int y=dw.height()*0.22; + resize(x,y); + if (selected_channel_ == UNDEFINED_CHANNEL) setWindowTitle (tr("Scale All Channels")); else diff --git a/src/gui_impl/main_window.cpp b/src/gui_impl/main_window.cpp index 2770d0bd..6042bd55 100644 --- a/src/gui_impl/main_window.cpp +++ b/src/gui_impl/main_window.cpp @@ -13,6 +13,7 @@ #include #include #include +#include namespace sigviewer { @@ -29,8 +30,12 @@ MainWindow::MainWindow(QSharedPointer application_context) initMenus(application_context); setUnifiedTitleAndToolBarOnMac (true); + QDesktopWidget dw; + int x=dw.width()*0.7; + int y=dw.height()*0.7; + QSettings settings; - resize(settings.value("MainWindow/size", QSize(1200, 800)).toSize()); + resize(settings.value("MainWindow/size", QSize(x, y)).toSize()); setMinimumSize(900, 800); restoreGeometry(settings.value("geometry").toByteArray()); //restore geometry and window state (full screen etc.) restoreState(settings.value("windowState").toByteArray());