OSDN Git Service

VScrollBarのスケーリング処理を追加
authorKimura Youichi <kim.upsilon@bucyou.net>
Thu, 5 Feb 2015 15:47:28 +0000 (00:47 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Thu, 5 Feb 2015 16:22:59 +0000 (01:22 +0900)
OpenTween.Tests/OTBaseFormTest.cs
OpenTween/OTBaseForm.cs
OpenTween/Resources/ChangeLog.txt
OpenTween/TweetThumbnail.Designer.cs
OpenTween/TweetThumbnail.cs
OpenTween/TweetThumbnail.resx

index 4211a48..ab55d42 100644 (file)
@@ -75,5 +75,16 @@ namespace OpenTween
                 Assert.Equal(175, listview.Columns[1].Width);
             }
         }
+
+        [Fact]
+        public void ScaleChildControl_VScrollBarTest()
+        {
+            using (var scrollBar = new VScrollBar { Width = 20, Height = 200 })
+            {
+                OTBaseForm.ScaleChildControl(scrollBar, new SizeF(2.0f, 2.0f));
+
+                Assert.Equal(40, scrollBar.Width);
+            }
+        }
     }
 }
index 5ef1e45..960e701 100644 (file)
@@ -97,6 +97,14 @@ namespace OpenTween
             }
         }
 
+        /// <summary>
+        /// 標準の VScrollBar のスケーリングでは不十分な処理を補います
+        /// </summary>
+        public static void ScaleChildControl(VScrollBar scrollBar, SizeF factor)
+        {
+            scrollBar.Width = ScaleBy(factor.Width, scrollBar.Width);
+        }
+
         public static Size ScaleBy(SizeF factor, Size size)
         {
             return Size.Round(new SizeF(size.Width * factor.Width, size.Height * factor.Height));
index 845eaa2..edcf57e 100644 (file)
@@ -22,6 +22,7 @@
  * FIX: 発言詳細欄からツイート本文をコピーした際に改行が失われてしまう問題を回避
  * FIX: プロフィール編集に失敗した場合に「適用」ボタンが無効のまま元に戻らない不具合を修正
  * FIX: プロフィール編集中にプロフィール画面を閉じるとエラーが発生する不具合を修正
+ * FIX: 高DPI環境でサムネイル表示部の縦スクロールバーが正しくスケーリングされない問題を修正
 
 ==== Ver 1.2.4(2014/11/23)
  * NEW: Mobypicture (mobypicture.com) への画像投稿に対応
index b8043fc..c0679a0 100644 (file)
@@ -71,7 +71,7 @@
             // TweetThumbnail
             // 
             resources.ApplyResources(this, "$this");
-            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
+            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit;
             this.Controls.Add(this.panelPictureBox);
             this.Controls.Add(this.scrollBar);
             this.Name = "TweetThumbnail";
index 9efb44e..3b98034 100644 (file)
@@ -192,6 +192,12 @@ namespace OpenTween
             this.scrollBar.Value = newval;
         }
 
+        protected override void ScaleControl(SizeF factor, BoundsSpecified specified)
+        {
+            base.ScaleControl(factor, specified);
+            OTBaseForm.ScaleChildControl(this.scrollBar, factor);
+        }
+
         private void scrollBar_ValueChanged(object sender, EventArgs e)
         {
             using (ControlTransaction.Layout(this, false))
index 49b61ea..fb891b1 100644 (file)
   <data name="&gt;&gt;toolTip.Type" xml:space="preserve">
     <value>System.Windows.Forms.ToolTip, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
-  <data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
-    <value>96, 96</value>
-  </data>
   <data name="scrollBar.Size" type="System.Drawing.Size, System.Drawing">
     <value>17, 150</value>
   </data>