[longomatch] Display the logo scaled and filling all the window.



commit e3c8b3ab82f991bc5094874f88a06820e0a7c8af
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Sat Mar 20 11:47:36 2010 +0100

    Display the logo scaled and filling all the window.

 CesarPlayer/Gui/CapturerBin.cs                    |   20 +++++++++++-----
 CesarPlayer/gtk-gui/LongoMatch.Gui.CapturerBin.cs |   16 ++++++------
 CesarPlayer/gtk-gui/gui.stetic                    |   25 +++++++++-----------
 3 files changed, 33 insertions(+), 28 deletions(-)
---
diff --git a/CesarPlayer/Gui/CapturerBin.cs b/CesarPlayer/Gui/CapturerBin.cs
index 944ec77..420b902 100644
--- a/CesarPlayer/Gui/CapturerBin.cs
+++ b/CesarPlayer/Gui/CapturerBin.cs
@@ -56,8 +56,14 @@ namespace LongoMatch.Gui
 				MultimediaFactory factory = new MultimediaFactory();
 				capturer = factory.getCapturer(value);	
 				capturer.EllapsedTime += OnTick;
-				capturerhbox.Add((Widget)capturer);
-				((Widget)capturer).Show();
+				if (value != CapturerType.FAKE){
+					capturerhbox.Add((Widget)capturer);
+					(capturer as Widget).Visible = true;
+					capturerhbox.Visible = true;
+				}
+				else{
+					capturerhbox.Visible = false;
+				}
 			}
 		}
 		
@@ -65,9 +71,8 @@ namespace LongoMatch.Gui
 			set{
 				try{
 					this.logopix = new Pixbuf(value);
-					Console.WriteLine("Setting logo");
 				}catch{
-					// Ignore errors if the file doesn't exists
+					/* FIXME: Add log */
 				}
 			}
 		}
@@ -182,9 +187,12 @@ namespace LongoMatch.Gui
 			logoY = (allocHeight / 2) - (height / 2);
 
 			/* Drawing our frame */
-			frame = logopix.ScaleSimple(width, height, InterpType.Bilinear);
+			frame = new Pixbuf(Colorspace.Rgb, false, 8, allocWidth, allocHeight);
+			logopix.Composite(frame, 0, 0, allocWidth, allocHeight, logoX, logoY, 
+			                  ratio, ratio, InterpType.Bilinear, 255);
+			
 			win.DrawPixbuf (this.Style.BlackGC, frame, 0, 0,
-			                logoX, logoY, width, height,
+			                0, 0, allocWidth, allocHeight,
 			                RgbDither.Normal, 0, 0);
 			frame.Dispose();
 			return;
diff --git a/CesarPlayer/gtk-gui/LongoMatch.Gui.CapturerBin.cs b/CesarPlayer/gtk-gui/LongoMatch.Gui.CapturerBin.cs
index ca111ce..ab24958 100644
--- a/CesarPlayer/gtk-gui/LongoMatch.Gui.CapturerBin.cs
+++ b/CesarPlayer/gtk-gui/LongoMatch.Gui.CapturerBin.cs
@@ -44,15 +44,15 @@ namespace LongoMatch.Gui {
             this.capturerhbox = new Gtk.HBox();
             this.capturerhbox.Name = "capturerhbox";
             this.capturerhbox.Spacing = 6;
-            // Container child capturerhbox.Gtk.Box+BoxChild
+            this.vbox1.Add(this.capturerhbox);
+            Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.vbox1[this.capturerhbox]));
+            w1.Position = 0;
+            // Container child vbox1.Gtk.Box+BoxChild
             this.logodrawingarea = new Gtk.DrawingArea();
             this.logodrawingarea.Name = "logodrawingarea";
-            this.capturerhbox.Add(this.logodrawingarea);
-            Gtk.Box.BoxChild w1 = ((Gtk.Box.BoxChild)(this.capturerhbox[this.logodrawingarea]));
-            w1.Position = 1;
-            this.vbox1.Add(this.capturerhbox);
-            Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.vbox1[this.capturerhbox]));
-            w2.Position = 0;
+            this.vbox1.Add(this.logodrawingarea);
+            Gtk.Box.BoxChild w2 = ((Gtk.Box.BoxChild)(this.vbox1[this.logodrawingarea]));
+            w2.Position = 1;
             // Container child vbox1.Gtk.Box+BoxChild
             this.hbox2 = new Gtk.HBox();
             this.hbox2.Name = "hbox2";
@@ -150,7 +150,7 @@ namespace LongoMatch.Gui {
             w31.Expand = false;
             this.vbox1.Add(this.hbox2);
             Gtk.Box.BoxChild w32 = ((Gtk.Box.BoxChild)(this.vbox1[this.hbox2]));
-            w32.Position = 1;
+            w32.Position = 2;
             w32.Expand = false;
             w32.Fill = false;
             this.Add(this.vbox1);
diff --git a/CesarPlayer/gtk-gui/gui.stetic b/CesarPlayer/gtk-gui/gui.stetic
index 68bf8c9..cab74b0 100644
--- a/CesarPlayer/gtk-gui/gui.stetic
+++ b/CesarPlayer/gtk-gui/gui.stetic
@@ -347,22 +347,19 @@
             <child>
               <placeholder />
             </child>
-            <child>
-              <widget class="Gtk.DrawingArea" id="logodrawingarea">
-                <property name="MemberName" />
-                <signal name="ExposeEvent" handler="OnLogodrawingareaExposeEvent" />
-              </widget>
-              <packing>
-                <property name="Position">1</property>
-                <property name="AutoSize">True</property>
-              </packing>
-            </child>
-            <child>
-              <placeholder />
-            </child>
           </widget>
           <packing>
             <property name="Position">0</property>
+            <property name="AutoSize">False</property>
+          </packing>
+        </child>
+        <child>
+          <widget class="Gtk.DrawingArea" id="logodrawingarea">
+            <property name="MemberName" />
+            <signal name="ExposeEvent" handler="OnLogodrawingareaExposeEvent" />
+          </widget>
+          <packing>
+            <property name="Position">1</property>
             <property name="AutoSize">True</property>
           </packing>
         </child>
@@ -450,7 +447,7 @@
             </child>
           </widget>
           <packing>
-            <property name="Position">1</property>
+            <property name="Position">2</property>
             <property name="AutoSize">False</property>
             <property name="Expand">False</property>
             <property name="Fill">False</property>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]