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

Kevin Kuphal kuphal at dls.net
Sat Jul 17 14:25:13 EDT 2004


Isaac Richards wrote:

>On Friday 16 July 2004 11:14 pm, Kevin Kuphal wrote:
>  
>
>>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.
>>    
>>
>
>I wanted the pre-scaling window (and other popups) to have a different offset.
>  
>
Update.  This version of the patch fixes the Prescaling window but 
doesn't break other windows like Status Icons by mistake.

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 18:23:05 -0000
@@ -981,7 +981,9 @@
     {
         widget->setPalette(d->m_palette);
         if (d->m_backgroundimage && d->m_backgroundimage->width() > 0)
+        {
             widget->setPaletteBackgroundPixmap(*(d->m_backgroundimage));
+        }
         return;
     }
 
@@ -998,6 +1000,7 @@
         bgpixmap = LoadScalePixmap(pmapname);
         if (bgpixmap)
         {
+            widget->setBackgroundOrigin(QWidget::AncestorOrigin);
             widget->setPaletteBackgroundPixmap(*bgpixmap);
             d->m_backgroundimage = new QPixmap(*bgpixmap);
         }
@@ -1022,6 +1025,7 @@
             tmp.end();
 
             d->m_backgroundimage = new QPixmap(background);
+            widget->setBackgroundOrigin(QWidget::AncestorOrigin);
             widget->setPaletteBackgroundPixmap(background);
         }
     }


More information about the mythtv-dev mailing list