mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-09-09 01:56:00 -05:00
Add MacroSegmentList to allow deselecting items
Previously once a macro segement was selected you could only deselect it by clicking on different macro segment, thus never allowing the user to deselect all macro segments
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#else
|
||||
#include "ui_advanced-scene-switcher.h"
|
||||
#endif
|
||||
#include "macro-segment-list.hpp"
|
||||
#include "switcher-data-structs.hpp"
|
||||
#include "platform-funcs.hpp"
|
||||
|
||||
@@ -282,6 +283,9 @@ public slots:
|
||||
void on_close_clicked();
|
||||
|
||||
private:
|
||||
MacroSegmentList *conditionsList = nullptr;
|
||||
MacroSegmentList *actionsList = nullptr;
|
||||
|
||||
int currentConditionIdx = -1;
|
||||
int currentActionIdx = -1;
|
||||
};
|
||||
|
||||
25
src/headers/macro-segment-list.hpp
Normal file
25
src/headers/macro-segment-list.hpp
Normal file
@@ -0,0 +1,25 @@
|
||||
#pragma once
|
||||
#include <QWidget>
|
||||
#include <QScrollArea>
|
||||
#include <QVBoxLayout>
|
||||
#include <QLabel>
|
||||
|
||||
class MacroSegmentList : public QScrollArea {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
MacroSegmentList(QWidget *parent = nullptr);
|
||||
void SetHelpMsg(const QString &msg);
|
||||
void SetHelpMsgVisible(bool visible);
|
||||
QVBoxLayout *ContentLayout() { return _contentLayout; }
|
||||
|
||||
signals:
|
||||
void SelectionChagned(int idx);
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent *event);
|
||||
|
||||
private:
|
||||
QVBoxLayout *_contentLayout;
|
||||
QLabel *_helpMsg;
|
||||
};
|
||||
Reference in New Issue
Block a user