| 165 | } |
| 166 | |
| 167 | void MultiGradientSelector::mouseDoubleClickEvent(QMouseEvent * e) |
| 168 | { |
| 169 | for (UInt i = 0; i < (UInt)gradient_.size(); ++i) |
| 170 | { |
| 171 | Int pos = Int(float(gradient_.position(i)) / 100.0 * gradient_area_width_ + margin_ + 1); |
| 172 | if (e->x() >= pos - 3 && e->x() <= pos + 4 && e->y() >= height() - margin_ - lever_area_height_ + 8 && e->y() <= height() - margin_ - lever_area_height_ + 15) |
| 173 | { |
| 174 | gradient_.insert(gradient_.position(i), QColorDialog::getColor(gradient_.color(i), this)); |
| 175 | if (Int(gradient_.position(i)) == selected_) |
| 176 | { |
| 177 | selected_color_ = gradient_.color(i); |
| 178 | } |
| 179 | return; |
| 180 | } |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | void MultiGradientSelector::keyPressEvent(QKeyEvent * e) |
| 185 | { |