Commit 84948ded authored by Leander Schulten's avatar Leander Schulten
Browse files

UI changes

parent 526a5a10
......@@ -72,10 +72,18 @@ ModelView{
}
ComboBox{
model: easingModel
property bool open: false
currentIndex: editor.currentTimePoint.curveToNext
visible: editor.currentTimePoint.hasCurrent
onHighlightedIndexChanged: {editor.currentTimePoint.curveToNext = highlightedIndex
console.log("selected")
onDownChanged: {
open|=down;
}
onHighlighted: {
if(open)editor.currentTimePoint.curveToNext = index
}
onActivated: {
editor.currentTimePoint.curveToNext = index
open=false;
}
}
}
......
......@@ -161,6 +161,7 @@ ControlItem{
width: 200
text: itemData.name
visible: itemData.name.startsWith(search.text,Qt.CaseInsensitive)
height: itemData.name.startsWith(search.text,Qt.CaseInsensitive) ? implicitHeight : 0;
checked: use
onCheckedChanged: use = checked
......
......@@ -364,6 +364,21 @@ decltype(ChannelProgramm::timeline)::iterator ChannelProgrammEditor::getTimePoin
return best;
}
QEasingCurve * ChannelProgrammEditor::getCurveForPoint(int x){
auto time = mapFromVisualX(x);
if(!channelProgramm)
return nullptr;
if(channelProgramm->timeline.empty())
return nullptr;
auto lowerBound = channelProgramm->timeline.lower_bound(x);
if(lowerBound==channelProgramm->timeline.cend()){
return &channelProgramm->timeline.crbegin()->easingCurveToNextPoint;
}else{
return &lowerBound->easingCurveToNextPoint;
}
}
void ChannelProgrammEditor::mousePressEvent(QMouseEvent *event){
update();
......
......@@ -92,6 +92,7 @@ public:
bool haveCurrentTimePoint()const{return channelProgramm?(currentTimePoint!=channelProgramm->timeline.cend()):false;}
TimePoint * getCurrentTimePoint();
CurrentTimePointWrapper * getCurrentTimePointWrapper(){return &currentTimePointWrapper;}
Q_INVOKABLE QEasingCurve * getCurveForPoint(int x);
protected:
virtual void updatePolish()override;
virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry)override;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment