• R/O
  • HTTP
  • SSH
  • HTTPS

コミット

タグ

よく使われているワード(クリックで追加)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

コミットメタ情報

リビジョンcc060214b95bd3b48489b260159f3a846fe80502 (tree)
日時2011-01-18 21:13:35
作者azyobuzin <azyobuzin@user...>
コミッターazyobuzin

ログメッセージ

StatusesListViewに移行
TODO:オーナードローなど

変更サマリ

  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/Controls/StatusesListBox.cs"
  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/Controls/StatusesListView.cs"
  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/DirectMessagesTimelineTabPage.cs"
  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/HomeTimelineTabPage.cs"
  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/MentionsTabPage.cs"
  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/TimelineTabPage.cs"
  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/Settings/Settings.cs"
  • delete: "\202\302\202\242\202\351\202\361\202\351\202\361/StatusInfo.cs"

差分

--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/StatusesListBox.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/StatusesListBox.cs"
@@ -20,7 +20,7 @@ namespace Azyobuzi.Twirunrun
2020 e.ItemHeight =
2121 Math.Max(
2222 Settings.Instance.IconSize,
23- (int)Settings.Instance.MainFont.ConvertToFont().GetHeight()
23+ (int)Settings.Instance.MainFont.GetHeight()
2424 ) + 1;
2525 this.DrawItem += this_DrawItem;
2626 }
@@ -69,18 +69,18 @@ namespace Azyobuzi.Twirunrun
6969
7070 var post = Statuses[e.Index];
7171
72- var font = Settings.Instance.MainFont.ConvertToFont();
72+ var font = Settings.Instance.MainFont;
7373 var color = (e.State & DrawItemState.Selected) == DrawItemState.Selected ?
74- SystemColors.HighlightText : Settings.Instance.MainFontColor.ConvertToColor();
74+ SystemColors.HighlightText : Settings.Instance.MainFontColor;
7575
7676 e.Graphics.InterpolationMode = InterpolationMode.HighQualityBicubic;
7777
7878 //背景色描画
7979 Brush bgBrush;
8080 if (post.Type == StatusTypes.Retweet)
81- bgBrush = new SolidBrush(Settings.Instance.RetweetedBgColor.ConvertToColor());
81+ bgBrush = new SolidBrush(Settings.Instance.RetweetedBgColor);
8282 else
83- bgBrush = new SolidBrush(Settings.Instance.MainBgColor.ConvertToColor());
83+ bgBrush = new SolidBrush(Settings.Instance.MainBgColor);
8484
8585 e.Graphics.FillRectangle(bgBrush, e.Bounds);
8686
--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/StatusesListView.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/StatusesListView.cs"
@@ -12,9 +12,16 @@ namespace Azyobuzi.Twirunrun
1212 {
1313 this.View = View.Details;
1414 this.VirtualMode = true;
15+ this.HeaderStyle = ColumnHeaderStyle.None;
16+ this.FullRowSelect = true;
1517 this.RetrieveVirtualItem += this_RetrieveVirtualItem;
18+ this.Columns.Add("名前", Settings.Instance.NameWidth);
19+ this.Columns.Add("投稿");
20+ this.SizeChanged += (sender, e) => this.AutoResizeColumn(1, ColumnHeaderAutoResizeStyle.ColumnContent);
1621 }
1722
23+ public const string NAME_SUBITEM = "NameSubItem";//SubItem識別用
24+
1825 private IList<StatusInfo> statuses;
1926 public IList<StatusInfo> Statuses
2027 {
@@ -31,7 +38,7 @@ namespace Azyobuzi.Twirunrun
3138
3239 public void SetItemsCount(int count)
3340 {
34- VirtualListSize = count;
41+ this.Invoke((MethodInvoker)(() => VirtualListSize = count));
3542 }
3643
3744 public void SetItemsCount()
@@ -42,9 +49,19 @@ namespace Azyobuzi.Twirunrun
4249 private void this_RetrieveVirtualItem(object sender, RetrieveVirtualItemEventArgs e)
4350 {
4451 var item = Statuses[e.ItemIndex];
52+ var s = Settings.Instance;
4553
4654 var lvi = new ListViewItem();
55+ lvi.BackColor = item.Type == StatusTypes.Retweet ? s.RetweetedBgColor : s.MainBgColor;
56+ lvi.Font = s.MainFont;
57+ lvi.ForeColor = item.Type == StatusTypes.Retweet ? s.RetweetedFontColor : s.MainFontColor;
58+ lvi.Text = s.NameType == NameTypes.Name ? item.User.Name : item.User.ScreenName;
59+
60+ lvi.SubItems.Add(item.Text.Replace('\n', ' '));
61+
62+ lvi.SubItems[0].Tag = NAME_SUBITEM;
4763
64+ e.Item = lvi;
4865 }
4966 }
5067 }
--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/DirectMessagesTimelineTabPage.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/DirectMessagesTimelineTabPage.cs"
@@ -14,7 +14,7 @@ namespace Azyobuzi.Twirunrun
1414 RecentStatusesCollection.Instance.AsParallel()
1515 .Where(tweet => tweet.Type == StatusTypes.DirectMessage)
1616 .OrderBy(Settings.Instance.OrderType)
17- .ToList().AsReadOnly();
17+ .ToList();
1818 if (e.NewItems.Count != 0)
1919 {
2020 var newTweets = e.NewItems.OfType<StatusInfo>().Where(tweet => tweet.Type == StatusTypes.DirectMessage);
--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/HomeTimelineTabPage.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/HomeTimelineTabPage.cs"
@@ -14,7 +14,7 @@ namespace Azyobuzi.Twirunrun
1414 RecentStatusesCollection.Instance.AsParallel()
1515 .Where(tweet => tweet.Type != StatusTypes.DirectMessage)
1616 .OrderBy(Settings.Instance.OrderType)
17- .ToList().AsReadOnly();
17+ .ToList();
1818 //新着通知
1919 if (e.NewItems.Count != 0)
2020 {
--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/MentionsTabPage.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/MentionsTabPage.cs"
@@ -22,7 +22,7 @@ namespace Azyobuzi.Twirunrun
2222 tweet.Type != StatusTypes.DirectMessage &&
2323 mentionCheckRegex.IsMatch(tweet.Text))
2424 .OrderBy(Settings.Instance.OrderType)
25- .ToList().AsReadOnly();
25+ .ToList();
2626 //新着通知
2727 if (e.NewItems.Count != 0)
2828 {
--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/TimelineTabPage.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Controls/Tabs/TimelineTabPage.cs"
@@ -15,12 +15,14 @@ namespace Azyobuzi.Twirunrun
1515 Timeline.Dock = DockStyle.Fill;
1616 this.Controls.Add(Timeline);
1717 TabSettings.PropertyChanged += TabSettings_PropertyChanged;
18- Timeline.SelectedIndexChanged += (sender, e) =>
19- this.GetMainForm().ShowDetailStatus(Timeline.Statuses[Timeline.SelectedIndex]);
18+ Timeline.SelectedIndexChanged += (sender, e) =>{
19+ if (Timeline.SelectedIndices.Count != 0)
20+ this.GetMainForm().ShowDetailStatus(Timeline.Statuses[Timeline.SelectedIndices[0]]);
21+ };
2022 Timeline.DoubleClick += (sender, e) =>
2123 {
22- if (Timeline.SelectedIndex == -1) return;
23- var selecting = Timeline.Statuses[Timeline.SelectedIndex];
24+ if (Timeline.SelectedIndices.Count == 0) return;
25+ var selecting = Timeline.Statuses[Timeline.SelectedIndices[0]];
2426 this.GetMainForm().UpdateStatusPanel.SetReplyTo(
2527 selecting.Type == StatusTypes.Retweet ?
2628 selecting.Tweet.Retweet.ID : selecting.Id,
@@ -32,7 +34,7 @@ namespace Azyobuzi.Twirunrun
3234
3335 //public TwirunrunTabControl Owner { private set; get; }
3436
35- public StatusesListBox Timeline = new StatusesListBox();
37+ public StatusesListView Timeline = new StatusesListView();
3638
3739 public TabInfo TabSettings { private set; get; }
3840
--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/Settings/Settings.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/Settings/Settings.cs"
@@ -3,6 +3,7 @@ using System.Collections.Generic;
33 using System.Drawing;
44 using System.Windows.Forms;
55 using System.Linq;
6+using System.Xml.Serialization;
67
78 namespace Azyobuzi.Twirunrun
89 {
@@ -199,14 +200,36 @@ namespace Azyobuzi.Twirunrun
199200 }
200201 }
201202
202- private string mainFont = new Font("MS UI Gothic", 9f).ConvertToString();
203- public string MainFont
203+ private string mainFontString = new Font("MS UI Gothic", 9f).ConvertToString();
204+ public string MainFontString
204205 {
205206 set
206207 {
207- if (mainFont != value)
208+ if (mainFontString != value)
209+ {
210+ mainFontString = value;
211+ mainFont = value.ConvertToFont();
212+ OnPropertyChanged("MainFontString");
213+ OnPropertyChanged("MainFont");
214+ }
215+ }
216+ get
217+ {
218+ return mainFontString;
219+ }
220+ }
221+
222+ private Font mainFont = new Font("MS UI Gothic", 9f);
223+ [XmlIgnore]
224+ public Font MainFont
225+ {
226+ set
227+ {
228+ if (!mainFont.Equals(value))
208229 {
209230 mainFont = value;
231+ mainFontString = value.ConvertToString();
232+ OnPropertyChanged("MainFontString");
210233 OnPropertyChanged("MainFont");
211234 }
212235 }
@@ -216,14 +239,36 @@ namespace Azyobuzi.Twirunrun
216239 }
217240 }
218241
219- private string mainFontColor = SystemColors.ControlText.ConvertToString();
220- public string MainFontColor
242+ private string mainFontColorString = SystemColors.ControlText.ConvertToString();
243+ public string MainFontColorString
244+ {
245+ set
246+ {
247+ if (mainFontColorString != value)
248+ {
249+ mainFontColorString = value;
250+ mainFontColor = value.ConvertToColor();
251+ OnPropertyChanged("MainFontColorString");
252+ OnPropertyChanged("MainFontColor");
253+ }
254+ }
255+ get
256+ {
257+ return mainFontColorString;
258+ }
259+ }
260+
261+ private Color mainFontColor = SystemColors.ControlText;
262+ [XmlIgnore]
263+ public Color MainFontColor
221264 {
222265 set
223266 {
224267 if (mainFontColor != value)
225268 {
226269 mainFontColor = value;
270+ mainFontColorString = value.ConvertToString();
271+ OnPropertyChanged("MainFontColorString");
227272 OnPropertyChanged("MainFontColor");
228273 }
229274 }
@@ -233,14 +278,36 @@ namespace Azyobuzi.Twirunrun
233278 }
234279 }
235280
236- private string mainBgColor = Color.White.ConvertToString();
237- public string MainBgColor
281+ private string mainBgColorString = SystemColors.Window.ConvertToString();
282+ public string MainBgColorString
283+ {
284+ set
285+ {
286+ if (mainBgColorString != value)
287+ {
288+ mainBgColorString = value;
289+ mainBgColor = value.ConvertToColor();
290+ OnPropertyChanged("MainBgColorString");
291+ OnPropertyChanged("MainBgColor");
292+ }
293+ }
294+ get
295+ {
296+ return mainBgColorString;
297+ }
298+ }
299+
300+ private Color mainBgColor = SystemColors.Window;
301+ [XmlIgnore]
302+ public Color MainBgColor
238303 {
239304 set
240305 {
241306 if (mainBgColor != value)
242307 {
243308 mainBgColor = value;
309+ mainBgColorString = value.ConvertToString();
310+ OnPropertyChanged("MainBgColorString");
244311 OnPropertyChanged("MainBgColor");
245312 }
246313 }
@@ -250,14 +317,36 @@ namespace Azyobuzi.Twirunrun
250317 }
251318 }
252319
253- private string retweetedBgColor = Color.Green.ConvertToString();
254- public string RetweetedBgColor
320+ private string retweetedBgColorString = SystemColors.Window.ConvertToString();
321+ public string RetweetedBgColorString
322+ {
323+ set
324+ {
325+ if (retweetedBgColorString != value)
326+ {
327+ retweetedBgColorString = value;
328+ retweetedBgColor = value.ConvertToColor();
329+ OnPropertyChanged("RetweetedBgColorString");
330+ OnPropertyChanged("RetweetedBgColor");
331+ }
332+ }
333+ get
334+ {
335+ return retweetedBgColorString;
336+ }
337+ }
338+
339+ private Color retweetedBgColor = SystemColors.Window;
340+ [XmlIgnore]
341+ public Color RetweetedBgColor
255342 {
256343 set
257344 {
258345 if (retweetedBgColor != value)
259346 {
260347 retweetedBgColor = value;
348+ retweetedBgColorString = value.ConvertToString();
349+ OnPropertyChanged("RetweetedBgColorString");
261350 OnPropertyChanged("RetweetedBgColor");
262351 }
263352 }
@@ -267,14 +356,75 @@ namespace Azyobuzi.Twirunrun
267356 }
268357 }
269358
270- private string postPanelFont = new Font("MS UI Gothic", 9f).ConvertToString();
271- public string PostPanelFont
359+ private string retweetedFontColorString = Color.Green.ConvertToString();
360+ public string RetweetedFontColorString
361+ {
362+ set
363+ {
364+ if (retweetedFontColorString != value)
365+ {
366+ retweetedFontColorString = value;
367+ retweetedFontColor = value.ConvertToColor();
368+ OnPropertyChanged("RetweetedFontColorString");
369+ OnPropertyChanged("RetweetedFontColor");
370+ }
371+ }
372+ get
373+ {
374+ return retweetedFontColorString;
375+ }
376+ }
377+
378+ private Color retweetedFontColor = Color.Green;
379+ [XmlIgnore]
380+ public Color RetweetedFontColor
381+ {
382+ set
383+ {
384+ if (retweetedFontColor != value)
385+ {
386+ retweetedFontColor = value;
387+ retweetedFontColorString = value.ConvertToString();
388+ OnPropertyChanged("RetweetedFontColorString");
389+ OnPropertyChanged("RetweetedFontColor");
390+ }
391+ }
392+ get
393+ {
394+ return retweetedFontColor;
395+ }
396+ }
397+
398+ private string postPanelFontString = new Font("MS UI Gothic", 9f).ConvertToString();
399+ public string PostPanelFontString
400+ {
401+ set
402+ {
403+ if (postPanelFontString != value)
404+ {
405+ postPanelFontString = value;
406+ postPanelFont = value.ConvertToFont();
407+ OnPropertyChanged("PostPanelFontString");
408+ OnPropertyChanged("PostPanelFont");
409+ }
410+ }
411+ get
412+ {
413+ return postPanelFontString;
414+ }
415+ }
416+
417+ private Font postPanelFont = new Font("MS UI Gothic", 9f);
418+ [XmlIgnore]
419+ public Font PostPanelFont
272420 {
273421 set
274422 {
275- if (postPanelFont != value)
423+ if (!postPanelFont.Equals(value))
276424 {
277425 postPanelFont = value;
426+ postPanelFontString = value.ConvertToString();
427+ OnPropertyChanged("PostPanelFontString");
278428 OnPropertyChanged("PostPanelFont");
279429 }
280430 }
--- "a/\202\302\202\242\202\351\202\361\202\351\202\361/StatusInfo.cs"
+++ "b/\202\302\202\242\202\351\202\361\202\351\202\361/StatusInfo.cs"
@@ -27,7 +27,6 @@ namespace Azyobuzi.Twirunrun
2727 ReplyToStatusId = Tweet.InReplyToStatusID;
2828 Favorited = Tweet.Favorited;
2929 Source = new SourceClient(Tweet.Source);
30- IsProtected = Tweet.User.Protected;
3130 ProfileImageUri = Tweet.User.ProfileImageUrl;
3231 }
3332 else
@@ -74,7 +73,6 @@ namespace Azyobuzi.Twirunrun
7473 Text = DirectMessage.SenderScreenName.Equals(Settings.Instance.MyScreenName, StringComparison.InvariantCultureIgnoreCase) ?
7574 string.Format("@{0} {1}", DirectMessage.RecipientScreenName, DirectMessage.Text) : DirectMessage.Text;
7675 CreatedAt = DirectMessage.CreatedAt.ToLocalTime();
77- IsProtected = DirectMessage.Sender.Protected;
7876 ProfileImageUri = DirectMessage.Sender.ProfileImageUrl;
7977 }
8078 else
@@ -100,9 +98,6 @@ namespace Azyobuzi.Twirunrun
10098 public bool Favorited { get; set; }
10199 [XmlIgnore]
102100 public SourceClient Source { set; get; }
103- //public Retweet Retweet { set; get; }
104- [XmlIgnore]
105- public bool IsProtected { set; get; }
106101 [XmlIgnore]
107102 public string ProfileImageUri { set; get; }
108103