OSDN Git Service

発言詳細部・入力欄の位置を発言一覧の上へ配置できるようにした
authorspx <spx268@gmail.com>
Sat, 17 May 2014 18:56:34 +0000 (03:56 +0900)
committerspx <spx268@gmail.com>
Sat, 17 May 2014 18:56:34 +0000 (03:56 +0900)
※使われていなかった「設定 - 表示 - 発言詳細部にアイコンを表示する」を本機能用に置き換えた(新たに置く場所がなかったので)

OpenTween/AppendSettingDialog.cs
OpenTween/OTSplitContainer.cs [new file with mode: 0644]
OpenTween/OpenTween.csproj
OpenTween/Resources/ChangeLog.txt
OpenTween/Setting/Panel/PreviewPanel.Designer.cs
OpenTween/Setting/Panel/PreviewPanel.en.resx
OpenTween/Setting/Panel/PreviewPanel.resx
OpenTween/Setting/Panel/PreviewPanel.zh-CHS.resx
OpenTween/Setting/SettingCommon.cs
OpenTween/Tween.Designer.cs
OpenTween/Tween.cs

index 4ccf3cf..38ca503 100644 (file)
@@ -422,6 +422,7 @@ namespace OpenTween
                 UseAtIdSupplement = this.TweetActPanel.CheckAtIdSupple.Checked;
                 UseHashSupplement = this.TweetActPanel.CheckHashSupple.Checked;
                 PreviewEnable = this.PreviewPanel.CheckPreviewEnable.Checked;
