Example #1
0
void FindBar::notifyMatch(bool match)
{
    QPalette p = m_lineEdit->palette();
    KColorScheme colorScheme(p.currentColorGroup());

    if (m_lineEdit->text().isEmpty())
    {
        p.setColor(QPalette::Base, colorScheme.background(KColorScheme::NormalBackground).color());
    }
    else
    {
        if (match)
        {
            p.setColor(QPalette::Base, colorScheme.background(KColorScheme::PositiveBackground).color());
        }
        else
        {
            p.setColor(QPalette::Base, colorScheme.background(KColorScheme::NegativeBackground).color()); // previous were 247, 230, 230
        }
    }
    m_lineEdit->setPalette(p);
}
KeyframeHelper::KeyframeHelper(QWidget *parent) :
    QWidget(parent)
  , frameLength(1)
  , m_geom(NULL)
  , m_position(0)
  , m_scale(0)
  , m_movingKeyframe(false)
  , m_movingItem()
  , m_hoverKeyframe(-1)
  , m_seekPosition(SEEK_INACTIVE)
{
    setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
    setMouseTracking(true);
    QPalette p = palette();
    m_size = QFontInfo(font()).pixelSize() * 1.8;
    m_lineHeight = m_size / 2;
    setMinimumHeight(m_size);
    setMaximumHeight(m_size);
    KColorScheme scheme(p.currentColorGroup(), KColorScheme::Window, KSharedConfig::openConfig(KdenliveSettings::colortheme()));
    m_selected = scheme.decoration(KColorScheme::HoverColor).color();
    m_keyframe = scheme.foreground(KColorScheme::LinkText).color();
}
Example #3
0
AnimKeyframeRuler::AnimKeyframeRuler(int min, int max, QWidget *parent) :
    QWidget(parent)
  , frameLength(max - min)
  , m_position(0)
  , m_scale(0)
  , m_movingKeyframe(false)
  , m_movingKeyframePos(-1)
  , m_movingKeyframeType(mlt_keyframe_linear)
  , m_hoverKeyframe(-1)
  , m_selectedKeyframe(-1)
  , m_seekPosition(SEEK_INACTIVE)
  , m_attachedToEnd(-2)
{
    setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
    setMouseTracking(true);
    QPalette p = palette();
    m_size = QFontInfo(font()).pixelSize() * 1.8;
    m_lineHeight = m_size / 2;
    setMinimumHeight(m_size);
    setMaximumHeight(m_size);
    KColorScheme scheme(p.currentColorGroup(), KColorScheme::Window, KSharedConfig::openConfig(KdenliveSettings::colortheme()));
    m_selected = palette().highlight().color();
    m_keyframe = scheme.foreground(KColorScheme::LinkText).color();
}
Example #4
0
QBrush StatefulBrush::brush(const QPalette& pal) const {
      return brush(pal.currentColorGroup());
      }
