Changeset View
Changeset View
Standalone View
Standalone View
plugins/dockers/animation/timeline_frames_item_delegate.cpp
Show First 20 Lines • Show All 102 Lines • ▼ Show 20 Line(s) | 75 | { | |||
---|---|---|---|---|---|
103 | painter->setPen(oldPen); | 103 | painter->setPen(oldPen); | ||
104 | } | 104 | } | ||
105 | 105 | | |||
106 | void TimelineFramesItemDelegate::drawBackground(QPainter *painter, const QModelIndex &index, const QRect &rc) const | 106 | void TimelineFramesItemDelegate::drawBackground(QPainter *painter, const QModelIndex &index, const QRect &rc) const | ||
107 | { | 107 | { | ||
108 | bool active = index.data(TimelineFramesModel::ActiveLayerRole).toBool(); | 108 | bool active = index.data(TimelineFramesModel::ActiveLayerRole).toBool(); | ||
109 | bool present = index.data(TimelineFramesModel::FrameExistsRole).toBool(); | 109 | bool present = index.data(TimelineFramesModel::FrameExistsRole).toBool(); | ||
110 | bool editable = index.data(TimelineFramesModel::FrameEditableRole).toBool(); | 110 | bool editable = index.data(TimelineFramesModel::FrameEditableRole).toBool(); | ||
111 | QVariant colorLabel = index.data(TimelineFramesModel::ColorLabel); | 111 | QVariant colorLabel = index.data(TimelineFramesModel::FrameColorLabelIndexRole); | ||
112 | 112 | | |||
113 | QColor color = colorLabel.isValid() ? labelColors.at(colorLabel.toInt()) : | 113 | QColor color = colorLabel.isValid() ? labelColors.at(colorLabel.toInt()) : | ||
114 | TimelineColorScheme::instance()->frameColor(present, active); | 114 | TimelineColorScheme::instance()->frameColor(present, active); | ||
115 | 115 | | |||
116 | if (!editable && color.alpha() > 0) { | 116 | if (!editable && color.alpha() > 0) { | ||
117 | const int l = color.lightness(); | 117 | const int l = color.lightness(); | ||
118 | color = QColor(l, l, l); | 118 | color = QColor(l, l, l); | ||
119 | } | 119 | } | ||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |