Skip to content

Commit

Permalink
Work on tutorial plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasKroes committed Dec 10, 2024
1 parent a222152 commit eade633
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 18 deletions.
4 changes: 2 additions & 2 deletions ManiVault/src/actions/OptionAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,8 @@ void OptionAction::ComboBoxWidget::paintEvent(QPaintEvent* paintEvent)

initStyleOption(&styleOptionComboBox);

if (_optionAction->getCurrentIndex() == -1)
styleOptionComboBox.currentIcon = Application::getIconFont("FontAwesome").getIcon("list");
//if (_optionAction->getCurrentIndex() == -1)
// styleOptionComboBox.currentIcon = Application::getIconFont("FontAwesome").getIcon("list");

painter->drawComplexControl(QStyle::CC_ComboBox, styleOptionComboBox);

Expand Down
13 changes: 2 additions & 11 deletions ManiVault/src/actions/OptionsAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,10 +277,7 @@ QVariantMap OptionsAction::toVariantMap() const

OptionsAction::ComboBoxWidget::ComboBoxWidget(QWidget* parent, OptionsAction* optionsAction, const std::int32_t& widgetFlags) :
QWidget(parent),
_optionsAction(optionsAction),
_layout(),
_comboBox(),
_completer()
_optionsAction(optionsAction)
{
auto comboBoxCheckableTableView = new CheckableTableView(this);

Expand Down Expand Up @@ -339,7 +336,7 @@ OptionsAction::ComboBoxWidget::ComboBoxWidget(QWidget* parent, OptionsAction* op
setLayout(&_layout);
}

void OptionsAction::ComboBoxWidget::updateCurrentText()
void OptionsAction::ComboBoxWidget::updateCurrentText() const
{
const auto selectedOptions = _optionsAction->getSelectedOptions();

Expand Down Expand Up @@ -544,9 +541,6 @@ void OptionsAction::TagsViewWidget::TagLabel::mousePressEvent(QMouseEvent* event
case Type::SelectInvert:
_optionsAction->selectInvert();
break;

default:
break;
}
}

Expand Down Expand Up @@ -589,9 +583,6 @@ void OptionsAction::TagsViewWidget::TagLabel::updateStyle()
case Type::SelectInvert:
setToolTip("Click to invert the options selection");
break;

default:
break;
}

setStyleSheet(QString("QLabel#Tag { \
Expand Down
6 changes: 3 additions & 3 deletions ManiVault/src/actions/OptionsAction.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,17 @@ class CORE_EXPORT OptionsAction : public WidgetAction
* @param target Object of which an event occurred
* @param event The event that took place
*/
bool eventFilter(QObject* target, QEvent* event);
bool eventFilter(QObject* target, QEvent* event) override;

/** Updates the line edit text to the joined selected strings */
void updateCurrentText();
void updateCurrentText() const;

protected:
OptionsAction* _optionsAction; /** Pointer to owning options action */
QHBoxLayout _layout; /** Horizontal layout */
QComboBox _comboBox; /** Combobox for selecting options */
QCompleter _completer; /** For inline searching */

friend class OptionsAction;
};

Expand Down
6 changes: 4 additions & 2 deletions ManiVault/src/plugins/TutorialPlugin/src/TutorialPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ TutorialPlugin::TutorialPlugin(const PluginFactory* factory) :

auto& tagsFilterAction = _learningCenterTutorialsFilterModel.getTagsFilterAction();

tagsFilterAction.setConfigurationFlag(WidgetAction::ConfigurationFlag::NoLabelInGroup, true);
tagsFilterAction.setConfigurationFlag(WidgetAction::ConfigurationFlag::ForceCollapsedInGroup, true);
tagsFilterAction.setConfigurationFlag(WidgetAction::ConfigurationFlag::NoLabelInGroup);
//tagsFilterAction.setConfigurationFlag(WidgetAction::ConfigurationFlag::ForceCollapsedInGroup, true);
tagsFilterAction.setDefaultWidgetFlags(OptionsAction::Tags | OptionsAction::Selection);
tagsFilterAction.setPopupSizeHint(QSize(640, 180));

_horizontalGroupAction.addAction(&_tutorialPickerAction);
_horizontalGroupAction.addAction(&tagsFilterAction, OptionsAction::Tags | OptionsAction::Selection);
Expand Down

0 comments on commit eade633

Please sign in to comment.