From 5680b256e398c3c4c28c36e479e8983284b0a340 Mon Sep 17 00:00:00 2001 From: sr55 Date: Sun, 12 Apr 2009 20:10:47 +0000 Subject: [PATCH] WinGui: - Improvements to the preview window design. - Code tweaks to make it less crash / error prone (QT Control) git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@2320 b64f7644-9d1e-0410-96f1-a4d463321fa5 --- win/C#/HandBrakeCS.csproj | 1 + win/C#/Properties/Resources.Designer.cs | 7 ++ win/C#/Properties/Resources.resx | 3 + win/C#/Resources/Play_small.png | Bin 0 -> 1166 bytes win/C#/frmPreview.Designer.cs | 81 +++++++++++++----------- win/C#/frmPreview.cs | 49 ++++++++++---- win/C#/frmPreview.resx | 3 - 7 files changed, 90 insertions(+), 54 deletions(-) create mode 100644 win/C#/Resources/Play_small.png diff --git a/win/C#/HandBrakeCS.csproj b/win/C#/HandBrakeCS.csproj index 7542e6097..f892112b2 100644 --- a/win/C#/HandBrakeCS.csproj +++ b/win/C#/HandBrakeCS.csproj @@ -318,6 +318,7 @@ + diff --git a/win/C#/Properties/Resources.Designer.cs b/win/C#/Properties/Resources.Designer.cs index 70b73b78e..36b338870 100644 --- a/win/C#/Properties/Resources.Designer.cs +++ b/win/C#/Properties/Resources.Designer.cs @@ -200,6 +200,13 @@ namespace Handbrake.Properties { } } + internal static System.Drawing.Bitmap Play_small { + get { + object obj = ResourceManager.GetObject("Play_small", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + internal static System.Drawing.Bitmap Pref_Small { get { object obj = ResourceManager.GetObject("Pref_Small", resourceCulture); diff --git a/win/C#/Properties/Resources.resx b/win/C#/Properties/Resources.resx index 7807b0e53..d5524c82b 100644 --- a/win/C#/Properties/Resources.resx +++ b/win/C#/Properties/Resources.resx @@ -199,4 +199,7 @@ ..\Resources\AddToQueue_small.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + ..\Resources\Play_small.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/win/C#/Resources/Play_small.png b/win/C#/Resources/Play_small.png new file mode 100644 index 0000000000000000000000000000000000000000..3e4647a157e467a54b0dedd4ffbe9f26b897f004 GIT binary patch literal 1166 zcmV;91abR`P)004R= z004l4008;_004mL004C`008P>0026e000+nl3&F}00009a7bBm000XT000XT0n*)m z`~Uy|7<5HgbW?9;ba!ELWdKlNX>N2bPDNB8b~7$BHmT?0B>(^e@JU2LR5(w4lZ#JV zRUF5A%cXQG21qzpz$2!WhD}|O{gCzb5UDBWDl=vVrPx48A_x!%UPfzd7AsA0twWFt* z3<8)8K;T6XJ_ZoJ%kl-^(`I(uv8|rER;|fT;o05!8*3l@T7(8s4IiU= z>X&+$rH#Hhl)+g%gJ=Ji85}tr>tdzW`CSX`+%)(mHZ)*=tOnadC5(Pw366~_aIF8s zryEVa>4!$zvT#Y;G$!HrMKb+6OoKg#KeD26PCe3lCmz?p_z!9r@hCw*nGHI7CRkRB zVfaCXpR4!F!1k>Y9QW$IgNrJs&X&cOA_pUuNG&=J@|I-KIWnMoxd5)*xd@i8iokZa5(XAk9<5a*lpqH~Ty>14>OD(YmR0ol zS`GR;Dj0d7g8thIC~QuGgiJ1i2WJ(>p~UV%ukxRy|BeDWTr!Y0#zU;=FeGI0Agw$Kl>MineO?MZUlhWXm11b0 zxj+}01k@SD5f(#`&m-k60%6;Y3!cHRE1>t*MYz0_52o2%zetdG6!M!Bp>9m%mzWpx zp$ql9m*rrX%=Hu)5``!8xg;ZzieTm$68Uvwna&PZp|^7(587Q)Fy5e`qVE)x^$4Na znGJ1oQnWAI!7W2SB=c4copi!~f+(>JuD!`$=t`LrfcQQofd1$}eh~mO%6M zY{1Vu`oG#LzgM0lMi-z;(4f z?McZ%%I{f?@7mrIzY)WYdFj9RjT0J7guZt0naGq^l9LK}-REngZsnR{H}g8;|G?ln zy(VfULB{Rl#)YRI4A~zNw2utf>*5jwlVGtA1cp5yejxhQ$PjTvY?zW8AKr-g;LVsY z)yqd-lyJg=V_9tSb%J0#izIuBupGbrARGz^WWK=KM}`LN4-7{f3S^UE0VFd7^`1kS gU<7_Q#9t@+6UQeL$j7u&O8@`>07*qoM6N<$f @@ -138,6 +165,7 @@ namespace Handbrake else MessageBox.Show(this, "Unable to find the preview file. Either the file was deleted or the encode failed. Check the activity log for details.", "VLC", MessageBoxButtons.OK, MessageBoxIcon.Warning); } + lbl_status.Visible = false; } /// @@ -153,18 +181,13 @@ namespace Handbrake BeginInvoke(new UpdateUIHandler(OpenMovie)); return; } + QTControl.Sizing = QTSizingModeEnum.qtControlFitsMovie; QTControl.URL = currently_playing; - QTControl.Width = QTControl.Movie.Width; - QTControl.Height = QTControl.Movie.Height; - // The initial control size is 64,64. If we do not reload the clip here - // it'll scale the video from 64,64. - // Unsure why as it correctly resizes the control to the movies actual size. - QTControl.URL = currently_playing; - QTControl.SetScale(0); + QTControl.Sizing = QTSizingModeEnum.qtMovieFitsControl; QTControl.Show(); - this.Width = QTControl.Width + 5; - this.Height = QTControl.Height + 90; + this.ClientSize = QTControl.Size; + this.Height += 25; } catch (COMException ex) { diff --git a/win/C#/frmPreview.resx b/win/C#/frmPreview.resx index 0db6e0108..ef2d4bca6 100644 --- a/win/C#/frmPreview.resx +++ b/win/C#/frmPreview.resx @@ -120,9 +120,6 @@ 17, 17 - - 116, 17 - AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w -- 2.40.0