[vlmc-devel] PreviewWidget: Use ui file to configure the ui as much as possible

Hugo Beauzée-Luyssen git at videolan.org
Sat Feb 15 22:53:34 CET 2014


vlmc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Sat Feb 15 23:43:43 2014 +0200| [579ece94d90aa806a0107d85860dfc50e71ace61] | committer: Hugo Beauzée-Luyssen

PreviewWidget: Use ui file to configure the ui as much as possible

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=579ece94d90aa806a0107d85860dfc50e71ace61
---

 src/Gui/preview/PreviewWidget.cpp   |   10 ------
 src/Gui/preview/ui/PreviewWidget.ui |   67 +++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+), 10 deletions(-)

diff --git a/src/Gui/preview/PreviewWidget.cpp b/src/Gui/preview/PreviewWidget.cpp
index 199e2c5..b31851e 100644
--- a/src/Gui/preview/PreviewWidget.cpp
+++ b/src/Gui/preview/PreviewWidget.cpp
@@ -46,16 +46,6 @@ PreviewWidget::PreviewWidget( QWidget *parent ) :
             w->setAttribute( Qt::WA_LayoutUsesWidgetRect );
     }
 
-    m_ui->rulerWidget->setFocusPolicy( Qt::NoFocus );
-
-    // Prepare and set the black background
-    m_ui->renderWidget->setAutoFillBackground( true );
-    m_videoPalette = m_ui->renderWidget->palette();
-    m_videoPalette.setColor( QPalette::Window, QColor( Qt::black ) );
-    m_ui->renderWidget->setPalette( m_videoPalette );
-
-    setAcceptDrops( false );
-
     connect( m_ui->rulerWidget, SIGNAL( timeChanged(int,int,int,int) ),
              m_ui->lcdNumber,   SLOT( setTime(int,int,int,int) ) );
 
diff --git a/src/Gui/preview/ui/PreviewWidget.ui b/src/Gui/preview/ui/PreviewWidget.ui
index ecbcd57..058c234 100644
--- a/src/Gui/preview/ui/PreviewWidget.ui
+++ b/src/Gui/preview/ui/PreviewWidget.ui
@@ -49,6 +49,73 @@
        <verstretch>0</verstretch>
       </sizepolicy>
      </property>
+     <property name="palette">
+      <palette>
+       <active>
+        <colorrole role="Base">
+         <brush brushstyle="SolidPattern">
+          <color alpha="255">
+           <red>255</red>
+           <green>255</green>
+           <blue>255</blue>
+          </color>
+         </brush>
+        </colorrole>
+        <colorrole role="Window">
+         <brush brushstyle="SolidPattern">
+          <color alpha="255">
+           <red>0</red>
+           <green>0</green>
+           <blue>0</blue>
+          </color>
+         </brush>
+        </colorrole>
+       </active>
+       <inactive>
+        <colorrole role="Base">
+         <brush brushstyle="SolidPattern">
+          <color alpha="255">
+           <red>255</red>
+           <green>255</green>
+           <blue>255</blue>
+          </color>
+         </brush>
+        </colorrole>
+        <colorrole role="Window">
+         <brush brushstyle="SolidPattern">
+          <color alpha="255">
+           <red>0</red>
+           <green>0</green>
+           <blue>0</blue>
+          </color>
+         </brush>
+        </colorrole>
+       </inactive>
+       <disabled>
+        <colorrole role="Base">
+         <brush brushstyle="SolidPattern">
+          <color alpha="255">
+           <red>0</red>
+           <green>0</green>
+           <blue>0</blue>
+          </color>
+         </brush>
+        </colorrole>
+        <colorrole role="Window">
+         <brush brushstyle="SolidPattern">
+          <color alpha="255">
+           <red>0</red>
+           <green>0</green>
+           <blue>0</blue>
+          </color>
+         </brush>
+        </colorrole>
+       </disabled>
+      </palette>
+     </property>
+     <property name="autoFillBackground">
+      <bool>true</bool>
+     </property>
     </widget>
    </item>
    <item>



More information about the Vlmc-devel mailing list