From af87bfdac60d61f803d1ab9e6466317b2656b6e4 Mon Sep 17 00:00:00 2001 From: spx Date: Sat, 1 Mar 2014 21:37:11 +0900 Subject: [PATCH] =?utf8?q?=E3=83=AA=E3=82=B9=E3=83=88=E3=81=AE=E3=82=A2?= =?utf8?q?=E3=82=A4=E3=82=B3=E3=83=B3=E3=82=B5=E3=82=A4=E3=82=BA=E5=A4=89?= =?utf8?q?=E6=9B=B4=E3=82=92=E5=86=8D=E8=B5=B7=E5=8B=95=E3=81=AA=E3=81=97?= =?utf8?q?=E3=81=AB=E9=81=A9=E7=94=A8=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- OpenTween/Tween.cs | 230 ++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 200 insertions(+), 30 deletions(-) diff --git a/OpenTween/Tween.cs b/OpenTween/Tween.cs index 0c605c0d..98f990b2 100644 --- a/OpenTween/Tween.cs +++ b/OpenTween/Tween.cs @@ -3934,21 +3934,6 @@ namespace OpenTween throw; } - try - { - foreach (TabPage mytab in ListTab.TabPages) - { - DetailsListView lst = (DetailsListView)mytab.Tag; - lst.GridLines = SettingDialog.ShowGrid; - } - } - catch (Exception ex) - { - ex.Data["Instance"] = "ListTab(ShowGrid)"; - ex.Data["IsTerminatePermission"] = false; - throw; - } - // タブの表示位置の決定 SetTabAlignment(); @@ -3975,17 +3960,6 @@ namespace OpenTween _clInputBackcolor = SettingDialog.ColorInputBackcolor; _clInputFont = SettingDialog.ColorInputFont; _fntInputFont = SettingDialog.FontInputFont; - try - { - if (StatusText.Focused) StatusText.BackColor = _clInputBackcolor; - StatusText.Font = _fntInputFont; - StatusText.ForeColor = _clInputFont; - } - catch (Exception ex) - { - MessageBox.Show(ex.Message); - } - _brsBackColorMine.Dispose(); _brsBackColorAt.Dispose(); _brsBackColorYou.Dispose(); @@ -4000,6 +3974,18 @@ namespace OpenTween _brsBackColorAtFromTarget = new SolidBrush(_clAtFromTarget); _brsBackColorAtTo = new SolidBrush(_clAtTo); _brsBackColorNone = new SolidBrush(_clListBackcolor); + + try + { + if (StatusText.Focused) StatusText.BackColor = _clInputBackcolor; + StatusText.Font = _fntInputFont; + StatusText.ForeColor = _clInputFont; + } + catch (Exception ex) + { + MessageBox.Show(ex.Message); + } + try { if (SettingDialog.IsMonospace) @@ -4028,6 +4014,7 @@ namespace OpenTween ex.Data["IsTerminatePermission"] = false; throw; } + try { _statuses.SetUnreadManage(SettingDialog.UnreadManage); @@ -4050,19 +4037,202 @@ namespace OpenTween else tb.ImageIndex = 0; } - if (tb.Tag != null && tb.Controls.Count > 0) + } + } + catch (Exception ex) + { + ex.Data["Instance"] = "ListTab(TabIconDisp no2)"; + ex.Data["IsTerminatePermission"] = false; + throw; + } + + try + { + foreach (TabPage tp in ListTab.TabPages) + { + DetailsListView lst = (DetailsListView)tp.Tag; + + lst.SuspendLayout(); + lst.BeginUpdate(); + + lst.SelectedIndexChanged -= MyList_SelectedIndexChanged; + lst.MouseDoubleClick -= MyList_MouseDoubleClick; + lst.ColumnClick -= MyList_ColumnClick; + lst.DrawColumnHeader -= MyList_DrawColumnHeader; + lst.DragDrop -= TweenMain_DragDrop; + lst.DragOver -= TweenMain_DragOver; + lst.DrawItem -= MyList_DrawItem; + lst.MouseClick -= MyList_MouseClick; + lst.ColumnReordered -= MyList_ColumnReordered; + lst.ColumnWidthChanged -= MyList_ColumnWidthChanged; + lst.CacheVirtualItems -= MyList_CacheVirtualItems; + lst.RetrieveVirtualItem -= MyList_RetrieveVirtualItem; + lst.DrawSubItem -= MyList_DrawSubItem; + lst.HScrolled -= MyList_HScrolled; + + _iconCol = false; + switch (SettingDialog.IconSz) + { + case MyCommon.IconSizes.IconNone: + _iconSz = 0; + break; + case MyCommon.IconSizes.Icon16: + _iconSz = 16; + break; + case MyCommon.IconSizes.Icon24: + _iconSz = 26; + break; + case MyCommon.IconSizes.Icon48: + _iconSz = 48; + break; + case MyCommon.IconSizes.Icon48_2: + _iconSz = 48; + _iconCol = true; + break; + } + if (_iconSz == 0) { - ((DetailsListView)tb.Tag).Font = _fntReaded; - ((DetailsListView)tb.Tag).BackColor = _clListBackcolor; + tw.GetIcon = false; } + else + { + tw.GetIcon = true; + tw.IconSize = _iconSz; + } + + if (_iconSz > 0) + { + // ディスプレイの DPI 設定を考慮したサイズを設定する + lst.SmallImageList.ImageSize = new Size( + (int)Math.Ceiling(this._iconSz * this.currentScaleFactor.Width), + (int)Math.Ceiling(this._iconSz * this.currentScaleFactor.Height)); + } + else + { + lst.SmallImageList.ImageSize = new Size(1, 1); + } + + lst.GridLines = SettingDialog.ShowGrid; + lst.Font = _fntReaded; + lst.BackColor = _clListBackcolor; + + var columns = new List(); + foreach (ColumnHeader col in lst.Columns) + { + columns.Add(col); + } + lst.Columns.Clear(); + foreach (ColumnHeader col in columns) + { + col.Dispose(); + } + columns.Clear(); + + ColumnHeader _colHd1 = new ColumnHeader(); //アイコン + ColumnHeader _colHd2 = new ColumnHeader(); //ニックネーム + ColumnHeader _colHd3 = new ColumnHeader(); //本文 + ColumnHeader _colHd4 = new ColumnHeader(); //日付 + ColumnHeader _colHd5 = new ColumnHeader(); //ユーザID + ColumnHeader _colHd6 = new ColumnHeader(); //未読 + ColumnHeader _colHd7 = new ColumnHeader(); //マーク&プロテクト + ColumnHeader _colHd8 = new ColumnHeader(); //ソース + + if (!_iconCol) + { + lst.Columns.AddRange(new ColumnHeader[] { _colHd1, _colHd2, _colHd3, _colHd4, _colHd5, _colHd6, _colHd7, _colHd8 }); + } + else + { + lst.Columns.AddRange(new ColumnHeader[] { _colHd1, _colHd3 }); + } + + InitColumnText(); + _colHd1.Text = ColumnText[0]; + _colHd1.Width = 48; + _colHd2.Text = ColumnText[1]; + _colHd2.Width = 80; + _colHd3.Text = ColumnText[2]; + _colHd3.Width = 300; + _colHd4.Text = ColumnText[3]; + _colHd4.Width = 50; + _colHd5.Text = ColumnText[4]; + _colHd5.Width = 50; + _colHd6.Text = ColumnText[5]; + _colHd6.Width = 16; + _colHd7.Text = ColumnText[6]; + _colHd7.Width = 16; + _colHd8.Text = ColumnText[7]; + _colHd8.Width = 50; + + int[] dispOrder = new int[8]; + if (_iconCol) + { + lst.Columns[0].Width = _cfgLocal.Width1; + lst.Columns[1].Width = _cfgLocal.Width3; + lst.Columns[0].DisplayIndex = 0; + lst.Columns[1].DisplayIndex = 1; + } + else + { + for (int i = 0; i <= 7; i++) + { + if (_cfgLocal.DisplayIndex1 == i) + dispOrder[i] = 0; + else if (_cfgLocal.DisplayIndex2 == i) + dispOrder[i] = 1; + else if (_cfgLocal.DisplayIndex3 == i) + dispOrder[i] = 2; + else if (_cfgLocal.DisplayIndex4 == i) + dispOrder[i] = 3; + else if (_cfgLocal.DisplayIndex5 == i) + dispOrder[i] = 4; + else if (_cfgLocal.DisplayIndex6 == i) + dispOrder[i] = 5; + else if (_cfgLocal.DisplayIndex7 == i) + dispOrder[i] = 6; + else if (_cfgLocal.DisplayIndex8 == i) + dispOrder[i] = 7; + } + lst.Columns[0].Width = _cfgLocal.Width1; + lst.Columns[1].Width = _cfgLocal.Width2; + lst.Columns[2].Width = _cfgLocal.Width3; + lst.Columns[3].Width = _cfgLocal.Width4; + lst.Columns[4].Width = _cfgLocal.Width5; + lst.Columns[5].Width = _cfgLocal.Width6; + lst.Columns[6].Width = _cfgLocal.Width7; + lst.Columns[7].Width = _cfgLocal.Width8; + for (int i = 0; i <= 7; i++) + { + lst.Columns[dispOrder[i]].DisplayIndex = i; + } + } + + lst.SelectedIndexChanged += MyList_SelectedIndexChanged; + lst.MouseDoubleClick += MyList_MouseDoubleClick; + lst.ColumnClick += MyList_ColumnClick; + lst.DrawColumnHeader += MyList_DrawColumnHeader; + lst.DragDrop += TweenMain_DragDrop; + lst.DragOver += TweenMain_DragOver; + lst.DrawItem += MyList_DrawItem; + lst.MouseClick += MyList_MouseClick; + lst.ColumnReordered += MyList_ColumnReordered; + lst.ColumnWidthChanged += MyList_ColumnWidthChanged; + lst.CacheVirtualItems += MyList_CacheVirtualItems; + lst.RetrieveVirtualItem += MyList_RetrieveVirtualItem; + lst.DrawSubItem += MyList_DrawSubItem; + lst.HScrolled += MyList_HScrolled; + + lst.EndUpdate(); + lst.ResumeLayout(false); } } catch (Exception ex) { - ex.Data["Instance"] = "ListTab(TabIconDisp no2)"; + ex.Data["Instance"] = "ListView(IconSize)"; ex.Data["IsTerminatePermission"] = false; throw; } + SetMainWindowTitle(); SetNotifyIconText(); -- 2.11.0