24 bool changed =
m_total != total;
33 float newpos = position /
m_total;
35 if (newpos < 0.0F || newpos > 1.0F)
47 if (
m_total >= end && end >= start && start >= 0.0)
74 QRect keeparea = QRect();
75 QRect cutarea = QRect();
111 if (position && keeparea.isValid())
113 int offset = position->
GetArea().width() / 2;
115 int newy = position->
GetArea().top();
132 auto *leftshape =
dynamic_cast<MythUIShape *
>(cuttoleft);
133 auto *leftimage =
dynamic_cast<MythUIImage *
>(cuttoleft);
134 auto *rightshape =
dynamic_cast<MythUIShape *
>(cuttoright);
135 auto *rightimage =
dynamic_cast<MythUIImage *
>(cuttoright);
137 QListIterator<QPair<float, float> > regions(
m_regions);
139 while (regions.hasNext() && cutarea.isValid())
141 QPair<float, float> region = regions.next();
142 int left = lroundf(region.first * cutarea.width());
143 int right = lroundf(region.second * cutarea.width());
150 AddBar(barshape, barimage, QRect(left, cutarea.top(), right - left,
154 if (cuttoleft && (region.second < 1.0F))
155 AddMark(leftshape, leftimage, right,
true);
157 if (cuttoright && (region.first > 0.0F))
158 AddMark(rightshape, rightimage, left,
false);
165 leftshape =
dynamic_cast<MythUIShape *
>(keeptoleft);
166 leftimage =
dynamic_cast<MythUIImage *
>(keeptoleft);
167 rightshape =
dynamic_cast<MythUIShape *
>(keeptoright);
168 rightimage =
dynamic_cast<MythUIImage *
>(keeptoright);
170 QListIterator<QPair<float, float> > regions2(
m_invregions);
172 while (regions2.hasNext() && keeparea.isValid())
174 QPair<float, float> region = regions2.next();
175 int left = lroundf(region.first * keeparea.width());
176 int right = lroundf(region.second * keeparea.width());
183 AddBar(barshape, barimage, QRect(left, keeparea.top(), right - left,
187 if (keeptoleft && (region.second < 1.0F))
188 AddMark(leftshape, leftimage, right,
true);
190 if (keeptoright && (region.first > 0.0F))
191 AddMark(rightshape, rightimage, left,
false);
209 shape->
SetCropRect(area.left(), area.top(), area.width(), area.height());
212 image->SetCropRect(area.left(), area.top(), area.width(), area.height());
219 int start,
bool left)
226 start -= add->
GetArea().width();
234 QString name = QString(
"editbarimage_%1").arg(
m_images.size());
242 newshape->CopyFrom(shape);
243 newshape->SetVisible(
true);
254 newimage->CopyFrom(image);
255 newimage->SetVisible(
true);
270 QListIterator<QPair<float, float> > regions(
m_regions);
272 while (regions.hasNext())
274 QPair<float, float> region = regions.next();
278 if (region.first > 0.0F)
281 start = region.second;
287 start = region.second;
314 QListIterator<QPair<float, float> > it(
m_regions);
317 editbar->m_regions.append(it.next());
328 editbar->CopyFrom(
this);