]> git.sesse.net Git - kdenlive/commitdiff
Cleanup decoration of tree views (effect list, project tree)
authorJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 2 Oct 2011 15:13:21 +0000 (15:13 +0000)
committerJean-Baptiste Mardelle <jb@kdenlive.org>
Sun, 2 Oct 2011 15:13:21 +0000 (15:13 +0000)
svn path=/trunk/kdenlive/; revision=5938

src/CMakeLists.txt
src/effectslistview.cpp
src/projectlistview.cpp
src/widgets/effectlist_ui.ui
src/widgets/resources.qrc [new file with mode: 0644]
src/widgets/stylesheet-branch-closed.png [new file with mode: 0644]
src/widgets/stylesheet-branch-open.png [new file with mode: 0644]

index 4664e1c9b1098f8427f849354952d6d311b69941..173eabcd0cb763639474eb0453a516a55bacb519 100644 (file)
@@ -318,6 +318,7 @@ message(STATUS "using dl library: ${DL_LIB}")
 
 kde4_add_kcfg_files(kdenlive_SRCS kdenlivesettings.kcfgc)
 qt4_add_dbus_adaptor(kdenlive_SRCS org.kdenlive.MainWindow.xml mainwindow.h MainWindow)
 
 kde4_add_kcfg_files(kdenlive_SRCS kdenlivesettings.kcfgc)
 qt4_add_dbus_adaptor(kdenlive_SRCS org.kdenlive.MainWindow.xml mainwindow.h MainWindow)
+qt4_add_resources(kdenlive_SRCS widgets/resources.qrc)
 kde4_add_executable(kdenlive ${kdenlive_SRCS} ${kdenlive_UI})
 
 if(${KDE_VERSION} VERSION_LESS 4.3.80)
 kde4_add_executable(kdenlive ${kdenlive_SRCS} ${kdenlive_UI})
 
 if(${KDE_VERSION} VERSION_LESS 4.3.80)
index 9935394c1b445ba3c5db0a10fc2a6292e3766b48..d7d9c0a201f2c8aae912b062e6d1205bf1a5c760 100644 (file)
@@ -35,8 +35,17 @@ EffectsListView::EffectsListView(QWidget *parent) :
 {
     setupUi(this);
 
 {
     setupUi(this);
 
+    QString style = "QTreeView::branch:has-siblings:!adjoins-item{border-image: none 0;} \
+    QTreeView::branch:has-siblings:adjoins-item {border-image: none 0;}      \
+    QTreeView::branch:!has-children:!has-siblings:adjoins-item {border-image: none 0;} \
+    QTreeView::branch:has-children:!has-siblings:closed,QTreeView::branch:closed:has-children:has-siblings {   \
+         border-image: none;image: url(:/images/stylesheet-branch-closed.png);}      \
+    QTreeView::branch:open:has-children:!has-siblings,QTreeView::branch:open:has-children:has-siblings  {    \
+         border-image: none;image: url(:/images/stylesheet-branch-open.png);}";
+
     QMenu *contextMenu = new QMenu(this);
     m_effectsList = new EffectsListWidget(contextMenu);
     QMenu *contextMenu = new QMenu(this);
     m_effectsList = new EffectsListWidget(contextMenu);
+    m_effectsList->setStyleSheet(style);
     QVBoxLayout *lyr = new QVBoxLayout(effectlistframe);
     lyr->addWidget(m_effectsList);
     lyr->setContentsMargins(0, 0, 0, 0);
     QVBoxLayout *lyr = new QVBoxLayout(effectlistframe);
     lyr->addWidget(m_effectsList);
     lyr->setContentsMargins(0, 0, 0, 0);
index 5e4a7d34cee69a202ffd0c4040483a3af5c10fd6..816ce866ee04c78c74b937d586a446efe6537213 100644 (file)
@@ -45,6 +45,16 @@ ProjectListView::ProjectListView(QWidget *parent) :
     setFrameShape(QFrame::NoFrame);
     setRootIsDecorated(true);
 
     setFrameShape(QFrame::NoFrame);
     setRootIsDecorated(true);
 
+    QString style = "QTreeView::branch:has-siblings:!adjoins-item{border-image: none 0;} \
+    QTreeView::branch:has-siblings:adjoins-item {border-image: none 0;}      \
+    QTreeView::branch:!has-children:!has-siblings:adjoins-item {border-image: none 0;} \
+    QTreeView::branch:has-children:!has-siblings:closed,QTreeView::branch:closed:has-children:has-siblings {   \
+         border-image: none;image: url(:/images/stylesheet-branch-closed.png);}      \
+    QTreeView::branch:open:has-children:!has-siblings,QTreeView::branch:open:has-children:has-siblings  {    \
+         border-image: none;image: url(:/images/stylesheet-branch-open.png);}";
+
+    setStyleSheet(style);
+
     setColumnCount(3);
     QStringList headers;
     headers << i18n("Clip") << i18n("Description") << i18n("Rating");
     setColumnCount(3);
     QStringList headers;
     headers << i18n("Clip") << i18n("Description") << i18n("Rating");
index f1266646ee48234cd929d29ada1a63c7f5955b85..8b183bb5b6f69b2f7cbdb5487dd1573e526b81d0 100644 (file)
  </widget>
  <customwidgets>
   <customwidget>
  </widget>
  <customwidgets>
   <customwidget>
-   <class>KTreeWidgetSearchLine</class>
-   <extends>KLineEdit</extends>
-   <header>ktreewidgetsearchline.h</header>
+   <class>KComboBox</class>
+   <extends>QComboBox</extends>
+   <header>kcombobox.h</header>
   </customwidget>
   <customwidget>
    <class>KLineEdit</class>
   </customwidget>
   <customwidget>
    <class>KLineEdit</class>
    <header>klineedit.h</header>
   </customwidget>
   <customwidget>
    <header>klineedit.h</header>
   </customwidget>
   <customwidget>
-   <class>KComboBox</class>
-   <extends>QComboBox</extends>
-   <header>kcombobox.h</header>
+   <class>KTreeWidgetSearchLine</class>
+   <extends>KLineEdit</extends>
+   <header>ktreewidgetsearchline.h</header>
   </customwidget>
  </customwidgets>
   </customwidget>
  </customwidgets>
- <resources/>
+ <resources>
+  <include location="resources.qrc"/>
+ </resources>
  <connections/>
 </ui>
  <connections/>
 </ui>
diff --git a/src/widgets/resources.qrc b/src/widgets/resources.qrc
new file mode 100644 (file)
index 0000000..c6c69eb
--- /dev/null
@@ -0,0 +1,6 @@
+<RCC>
+  <qresource prefix="images">
+    <file>stylesheet-branch-closed.png</file>
+    <file>stylesheet-branch-open.png</file>
+  </qresource>
+</RCC>
diff --git a/src/widgets/stylesheet-branch-closed.png b/src/widgets/stylesheet-branch-closed.png
new file mode 100644 (file)
index 0000000..42ba094
Binary files /dev/null and b/src/widgets/stylesheet-branch-closed.png differ
diff --git a/src/widgets/stylesheet-branch-open.png b/src/widgets/stylesheet-branch-open.png
new file mode 100644 (file)
index 0000000..c388195
Binary files /dev/null and b/src/widgets/stylesheet-branch-open.png differ