]> git.sesse.net Git - kdenlive/commitdiff
Cleanup effect stack stylesheet
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 28 Mar 2012 22:27:40 +0000 (00:27 +0200)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Wed, 28 Mar 2012 22:27:40 +0000 (00:27 +0200)
src/effectstack/collapsibleeffect.cpp
src/effectstack/collapsiblegroup.cpp
src/widgets/collapsiblegroup_ui.ui

index 2f089a694728b8f16cb4983b542f2a0a231c622c..6ab1eb8cdfef4221e1a29976a0d99d6ea7babb9c 100644 (file)
@@ -211,41 +211,42 @@ const QString CollapsibleEffect::getStyleSheet(QPalette p)
     QColor selected_bg = scheme.decoration(KColorScheme::FocusColor).color();
     QColor hover_bg = scheme.decoration(KColorScheme::HoverColor).color();
     QColor light_bg = scheme.shade(KColorScheme::LightShade);
+    QColor midlight_bg = scheme.shade(KColorScheme::MidlightShade);
     QColor normal_bg = scheme.background(KColorScheme::AlternateBackground).color();
     QColor alt_bg = scheme.background(KColorScheme::NormalBackground).color();
     
     KColorScheme scheme2(p.currentColorGroup(), KColorScheme::Window, KSharedConfig::openConfig(KdenliveSettings::colortheme()));
     QColor normal_bg2 = scheme2.background(KColorScheme::NormalBackground).color();