ClipStabilize::ClipStabilize(const QStringList &urls, const QString &filterName,QWidget * parent) :
    QDialog(parent),
    m_filtername(filterName),
    m_urls(urls),
    vbox(NULL)
{
    setFont(QFontDatabase::systemFont(QFontDatabase::SmallestReadableFont));
    setupUi(this);
    setWindowTitle(i18n("Stabilize Clip"));
    auto_add->setText(i18np("Add clip to project", "Add clips to project", urls.count()));
    auto_add->setChecked(KdenliveSettings::add_new_clip());

    QPalette p = palette();
    KColorScheme scheme(p.currentColorGroup(), KColorScheme::View, KSharedConfig::openConfig(KdenliveSettings::colortheme()));
    QColor dark_bg = scheme.shade(KColorScheme::DarkShade);
    QColor selected_bg = scheme.decoration(KColorScheme::FocusColor).color();
    QColor hover_bg = scheme.decoration(KColorScheme::HoverColor).color();
    QColor light_bg = scheme.shade(KColorScheme::LightShade);

    QString stylesheet(QString("QProgressBar:horizontal {border: 1px solid %1;border-radius:0px;border-top-left-radius: 4px;border-bottom-left-radius: 4px;border-right: 0px;background:%4;padding: 0px;text-align:left center}\
                               QProgressBar:horizontal#dragOnly {background: %1} QProgressBar:horizontal:hover#dragOnly {background: %3} QProgressBar:horizontal:hover {border: 1px solid %3;border-right: 0px;}\
                               QProgressBar::chunk:horizontal {background: %1;} QProgressBar::chunk:horizontal:hover {background: %3;}\
                               QProgressBar:horizontal[inTimeline=\"true\"] { border: 1px solid %2;border-right: 0px;background: %4;padding: 0px;text-align:left center } QProgressBar::chunk:horizontal[inTimeline=\"true\"] {background: %2;}\
                               QAbstractSpinBox#dragBox {border: 1px solid %1;border-top-right-radius: 4px;border-bottom-right-radius: 4px;padding-right:0px;} QAbstractSpinBox::down-button#dragBox {width:0px;padding:0px;}\
                               QAbstractSpinBox::up-button#dragBox {width:0px;padding:0px;} QAbstractSpinBox[inTimeline=\"true\"]#dragBox { border: 1px solid %2;} QAbstractSpinBox:hover#dragBox {border: 1px solid %3;} ")
                               .arg(dark_bg.name()).arg(selected_bg.name()).arg(hover_bg.name()).arg(light_bg.name()));
                               setStyleSheet(stylesheet);

                               if (m_urls.count() == 1) {
                               QString newFile = m_urls.first();
                               newFile.append(".mlt");
                               QUrl dest(newFile);
                               dest_url->setMode(KFile::File);
                               dest_url->setUrl(QUrl(newFile));
} else {
                               label_dest->setText(i18n("Destination folder"));
                               dest_url->setMode(KFile::Directory | KFile::ExistingOnly);
                               dest_url->setUrl(QUrl(m_urls.first()).adjusted(QUrl::RemoveFilename));
}

                               if (m_filtername=="vidstab"){
                               // Some default params have to be set:
                               m_fixedParams.insert("algo", "1");
			       m_fixedParams.insert("relative", "1");
                               QStringList ls;
                               ls << "accuracy,type,int,value,8,min,1,max,10,tooltip,Accuracy of Shakiness detection";
                               ls << "shakiness,type,int,value,4,min,1,max,10,tooltip,How shaky is the Video";
                               ls << "stepsize,type,int,value,6,min,0,max,100,tooltip,Stepsize of Detection process minimum around";
                               //ls << "algo,type,bool,value,1,min,0,max,1,tooltip,0 = Bruteforce 1 = small measurement fields";
                               ls << "mincontrast,type,double,value,0.3,min,0,max,1,factor,1,decimals,2,tooltip,Below this Contrast Field is discarded";
                               //ls << "show,type,int,value,0,min,0,max,2,tooltip,0 = draw nothing. 1 or 2 show fields and transforms";
                               ls << "smoothing,type,int,value,10,min,0,max,100,tooltip,number of frames for lowpass filtering";
                               ls << "maxshift,type,int,value,-1,min,-1,max,1000,tooltip,max number of pixels to shift";
                               ls << "maxangle,type,double,value,-1,min,-1,max,3.14,decimals,2,tooltip,max angle to rotate (in rad)";
                               ls << "crop,type,bool,value,0,min,0,max,1,tooltip,0 = keep border  1 = black background";
                               //ls << "invert,type,bool,value,0,min,0,max,1,tooltip,invert transform";
                               //ls << "relative,type,bool,value,1,min,0,max,1,tooltip,0 = absolute transform  1= relative";
                               ls << "zoom,type,int,value,0,min,-500,max,500,tooltip,additional zoom during transform";
                               ls << "optzoom,type,bool,value,1,min,0,max,1,tooltip,use optimal zoom (calulated from transforms)";
                               ls << "sharpen,type,double,value,0.8,min,0,max,1,decimals,1,tooltip,sharpen transformed image";
                               fillParameters(ls);

}

                               connect(buttonBox->button(QDialogButtonBox::Ok), &QPushButton::clicked, this, &ClipStabilize::slotValidate);

                               vbox=new QVBoxLayout(optionsbox);
                               QHashIterator<QString,QHash<QString,QString> > hi(m_ui_params);
                               while(hi.hasNext()){
                               hi.next();
                               QHash<QString,QString> val=hi.value();
                               if (val["type"]=="int" || val["type"]=="double"){
        DoubleParameterWidget *dbl=new DoubleParameterWidget(hi.key(), val["value"].toDouble(),
                val["min"].toDouble(),val["max"].toDouble(),val["value"].toDouble(),
                "",0/*id*/,""/*suffix*/,val["decimals"]!=""?val["decimals"].toInt():0,this);
        dbl->setObjectName(hi.key());
        dbl->setToolTip(val["tooltip"]);
        connect(dbl, &DoubleParameterWidget::valueChanged, this, &ClipStabilize::slotUpdateParams);
        vbox->addWidget(dbl);
    }else if (val["type"]=="bool"){
                           QCheckBox *ch=new QCheckBox(hi.key(),this);
                           ch->setCheckState(val["value"] == "0" ? Qt::Unchecked : Qt::Checked);
                           ch->setObjectName(hi.key());
                           connect(ch, &QCheckBox::stateChanged, this, &ClipStabilize::slotUpdateParams);
                           ch->setToolTip(val["tooltip"]);
                           vbox->addWidget(ch);

                       }
}
adjustSize();
}