diff --git a/assets/themes/darkorange/darkorange.qss b/assets/themes/darkorange/darkorange.qss index 8e5dbcb..88fcead 100644 --- a/assets/themes/darkorange/darkorange.qss +++ b/assets/themes/darkorange/darkorange.qss @@ -499,3 +499,11 @@ QHeaderView::section { background-color: #222; border: 0px; } + +QTableWidget QTableCornerButton::section { + background-color: #323232; +} + +QTableWidget { + gridline-color: #fffff8; +} diff --git a/src/gui/interface_window.cpp b/src/gui/interface_window.cpp index aab5af7..8a9cb0b 100644 --- a/src/gui/interface_window.cpp +++ b/src/gui/interface_window.cpp @@ -296,8 +296,9 @@ void InterfaceWindow::push_structure() { // increment the structure stack pointer this->structure_stack_pointer++; - this->anaglyph_widget->set_structure_conservative(this->structure_stack.back()); - qDebug() << this->structure_stack.size() << ": " << (size_t)this->structure_stack.back().get(); + this->anaglyph_widget->set_structure_conservative(this->structure_stack[this->structure_stack_pointer]); + this->structure_info_widget->set_structure(this->structure_stack[this->structure_stack_pointer]); + qDebug() << "Stack size: " << this->structure_stack.size() << ": " << (size_t)this->structure_stack.back().get(); } /** @@ -309,6 +310,7 @@ void InterfaceWindow::increment_structure_stack_pointer() { qDebug() << "Incrementing stack pointer"; qDebug() << "New pointer value: " << this->structure_stack_pointer; this->anaglyph_widget->set_structure_conservative(this->structure_stack[this->structure_stack_pointer]); + this->structure_info_widget->set_structure(this->structure_stack[this->structure_stack_pointer]); } else { qDebug() << "Ignoring stack pointer request; structure stack exchausted."; } @@ -323,6 +325,7 @@ void InterfaceWindow::decrement_structure_stack_pointer() { qDebug() << "Decrementing stack pointer"; qDebug() << "New pointer value: " << this->structure_stack_pointer; this->anaglyph_widget->set_structure_conservative(this->structure_stack[this->structure_stack_pointer]); + this->structure_info_widget->set_structure(this->structure_stack[this->structure_stack_pointer]); } else { qDebug() << "Ignoring stack pointer request; structure stack exchausted."; } diff --git a/src/gui/interface_window.h b/src/gui/interface_window.h index 26d1e44..d7da530 100644 --- a/src/gui/interface_window.h +++ b/src/gui/interface_window.h @@ -205,6 +205,9 @@ private slots: void decrement_structure_stack_pointer(); signals: + /** + * @brief A new file is loaded into the window + */ void new_file_loaded(); /** diff --git a/src/gui/structure_info_basic_tab.cpp b/src/gui/structure_info_basic_tab.cpp index 1f0340e..7fccebd 100644 --- a/src/gui/structure_info_basic_tab.cpp +++ b/src/gui/structure_info_basic_tab.cpp @@ -57,6 +57,7 @@ StructureInfoBasicTab::StructureInfoBasicTab(QWidget* parent) : StructureInfoTab * @brief Update data in tab based on current structure */ void StructureInfoBasicTab::update_data() { + qDebug() << "Updating structure info: " << (size_t)this->structure.get(); this->get_label("number_of_atoms")->setText(QString::number(this->structure->get_nr_atoms())); this->get_label("type_of_elements")->setText(this->structure->get_elements_string().c_str()); @@ -95,7 +96,6 @@ void StructureInfoBasicTab::reset() { } void StructureInfoBasicTab::update_table() { - // qDebug() << "Update table called"; this->table_atomic_data->setRowCount(this->structure->get_nr_atoms()); for(unsigned int i=0; istructure->get_nr_atoms(); i++) { diff --git a/src/gui/user_action.cpp b/src/gui/user_action.cpp index 07118a7..2d38fcd 100644 --- a/src/gui/user_action.cpp +++ b/src/gui/user_action.cpp @@ -58,12 +58,11 @@ void UserAction::handle_action_movement() { emit request_update(); } else { this->movement_action = MovementAction::MOVEMENT_NONE; - emit(signal_push_structure()); this->structure->commit_transposition(this->scene->transposition); this->scene->transposition.setToIdentity(); emit transmit_message(""); + emit(signal_push_structure()); emit request_update(); - emit signal_update_structure_info(); } } @@ -82,12 +81,11 @@ void UserAction::handle_action_rotation() { emit request_update(); } else { this->rotation_action = RotationAction::ROTATION_NONE; - emit(signal_push_structure()); this->structure->commit_transposition(this->scene->transposition); this->scene->transposition.setToIdentity(); emit transmit_message(""); + emit(signal_push_structure()); emit request_update(); - emit signal_update_structure_info(); } } @@ -197,12 +195,10 @@ void UserAction::handle_key(int key, Qt::KeyboardModifiers modifiers) { case Qt::Key_Z: // undo action emit signal_decrement_structure_stack_pointer(); emit request_update(); - emit signal_update_structure_info(); break; case Qt::Key_Y: // redo action emit signal_increment_structure_stack_pointer(); emit request_update(); - emit signal_update_structure_info(); break; case Qt::Key_I: // invert selection this->structure->invert_selection(); @@ -211,10 +207,9 @@ void UserAction::handle_key(int key, Qt::KeyboardModifiers modifiers) { break; case Qt::Key_F: // set frozen qDebug() << "Freezing atoms"; - emit(signal_push_structure()); this->structure->set_frozen(); + emit(signal_push_structure()); emit request_update(); - emit signal_update_structure_info(); break; } } @@ -224,10 +219,9 @@ void UserAction::handle_key(int key, Qt::KeyboardModifiers modifiers) { switch(key) { case Qt::Key_F: // unset frozen qDebug() << "Unfreezing atoms"; - emit(signal_push_structure()); this->structure->set_unfrozen(); + emit(signal_push_structure()); emit request_update(); - emit signal_update_structure_info(); break; } } @@ -236,17 +230,15 @@ void UserAction::handle_key(int key, Qt::KeyboardModifiers modifiers) { if(key == Qt::Key_A && modifiers == Qt::ShiftModifier) { this->add_fragment(); emit request_update(); - emit signal_update_structure_info(); return; } // delete selected atoms in primary buffer if(key == Qt::Key_Delete && this->structure->get_nr_atoms_primary_buffer() != 0) { - emit(signal_push_structure()); this->structure->delete_atoms(); this->structure->clear_selection(); + emit(signal_push_structure()); emit request_update(); - emit signal_update_structure_info(); return; } } @@ -377,8 +369,8 @@ void UserAction::add_fragment() { // check if a fragment is actually set if(this->fragment) { - emit(signal_push_structure()); this->structure_operator.add_fragment(this->structure.get(), *this->fragment.get(), distance); + emit(signal_push_structure()); } else { throw std::runtime_error("No fragment is set"); } diff --git a/src/gui/user_action.h b/src/gui/user_action.h index 1be6c4b..275bb0d 100644 --- a/src/gui/user_action.h +++ b/src/gui/user_action.h @@ -174,12 +174,11 @@ public slots: */ void signal_message_statusbar(const QString& text); - void signal_selection_message(const QString& text); - /** - * @brief Update structure information + * @brief send atomic selection message + * @param text to send */ - void signal_update_structure_info(); + void signal_selection_message(const QString& text); /** * @brief Provides a signal that the old structure should be