-
-    QString stylesheet(QString("MyEditableLabel { background-color: transparent;} QFrame#decoframe {border-radius:5px;border:0px solid %1;background:%6;} QFrame#decoframegroup {border-radius:5px;border:1px solid %1;background:%6;} QFrame:hover#decoframe {background:%7;} QFrame#decoframe[active=\"true\"] {background:%5;} QFrame#decoframegroup[active=\"true\"] {background:%5;} QFrame#frame[active=\"true\"] {background:%3;}  QProgressBar::chunk:horizontal {background: %6;border-top-left-radius: 4px;border-bottom-left-radius: 4px;} QProgressBar::chunk:horizontal#dragOnly {background: %5;border-top-left-radius: 4px;border-bottom-left-radius: 4px;} QProgressBar::chunk:horizontal:hover {background: %3;}\
-    QProgressBar:horizontal {border: 1px solid %1;border-top-left-radius: 4px;border-bottom-left-radius: 4px;border-right:0px;background:%5;padding: 0px;text-align:left center}\
-                                QProgressBar:horizontal:disabled {border: 1px solid %6} QProgressBar:horizontal#dragOnly {background: %5}\
-                                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:disabled#dragBox {border: 1px solid %6;}\
-                                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(hover_bg.name()).arg(selected_bg.name()).arg(light_bg.name()).arg(alt_bg.name()).arg(normal_bg2.name()).arg(normal_bg.name()));
-    return stylesheet;/*
-    QPalette p = QApplication::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);
-    QColor normal_bg = scheme.background(KColorScheme::NormalBackground).color();
+    QColor normal_bg3 = scheme2.background(KColorScheme::AlternateBackground).color();
     
-    KColorScheme scheme2(p.currentColorGroup(), KColorScheme::Window, KSharedConfig::openConfig(KdenliveSettings::colortheme()));
-    QColor normal_bg2 = scheme2.background(KColorScheme::NormalBackground).color();
+    QString stylesheet;
+    
+    // group editable labels
+    stylesheet.append(QString("MyEditableLabel { background-color: transparent;} "));
+    
+    // effect background
+    stylesheet.append(QString("QFrame#decoframe {border-radius:5px;border:0px solid %1;background:%3;}  QFrame:hover#decoframe {background:%4;} QFrame#decoframe[active=\"true\"] {background:%2;} ").arg(dark_bg.name()).arg(alt_bg.name()).arg(normal_bg2.name()).arg(normal_bg.name()));
+    
+    // effect group background
+    stylesheet.append(QString("QFrame#decoframegroup {border-radius:5px;border:1px solid %1;background:%2;} QFrame#decoframegroup[active=\"true\"] {background:%3;} ").arg(dark_bg.name()).arg(normal_bg2.name()).arg(alt_bg.name()));
+    
+    // effect title bar
+    stylesheet.append(QString("QFrame#frame {border-radius: 5px;} QFrame#frame[active=\"true\"] {background:%1;}").arg(selected_bg.name()));
+    
+    // group effect title bar
+    stylesheet.append(QString("QFrame#framegroup {border-radius: 5px; background: %2;}  QFrame#framegroup[active=\"true\"] {background:%1;} ").arg(selected_bg.name()).arg(normal_bg3.name()));
+    
+    // draggable effect content bar
+    stylesheet.append(QString("QProgressBar::chunk:horizontal {background: %1;border-top-left-radius: 4px;border-bottom-left-radius: 4px;} QProgressBar::chunk:horizontal#dragOnly {background: %2;border-top-left-radius: 4px;border-bottom-left-radius: 4px;} QProgressBar::chunk:horizontal:hover {background: %3;}").arg(normal_bg2.name()).arg(alt_bg.name()).arg(selected_bg.name()));
+    
+    // draggable effect content bar
+    stylesheet.append(QString("QProgressBar:horizontal {border: 1px solid %1;border-top-left-radius: 4px;border-bottom-left-radius: 4px;border-right:0px;background:%4;padding: 0px;text-align:left center} QProgressBar:horizontal:disabled {border: 1px solid %5} QProgressBar:horizontal#dragOnly {background: %4} QProgressBar:horizontal[inTimeline=\"true\"] { border: 1px solid %2;border-right: 0px;background: %3;padding: 0px;text-align:left center } QProgressBar::chunk:horizontal[inTimeline=\"true\"] {background: %2;}").arg(dark_bg.name()).arg(hover_bg.name()).arg(light_bg.name()).arg(alt_bg.name()).arg(normal_bg2.name()));
+    
+    
+    // spin box for draggable widget
+    stylesheet.append(QString("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:disabled#dragBox {border: 1px solid %4;} 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(hover_bg.name()).arg(selected_bg.name()).arg(normal_bg2.name()));
 
-    QString stylesheet(QString("QProgressBar::chunk:horizontal {background: %6;border-top-left-radius: 4px;border-bottom-left-radius: 4px;} QProgressBar::chunk:horizontal#dragOnly {background: %5;border-top-left-radius: 4px;border-bottom-left-radius: 4px;} QProgressBar::chunk:horizontal:hover {background: %3;}\
-    QProgressBar:horizontal {border: 1px solid %1;border-top-left-radius: 4px;border-bottom-left-radius: 4px;border-right:0px;background:%5;padding: 0px;text-align:left center}\
-                                QProgressBar:horizontal:disabled {border: 1px solid %6} QProgressBar:horizontal#dragOnly {background: %5}\
-                                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:disabled#dragBox {border: 1px solid %6;}\
-                                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(hover_bg.name()).arg(selected_bg.name()).arg(light_bg.name()).arg(normal_bg.name()).arg(normal_bg2.name()));
-    return stylesheet;*/
+    return stylesheet;
 }
 
 void CollapsibleEffect::slotCreateGroup()
index 5fc3a5de7dce61fdb5a0a6484a539dd7a7e11f2e..5b19a1f3dd9f94851f05e0ca1d8cc83e4b4b5b6b 100644 (file)
@@ -57,7 +57,7 @@ CollapsibleGroup::CollapsibleGroup(int ix, bool firstGroup, bool lastGroup, QStr
 {
     setupUi(this);
     setFont(KGlobalSettings::smallestReadableFont());
-    QHBoxLayout *l = static_cast <QHBoxLayout *>(frame->layout());
+    QHBoxLayout *l = static_cast <QHBoxLayout *>(framegroup->layout());
     m_title = new MyEditableLabel(this);
     l->insertWidget(4, m_title);
     m_title->setText(groupName.isEmpty() ? i18n("Effect Group") : groupName);
@@ -114,7 +114,7 @@ void CollapsibleGroup::setActive(bool activate)
 
 void CollapsibleGroup::mouseDoubleClickEvent ( QMouseEvent * event )
 {
-    if (frame->underMouse() && collapseButton->isEnabled()) slotSwitch();
+    if (framegroup->underMouse() && collapseButton->isEnabled()) slotSwitch();
     QWidget::mouseDoubleClickEvent(event);
 }
 
@@ -221,7 +221,7 @@ void CollapsibleGroup::addGroupEffect(CollapsibleEffect *effect)
     QVBoxLayout *vbox = static_cast<QVBoxLayout *>(widgetFrame->layout());
     if (vbox == NULL) {
        vbox = new QVBoxLayout();
-       vbox->setContentsMargins(10, 0, 0, 0);
+       vbox->setContentsMargins(0, 0, 0, 0);
        vbox->setSpacing(2);
        widgetFrame->setLayout(vbox);
     }
@@ -273,22 +273,22 @@ void CollapsibleGroup::updateTimecodeFormat()
 void CollapsibleGroup::dragEnterEvent(QDragEnterEvent *event)
 {
     if (event->mimeData()->hasFormat("kdenlive/effectslist")) {
-       frame->setProperty("active", true);
-       frame->setStyleSheet(frame->styleSheet());
+       framegroup->setProperty("active", true);
+       framegroup->setStyleSheet(framegroup->styleSheet());
        event->acceptProposedAction();
     }
 }
 
 void CollapsibleGroup::dragLeaveEvent(QDragLeaveEvent */*event*/)
 {
-    frame->setProperty("active", false);
-    frame->setStyleSheet(frame->styleSheet());
+    framegroup->setProperty("active", false);
+    framegroup->setStyleSheet(framegroup->styleSheet());
 }
 
 void CollapsibleGroup::dropEvent(QDropEvent *event)
 {
-    frame->setProperty("active", false);
-    frame->setStyleSheet(frame->styleSheet());
+    framegroup->setProperty("active", false);
+    framegroup->setStyleSheet(framegroup->styleSheet());
     const QString effects = QString::fromUtf8(event->mimeData()->data("kdenlive/effectslist"));
     //event->acceptProposedAction();
     QDomDocument doc;
index 7ab74bf9899612cabd91ac9c1bd81448ddf5f920..6258dfe10db27ee399dca25330c8eaef98ce45a1 100644 (file)
@@ -36,7 +36,7 @@
        <number>0</number>
       </property>
       <item row="0" column="0">
-       <widget class="QFrame" name="frame">
+       <widget class="QFrame" name="framegroup">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
           <horstretch>0</horstretch>