}
public string Nickname { get; set; }
public string TextFromApi { get; set; }
+
+ /// <summary>スクリーンリーダーでの読み上げを考慮したテキスト</summary>
+ public string AccessibleText { get; set; }
+
public string ImageUrl { get; set; }
public string ScreenName { get; set; }
public DateTime CreatedAt { get; set; }
}
/// <summary>
+ /// [引用 @{0}: {1}] に類似しているローカライズされた文字列を検索します。
+ /// </summary>
+ internal static string QuoteStatus_AccessibleText {
+ get {
+ return ResourceManager.GetString("QuoteStatus_AccessibleText", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Direct Messageの送受信をするため、もう一度認証処理をして下さい。 に類似しているローカライズされた文字列を検索します。
/// </summary>
internal static string ReAuthorizeText {
<data name="AddNewTab_ListView_AccessibleName" xml:space="preserve">
<value>PostsList</value>
</data>
+ <data name="QuoteStatus_AccessibleText" xml:space="preserve">
+ <value>[Quote @{0}: {1}]</value>
+ </data>
</root>
\ No newline at end of file
<data name="AddNewTab_ListView_AccessibleName" xml:space="preserve">
<value>発言一覧</value>
</data>
+ <data name="QuoteStatus_AccessibleText" xml:space="preserve">
+ <value>[引用 @{0}: {1}]</value>
+ </data>
</root>
\ No newline at end of file
- 「絵文字を画像で表示する(Twemoji)」が有効な場合に Unicode 8.0 で追加された絵文字が表示されるようになります
* NEW: pic.twitter.com の画像アップロード時に代替テキストを送信できるようになりました
- 代替テキストについては https://blog.twitter.com/ja/2016/0330alt を参照して下さい
+ * NEW: スクリーンリーダーで引用ツイートの内容が発言一覧上でも読み上げられるようになりました
==== Ver 1.3.2(2016/04/12)
* NEW: touch.pixiv.net のサムネイル表示に対応 (pixiv.net は既に対応しています)
{
string[] sitem= {"",
Post.Nickname,
- Post.IsDeleted ? "(DELETED)" : Post.TextSingleLine,
+ Post.IsDeleted ? "(DELETED)" : Post.AccessibleText,
Post.CreatedAt.ToString(this._cfgCommon.DateTimeFormat),
Post.ScreenName,
"",
{
string[] sitem = {"",
Post.Nickname,
- Post.IsDeleted ? "(DELETED)" : Post.TextSingleLine,
+ Post.IsDeleted ? "(DELETED)" : Post.AccessibleText,
Post.CreatedAt.ToString(this._cfgCommon.DateTimeFormat),
Post.ScreenName + Environment.NewLine + "(RT:" + Post.RetweetedBy + ")",
"",
itm = new ImageListViewItem(sitem, this.IconCache, Post.ImageUrl);
}
itm.StateIndex = Post.StateIndex;
+ itm.Tag = Post;
bool read = Post.IsRead;
//未読管理していなかったら既読として扱う
if (e.ColumnIndex > 0)
{
//アイコン以外の列
+ var post = (PostClass)e.Item.Tag;
+
RectangleF rct = e.Bounds;
rct.Width = e.Header.Width;
int fontHeight = e.Item.Font.Height;
using (Font fnt = new Font(e.Item.Font, FontStyle.Bold))
{
TextRenderer.DrawText(e.Graphics,
- e.Item.SubItems[2].Text,
+ post.TextSingleLine,
e.Item.Font,
Rectangle.Round(rct),
color,
else if (drawLineCount == 1)
{
TextRenderer.DrawText(e.Graphics,
- e.SubItem.Text,
+ e.ColumnIndex != 2 ? e.SubItem.Text : post.TextSingleLine,
e.Item.Font,
Rectangle.Round(rct),
color,
else
{
TextRenderer.DrawText(e.Graphics,
- e.SubItem.Text,
+ e.ColumnIndex != 2 ? e.SubItem.Text : post.TextSingleLine,
e.Item.Font,
Rectangle.Round(rct),
color,
post.TextFromApi = this.ReplaceTextFromApi(post.TextFromApi, entities);
post.TextFromApi = WebUtility.HtmlDecode(post.TextFromApi);
post.TextFromApi = post.TextFromApi.Replace("<3", "\u2661");
+ post.AccessibleText = this.CreateAccessibleText(textFromApi, entities, (status.RetweetedStatus ?? status).QuotedStatus);
+ post.AccessibleText = WebUtility.HtmlDecode(post.AccessibleText);
+ post.AccessibleText = post.AccessibleText.Replace("<3", "\u2661");
post.QuoteStatusIds = GetQuoteTweetStatusIds(entities)
.Where(x => x != post.StatusId && x != post.RetweetedId)
post.TextFromApi = this.ReplaceTextFromApi(textFromApi, message.Entities);
post.TextFromApi = WebUtility.HtmlDecode(post.TextFromApi);
post.TextFromApi = post.TextFromApi.Replace("<3", "\u2661");
+ post.AccessibleText = this.CreateAccessibleText(textFromApi, message.Entities, quoteStatus: null);
+ post.AccessibleText = WebUtility.HtmlDecode(post.AccessibleText);
+ post.AccessibleText = post.AccessibleText.Replace("<3", "\u2661");
post.IsFav = false;
post.QuoteStatusIds = GetQuoteTweetStatusIds(message.Entities).Distinct().ToArray();
{
foreach (var m in entities.Media)
{
- if (m.AltText != null)
- {
- text = text.Replace(m.Url, string.Format(Properties.Resources.ImageAltText, m.AltText));
- }
- else
+ if (!string.IsNullOrEmpty(m.DisplayUrl)) text = text.Replace(m.Url, m.DisplayUrl);
+ }
+ }
+ }
+ return text;
+ }
+
+ private string CreateAccessibleText(string text, TwitterEntities entities, TwitterStatus quoteStatus)
+ {
+ if (entities == null)
+ return text;
+
+ if (entities.Urls != null)
+ {
+ foreach (var entity in entities.Urls)
+ {
+ if (quoteStatus != null)
+ {
+ var matchStatusUrl = Twitter.StatusUrlRegex.Match(entity.ExpandedUrl);
+ if (matchStatusUrl.Success && matchStatusUrl.Groups["StatusId"].Value == quoteStatus.IdStr)
{
- if (!string.IsNullOrEmpty(m.DisplayUrl)) text = text.Replace(m.Url, m.DisplayUrl);
+ var quoteText = this.CreateAccessibleText(quoteStatus.Text, quoteStatus.MergedEntities, quoteStatus: null);
+ text = text.Replace(entity.Url, $"[引用 @{quoteStatus.User.ScreenName}: {quoteText}]");
}
}
+ else if (!string.IsNullOrEmpty(entity.DisplayUrl))
+ {
+ text = text.Replace(entity.Url, entity.DisplayUrl);
+ }
}
}
+
+ if (entities.Media != null)
+ {
+ foreach (var entity in entities.Media)
+ {
+ if (!string.IsNullOrEmpty(entity.AltText))
+ {
+ text = text.Replace(entity.Url, string.Format(Properties.Resources.ImageAltText, entity.AltText));
+ }
+ else if (!string.IsNullOrEmpty(entity.DisplayUrl))
+ {
+ text = text.Replace(entity.Url, entity.DisplayUrl);
+ }
+ }
+ }
+
return text;
}