From 83299346758f89e54b8a9674146d85b84603f530 Mon Sep 17 00:00:00 2001 From: Gene Payne Date: Sat, 26 Sep 2020 10:28:15 -0600 Subject: [PATCH] Changed gui element focus and tab behavior --- apps/OpenSpace/ext/launcher/src/keybindings.cpp | 1 + apps/OpenSpace/ext/launcher/src/meta.cpp | 1 + apps/OpenSpace/ext/launcher/src/osmodules.cpp | 2 ++ apps/OpenSpace/ext/launcher/src/ostime.cpp | 6 ++++++ 4 files changed, 10 insertions(+) diff --git a/apps/OpenSpace/ext/launcher/src/keybindings.cpp b/apps/OpenSpace/ext/launcher/src/keybindings.cpp index 19c5363702..31b631ae19 100644 --- a/apps/OpenSpace/ext/launcher/src/keybindings.cpp +++ b/apps/OpenSpace/ext/launcher/src/keybindings.cpp @@ -43,6 +43,7 @@ keybindings::keybindings(openspace::Profile* imported, QWidget *parent) connect(ui->button_remove, SIGNAL(clicked()), this, SLOT(listItemRemove())); connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(parseSelections())); + ui->text_script->setTabChangesFocus(true); transitionFromEditMode(); } diff --git a/apps/OpenSpace/ext/launcher/src/meta.cpp b/apps/OpenSpace/ext/launcher/src/meta.cpp index 1ff1d81ee8..4ffd3aab65 100644 --- a/apps/OpenSpace/ext/launcher/src/meta.cpp +++ b/apps/OpenSpace/ext/launcher/src/meta.cpp @@ -28,6 +28,7 @@ meta::meta(openspace::Profile* imported, QWidget *parent) ui->line_license->setText(""); } + ui->text_description->setTabChangesFocus(true); connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(save())); } diff --git a/apps/OpenSpace/ext/launcher/src/osmodules.cpp b/apps/OpenSpace/ext/launcher/src/osmodules.cpp index eda755a206..d08757912c 100644 --- a/apps/OpenSpace/ext/launcher/src/osmodules.cpp +++ b/apps/OpenSpace/ext/launcher/src/osmodules.cpp @@ -23,6 +23,8 @@ osmodules::osmodules(openspace::Profile* imported, QWidget *parent) connect(ui->button_remove, SIGNAL(clicked()), this, SLOT(listItemRemove())); connect(ui->buttonBox, SIGNAL(accepted()), this, SLOT(parseSelections())); + ui->line_loaded->setTabChangesFocus(true); + ui->line_notLoaded->setTabChangesFocus(true); transitionFromEditMode(); } diff --git a/apps/OpenSpace/ext/launcher/src/ostime.cpp b/apps/OpenSpace/ext/launcher/src/ostime.cpp index 34e59a8511..a024932b00 100644 --- a/apps/OpenSpace/ext/launcher/src/ostime.cpp +++ b/apps/OpenSpace/ext/launcher/src/ostime.cpp @@ -19,6 +19,10 @@ ostime::ostime(openspace::Profile* imported, QWidget *parent) if (_data.time == "") { _data.time = "now"; } + ui->line_relative->setSelection(0, ui->line_relative->text().length()); + } + else { + ui->dateEdit->setSelectedSection(QDateTimeEdit::YearSection); } } else { @@ -47,6 +51,7 @@ void ostime::enableAccordingToType(int idx) { else { ui->line_relative->setText(QString(_data.time.c_str())); } + ui->line_relative->setFocus(Qt::OtherFocusReason); } else { ui->label_relative->setText("Relative Time:"); @@ -56,6 +61,7 @@ void ostime::enableAccordingToType(int idx) { ui->dateEdit->setDate(QDate::fromString(importDate, Qt::DateFormat::ISODate)); ui->timeEdit->setTime(QTime::fromString(importTime)); ui->line_relative->setText(""); + ui->dateEdit->setFocus(Qt::OtherFocusReason); } }