[mythtv] [PATCH] Fix background origin on transparent widgets

Kevin Kuphal kuphal at dls.net
Fri Jul 16 23:14:14 EDT 2004


This patch fixes the background origin on "transparent" widgets (most 
noteably visible on the "Pre-scaling" window) so that the widget 
background is offest to match it's parent background. 

Without this the background 0,0 is set to the widget 0,0 and it looks 
funny because the parent has the same background and now you have two 
identical pixmaps overlapping (parent background and widget 
background).  After the patch, the widget background is offset to match 
the parent so the transparency looks complete.

Kevin
-------------- next part --------------
Index: mythtv/libs/libmyth/mythcontext.cpp
===================================================================
RCS file: /var/lib/mythcvs/mythtv/libs/libmyth/mythcontext.cpp,v
retrieving revision 1.124
diff -n -u -r1.124 mythcontext.cpp
--- mythtv/libs/libmyth/mythcontext.cpp	29 Jun 2004 17:00:08 -0000	1.124
+++ mythtv/libs/libmyth/mythcontext.cpp	17 Jul 2004 03:06:56 -0000
@@ -981,7 +981,10 @@
     {
         widget->setPalette(d->m_palette);
         if (d->m_backgroundimage && d->m_backgroundimage->width() > 0)
+        {
+	    widget->setBackgroundOrigin(QWidget::AncestorOrigin);
             widget->setPaletteBackgroundPixmap(*(d->m_backgroundimage));
+        }
         return;
     }
 
@@ -998,6 +1001,7 @@
         bgpixmap = LoadScalePixmap(pmapname);
         if (bgpixmap)
         {
+            widget->setBackgroundOrigin(QWidget::AncestorOrigin);
             widget->setPaletteBackgroundPixmap(*bgpixmap);
             d->m_backgroundimage = new QPixmap(*bgpixmap);
         }
@@ -1022,6 +1026,7 @@
             tmp.end();
 
             d->m_backgroundimage = new QPixmap(background);
+            widget->setBackgroundOrigin(QWidget::AncestorOrigin);
             widget->setPaletteBackgroundPixmap(background);
         }
     }


More information about the mythtv-dev mailing list