+                StatusAreaAtBottom = this.PreviewPanel.CheckStatusAreaAtBottom.Checked;
                 TwitterApiUrl = this.ConnectionPanel.TwitterAPIText.Text.Trim();
                 switch (this.PreviewPanel.ReplyIconStateCombo.SelectedIndex)
                 {
@@ -783,6 +784,7 @@ namespace OpenTween
             this.TweetActPanel.CheckAtIdSupple.Checked = UseAtIdSupplement;
             this.TweetActPanel.CheckHashSupple.Checked = UseHashSupplement;
             this.PreviewPanel.CheckPreviewEnable.Checked = PreviewEnable;
+            this.PreviewPanel.CheckStatusAreaAtBottom.Checked = StatusAreaAtBottom;
             this.ConnectionPanel.TwitterAPIText.Text = TwitterApiUrl;
             switch (ReplyIconState)
             {
@@ -1179,6 +1181,7 @@ namespace OpenTween
         public bool UseAtIdSupplement { get; set; }
         public bool UseHashSupplement { get; set; }
         public bool PreviewEnable { get; set; }
+        public bool StatusAreaAtBottom { get; set; }
         public bool UseAdditionalCount { get; set; }
         public bool OpenUserTimeline { get; set; }
         public string TwitterApiUrl { get; set; }
diff --git a/OpenTween/OTSplitContainer.cs b/OpenTween/OTSplitContainer.cs
new file mode 100644 (file)
index 0000000..136465b
--- /dev/null
@@ -0,0 +1,196 @@
+// OpenTween - Client of Twitter
+// Copyright (c) 2014 spx (@5px)
+// All rights reserved.
+//
+// This file is part of OpenTween.
+//
+// This program is free software; you can redistribute it and/or modify it
+// under the terms of the GNU General Public License as published by the Free
+// Software Foundation; either version 3 of the License, or (at your option)
+// any later version.
+//
+// This program is distributed in the hope that it will be useful, but
+// WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+// or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+// for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with this program. If not, see <http://www.gnu.org/licenses/>, or write to
+// the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
+// Boston, MA 02110-1301, USA.
+
+using System;
+using System.Windows.Forms;
+using System.ComponentModel;
+
+namespace OpenTween
+{
+    public class OTSplitContainer : SplitContainer
+    {
+        /// <summary>
+        /// Panel1 と Panel2 の中身が入れ替わった状態かどうかを取得または設定する。
+        /// true が設定された場合、Panel に関連するプロパティの処理内容も入れ替わるので注意。
+        /// </summary>
+        [Browsable(false)]
+        [DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
+        public bool IsPanelInverted
+        {
+            get { return _isPanelInverted; }
+            set
+            {
+                if (_isPanelInverted == value) return;
+                _isPanelInverted = value;
+
+                // Panel1 と Panel2 の中身を入れ替え
+                using (ControlTransaction.Layout(this, false))
+                using (ControlTransaction.Layout(base.Panel1, false))
+                using (ControlTransaction.Layout(base.Panel2, false))
+                {
+                    // TODO: 複数コントロールへの対応
+                    var cont1 = base.Panel1.Controls.Count > 0 ? base.Panel1.Controls[0] : null;
+                    var cont2 = base.Panel2.Controls.Count > 0 ? base.Panel2.Controls[0] : null;
+                    base.Panel1.Controls.Clear();
+                    base.Panel2.Controls.Clear();
+
+                    // 関連するプロパティを反転させる
+                    if (base.FixedPanel != FixedPanel.None)
+                        base.FixedPanel = (base.FixedPanel == FixedPanel.Panel1) ? FixedPanel.Panel2 : FixedPanel.Panel1;
+
+                    base.SplitterDistance = SplitterTotalWidth - base.SplitterDistance;
+
+                    var tmpMinSize = base.Panel1MinSize;
+                    base.Panel1MinSize = base.Panel2MinSize;
+                    base.Panel2MinSize = tmpMinSize;
+
+                    var tmpCollapsed = base.Panel1Collapsed;
+                    base.Panel1Collapsed = base.Panel2Collapsed;
+                    base.Panel2Collapsed = tmpCollapsed;
+
+                    base.Panel1.Controls.Add(cont2);
+                    base.Panel2.Controls.Add(cont1);
+                }
+            }
+        }
+        private bool _isPanelInverted = false;
+
+        /// <summary>
+        /// SplitContainer.Orientation プロパティの設定に応じて、スプリッタが移動する方向の幅を返す。
+        /// </summary>
+        private int SplitterTotalWidth
+        {
+            get { return (base.Orientation == Orientation.Horizontal) ? base.Height : base.Width; }
+        }
+
+        /// <summary>
+        /// IsPanelInverted プロパティの設定に応じて、SplitContainer.Panel1 または SplitContainer.Panel2 を返す。
+        /// </summary>
+        public new SplitterPanel Panel1
+        {
+            get { return IsPanelInverted ? base.Panel2 : base.Panel1; }
+        }
+
+        /// <summary>
+        /// IsPanelInverted プロパティの設定に応じて、SplitContainer.Panel1 または SplitContainer.Panel2 を返す。
+        /// </summary>
+        public new SplitterPanel Panel2
+        {
+            get { return IsPanelInverted ? base.Panel1 : base.Panel2; }
+        }
+
+        /// <summary>
+        /// IsPanelInverted プロパティの設定に応じて、SplitContainer.FixedPanel を返す。
+        /// </summary>
+        public new FixedPanel FixedPanel
+        {
+            get
+            {
+                if (base.FixedPanel != FixedPanel.None && IsPanelInverted)
+                    return (base.FixedPanel == FixedPanel.Panel1) ? FixedPanel.Panel2 : FixedPanel.Panel1;
+                else
+                    return base.FixedPanel;
+            }
+            set
+            {
+                if (value != FixedPanel.None && IsPanelInverted)
+                    base.FixedPanel = (value == FixedPanel.Panel1) ? FixedPanel.Panel2 : FixedPanel.Panel1;
+                else
+                    base.FixedPanel = value;
+            }
+        }
+
+        /// <summary>
+        /// IsPanelInverted プロパティの設定に応じて、SplitContainer.SplitterDistance を返す。
+        /// </summary>
+        public new int SplitterDistance
+        {
+            get { return IsPanelInverted ? SplitterTotalWidth - base.SplitterDistance : base.SplitterDistance; }
+            set
+            {
+                if (IsPanelInverted)
+                    base.SplitterDistance = SplitterTotalWidth - value;
+                else
+                    base.SplitterDistance = value;
+            }
+        }
+
+        /// <summary>
+        /// IsPanelInverted プロパティの設定に応じて、SplitContainer.Panel1MinSize または SplitContainer.Panel2MinSize を返す。
+        /// </summary>
+        public new int Panel1MinSize
+        {
+            get { return IsPanelInverted ? base.Panel2MinSize : base.Panel1MinSize; }
+            set
+            {
+                if (IsPanelInverted)
+                    base.Panel2MinSize = value;
+                else
+                    base.Panel1MinSize = value;
+            }
+        }
+
+        /// <summary>
+        /// IsPanelInverted プロパティの設定に応じて、SplitContainer.Panel1MinSize または SplitContainer.Panel2MinSize を返す。
+        /// </summary>
+        public new int Panel2MinSize
+        {
+            get { return IsPanelInverted ? base.Panel1MinSize : base.Panel2MinSize; }
+            set
+            {
+                if (IsPanelInverted)
+                    base.Panel1MinSize = value;
+                else
+                    base.Panel2MinSize = value;
+            }
+        }
+
+        /// <summary>
+        /// IsPanelInverted プロパティの設定に応じて、SplitContainer.Panel1Collapsed または SplitContainer.Panel2Collapsed を返す。
+        /// </summary>
+        public new bool Panel1Collapsed
+        {
+            get { return IsPanelInverted ? base.Panel2Collapsed : base.Panel1Collapsed; }
+            set
+            {
+                if (IsPanelInverted)
+                    base.Panel2Collapsed = value;
+                else
+                    base.Panel1Collapsed = value;
+            }
+        }
+
+        /// <summary>
+        /// IsPanelInverted プロパティの設定に応じて、SplitContainer.Panel1Collapsed または SplitContainer.Panel2Collapsed を返す。
+        /// </summary>
+        public new bool Panel2Collapsed
+        {
+            get { return IsPanelInverted ? base.Panel1Collapsed : base.Panel2Collapsed; }
+            set
+            {
+                if (IsPanelInverted)
+                    base.Panel1Collapsed = value;
+                else
+                    base.Panel2Collapsed = value;
+            }
+        }
+    }
+}
index 171f1be..bfa5856 100644 (file)
     <Compile Include="OTBaseForm.cs">
       <SubType>Form</SubType>
     </Compile>
+    <Compile Include="OTSplitContainer.cs">
+      <SubType>Component</SubType>
+    </Compile>
     <Compile Include="PostFilterRule.cs" />
     <Compile Include="HashtagManage.cs">
       <SubType>Form</SubType>
index 4007792..ab5ccc5 100644 (file)
@@ -9,6 +9,8 @@
  * NEW: 検索ダイアログからPublicSearchタブを追加できるようになりました
  * NEW: Twitter公式のミュート機能でミュートしているユーザーを起動時に取得・非表示にできるようになりました
   - 現状、取得のみでミュートの設定は行えません
+ * NEW: 発言詳細部・入力欄を発言一覧の上に配置できるようになりました
+  - 上部に配置する場合は、「発言詳細部・入力欄を発言一覧の下に配置する」のチェックを外してください
  * CHG: 使用する.NET Frameworkのバージョンが 4.0 から 4.5.1 に変更されました
  * CHG: 画像ファイルをD&Dした際の動作を変更しました
   - 投稿先がD&Dしたファイルに対応していない場合、勝手に投稿先を切り替えず、エラーダイアログを表示するだけにします
index 7743393..617da71 100644 (file)
@@ -48,7 +48,7 @@
             this.Label45 = new System.Windows.Forms.Label();
             this.cmbNameBalloon = new System.Windows.Forms.ComboBox();
             this.CheckDispUsername = new System.Windows.Forms.CheckBox();
-            this.CheckBox3 = new System.Windows.Forms.CheckBox();
+            this.CheckStatusAreaAtBottom = new System.Windows.Forms.CheckBox();
             this.toolTip = new System.Windows.Forms.ToolTip(this.components);
             this.SuspendLayout();
             // 
             this.CheckDispUsername.Name = "CheckDispUsername";
             this.CheckDispUsername.UseVisualStyleBackColor = true;
             // 
-            // CheckBox3
+            // CheckStatusAreaAtBottom
             // 
-            resources.ApplyResources(this.CheckBox3, "CheckBox3");
-            this.CheckBox3.Name = "CheckBox3";
-            this.CheckBox3.UseVisualStyleBackColor = true;
+            resources.ApplyResources(this.CheckStatusAreaAtBottom, "CheckStatusAreaAtBottom");
+            this.CheckStatusAreaAtBottom.Name = "CheckStatusAreaAtBottom";
+            this.CheckStatusAreaAtBottom.UseVisualStyleBackColor = true;
             // 
             // PreviewPanel
             // 
             this.Controls.Add(this.Label45);
             this.Controls.Add(this.cmbNameBalloon);
             this.Controls.Add(this.CheckDispUsername);
-            this.Controls.Add(this.CheckBox3);
+            this.Controls.Add(this.CheckStatusAreaAtBottom);
             this.Name = "PreviewPanel";
             this.ResumeLayout(false);
             this.PerformLayout();
         internal System.Windows.Forms.Label Label45;
         internal System.Windows.Forms.ComboBox cmbNameBalloon;
         internal System.Windows.Forms.CheckBox CheckDispUsername;
-        internal System.Windows.Forms.CheckBox CheckBox3;
+        internal System.Windows.Forms.CheckBox CheckStatusAreaAtBottom;
         private System.Windows.Forms.ToolTip toolTip;
     }
 }
index 12b0d70..99402d6 100644 (file)
@@ -290,13 +290,13 @@ This file is released for developers in Growl for Windows web site.</value>
   <data name="CheckDispUsername.ToolTip" xml:space="preserve">
     <value />
   </data>
-  <data name="CheckBox3.Size" type="System.Drawing.Size, System.Drawing">
-    <value>148, 16</value>
+  <data name="CheckStatusAreaAtBottom.Size" type="System.Drawing.Size, System.Drawing">
+    <value>278, 16</value>
   </data>
-  <data name="CheckBox3.Text" xml:space="preserve">
-    <value>Show icon in detail view</value>
+  <data name="CheckStatusAreaAtBottom.Text" xml:space="preserve">
+    <value>Locate tweet detail and input area at the bottom</value>
   </data>
-  <data name="CheckBox3.ToolTip" xml:space="preserve">
+  <data name="CheckStatusAreaAtBottom.ToolTip" xml:space="preserve">
     <value />
   </data>
   <data name="$this.ToolTip" xml:space="preserve">
index 3e99210..c9fed6e 100644 (file)
@@ -687,37 +687,34 @@ Growl.CoreLibrary.DLL</value>
   <data name="&gt;&gt;CheckDispUsername.ZOrder" xml:space="preserve">
     <value>17</value>
   </data>
-  <data name="CheckBox3.AutoSize" type="System.Boolean, mscorlib">
+  <data name="CheckStatusAreaAtBottom.AutoSize" type="System.Boolean, mscorlib">
     <value>True</value>
   </data>
-  <data name="CheckBox3.Enabled" type="System.Boolean, mscorlib">
-    <value>False</value>
-  </data>
-  <data name="CheckBox3.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
+  <data name="CheckStatusAreaAtBottom.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
     <value>NoControl</value>
   </data>
-  <data name="CheckBox3.Location" type="System.Drawing.Point, System.Drawing">
+  <data name="CheckStatusAreaAtBottom.Location" type="System.Drawing.Point, System.Drawing">
     <value>23, 225</value>
   </data>
-  <data name="CheckBox3.Size" type="System.Drawing.Size, System.Drawing">
-    <value>180, 16</value>
+  <data name="CheckStatusAreaAtBottom.Size" type="System.Drawing.Size, System.Drawing">
+    <value>257, 16</value>
   </data>
-  <data name="CheckBox3.TabIndex" type="System.Int32, mscorlib">
+  <data name="CheckStatusAreaAtBottom.TabIndex" type="System.Int32, mscorlib">
     <value>30</value>
   </data>
-  <data name="CheckBox3.Text" xml:space="preserve">
-    <value>ç\99ºè¨\80詳細é\83¨ã\81«ã\82¢ã\82¤ã\82³ã\83³ã\82\92表示する</value>
+  <data name="CheckStatusAreaAtBottom.Text" xml:space="preserve">
+    <value>ç\99ºè¨\80詳細é\83¨ã\83»å\85¥å\8a\9bæ¬\84ã\82\92ç\99ºè¨\80ä¸\80覧ã\81®ä¸\8bã\81«é\85\8dç½®する</value>
   </data>
-  <data name="&gt;&gt;CheckBox3.Name" xml:space="preserve">
-    <value>CheckBox3</value>
+  <data name="&gt;&gt;CheckStatusAreaAtBottom.Name" xml:space="preserve">
+    <value>CheckStatusAreaAtBottom</value>
   </data>
-  <data name="&gt;&gt;CheckBox3.Type" xml:space="preserve">
+  <data name="&gt;&gt;CheckStatusAreaAtBottom.Type" xml:space="preserve">
     <value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
   </data>
-  <data name="&gt;&gt;CheckBox3.Parent" xml:space="preserve">
+  <data name="&gt;&gt;CheckStatusAreaAtBottom.Parent" xml:space="preserve">
     <value>$this</value>
   </data>
-  <data name="&gt;&gt;CheckBox3.ZOrder" xml:space="preserve">
+  <data name="&gt;&gt;CheckStatusAreaAtBottom.ZOrder" xml:space="preserve">
     <value>18</value>
   </data>
   <metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
index 47aeefd..b9e7db4 100644 (file)
   <data name="CheckDispUsername.Text" xml:space="preserve">
     <value>显示用户名</value>
   </data>
-  <data name="CheckBox3.Size" type="System.Drawing.Size, System.Drawing">
-    <value>48, 16</value>
-  </data>
-  <data name="CheckBox3.Text" xml:space="preserve">
-    <value>显示</value>
-  </data>
 </root>
\ No newline at end of file
index b999812..6a9e77c 100644 (file)
@@ -161,6 +161,7 @@ namespace OpenTween
         public bool HashIsHead = false;
         public bool HashIsNotAddToAtReply = true;
         public bool PreviewEnable = true;
+        public bool StatusAreaAtBottom = true;
 
         public MyCommon.UrlConverter AutoShortUrlFirst = MyCommon.UrlConverter.Uxnu;
         public bool UseUnreadStyle = true;
index f0872b1..273dd72 100644 (file)
@@ -47,7 +47,7 @@
             this.ToolStripSeparator8 = new System.Windows.Forms.ToolStripSeparator();
             this.HashToggleMenuItem = new System.Windows.Forms.ToolStripMenuItem();
             this.HashManageMenuItem = new System.Windows.Forms.ToolStripMenuItem();
-            this.SplitContainer1 = new System.Windows.Forms.SplitContainer();
+            this.SplitContainer1 = new OTSplitContainer();
             this.TimelinePanel = new System.Windows.Forms.Panel();
             this.ListTab = new System.Windows.Forms.TabControl();
             this.ContextMenuTabProperty = new System.Windows.Forms.ContextMenuStrip(this.components);
         internal System.Windows.Forms.ToolStripSeparator ToolStripSeparator8;
         internal System.Windows.Forms.ToolStripMenuItem HashToggleMenuItem;
         internal System.Windows.Forms.ToolStripMenuItem HashManageMenuItem;
-        internal System.Windows.Forms.SplitContainer SplitContainer1;
+        internal OTSplitContainer SplitContainer1;
         internal System.Windows.Forms.Panel TimelinePanel;
         internal System.Windows.Forms.TabControl ListTab;
         internal System.Windows.Forms.ContextMenuStrip ContextMenuTabProperty;
index c33b8b7..6f65a15 100644 (file)
@@ -846,6 +846,7 @@ namespace OpenTween
             SettingDialog.UseAtIdSupplement = _cfgCommon.UseAtIdSupplement;
             SettingDialog.UseHashSupplement = _cfgCommon.UseHashSupplement;
             SettingDialog.PreviewEnable = _cfgCommon.PreviewEnable;
+            SettingDialog.StatusAreaAtBottom = _cfgCommon.StatusAreaAtBottom;
             AtIdSupl = new AtIdSupplement(SettingAtIdList.Load().AtIdList, "@");
 
             SettingDialog.IsMonospace = _cfgCommon.IsMonospace;
@@ -1069,6 +1070,9 @@ namespace OpenTween
             // NameLabel のフォントを OTBaseForm.GlobalFont に変更
             this.NameLabel.Font = this.ReplaceToGlobalFont(this.NameLabel.Font);
 
+            // 必要であれば、発言一覧と発言詳細部・入力欄の上下を入れ替える
+            SplitContainer1.IsPanelInverted = !SettingDialog.StatusAreaAtBottom;
+
             //全新着通知のチェック状態により、Reply&DMの新着通知有効無効切り替え(タブ別設定にするため削除予定)
             if (SettingDialog.UnreadManage == false)
             {
@@ -3969,6 +3973,8 @@ namespace OpenTween
                     // タブの表示位置の決定
                     SetTabAlignment();
 
+                    SplitContainer1.IsPanelInverted = !SettingDialog.StatusAreaAtBottom;
+
                     var imgazyobizinet = ThumbnailGenerator.ImgAzyobuziNetInstance;
                     imgazyobizinet.Enabled = this.SettingDialog.EnableImgAzyobuziNet;
                     imgazyobizinet.DisabledInDM = this.SettingDialog.ImgAzyobuziNetDisabledInDM;
@@ -7815,6 +7821,7 @@ namespace OpenTween
                 _cfgCommon.UseAtIdSupplement = SettingDialog.UseAtIdSupplement;
                 _cfgCommon.UseHashSupplement = SettingDialog.UseHashSupplement;
                 _cfgCommon.PreviewEnable = SettingDialog.PreviewEnable;
+                _cfgCommon.StatusAreaAtBottom = SettingDialog.StatusAreaAtBottom;
                 _cfgCommon.Language = SettingDialog.Language;
 
                 _cfgCommon.SortOrder = (int)_statuses.SortOrder;