Debian Codegraph @

plugin/set_view/set_view.rb

raw symbols SCIP
1 # -*- coding: utf-8 -*-
2
3 Plugin::create(:set_view) do
4
5 UserConfig[:mumble_system_bg] ||= [255*222, 65535, 255*176]
6
7 filter_message_selected_bg_color do |model, color|
8 color and return [model, color]
9 slug = model.class.slug
10 color = UserConfig[:"#{slug}_selected_bg"] || UserConfig[:mumble_selected_bg]
11 [model, color]
12 end
13
14 filter_message_bg_color do |model, color|
15 color and return [model, color]
16 slug = model.class.slug
17 color = if model.from_me?
18 UserConfig[:"#{slug}_self_bg"] || UserConfig[:mumble_self_bg]
19 elsif model.to_me?
20 UserConfig[:"#{slug}_reply_bg"] || UserConfig[:mumble_reply_bg]
21 else
22 UserConfig[:"#{slug}_basic_bg"] || UserConfig[:mumble_basic_bg]
23 end
24 [model, color]
25 end
26
27 filter_subparts_replyviewer_background_color do |message, color|
28 [message, color || UserConfig[:replyviewer_background_color]] end
29
30 filter_subparts_quote_background_color do |message, color|
31 [message, color || UserConfig[:quote_background_color]] end
32
33 filter_message_font do |message, font|
34 [message, font || UserConfig[:"#{message.class.slug}_basic_font"] || UserConfig[:mumble_basic_font]] end
35
36 filter_message_font_color do |message, color|
37 [message, color || UserConfig[:"#{message.class.slug}_basic_color"] || UserConfig[:mumble_basic_color]] end
38
39 filter_message_header_left_font do |message, font|
40 [message, font || UserConfig[:"#{message.class.slug}_basic_left_font"] || UserConfig[:mumble_basic_left_font]] end
41
42 filter_message_header_left_font_color do |message, color|
43 [message, color || UserConfig[:"#{message.class.slug}_basic_left_color"] || UserConfig[:mumble_basic_left_color]] end
44
45 filter_message_header_right_font do |message, font|
46 [message, font || UserConfig[:"#{message.class.slug}_basic_right_font"] || UserConfig[:mumble_basic_right_font]] end
47
48 filter_message_header_right_font_color do |message, color|
49 [message, color || UserConfig[:"#{message.class.slug}_basic_right_color"] || UserConfig[:mumble_basic_right_color]] end
50
51 settings(_("表示")) do
52 settings _('カスタム絵文字') do
53 boolean(_('カスタム絵文字を表示する'), :miraclepainter_expand_custom_emoji).
54 tooltip(_("本文にカスタム絵文字(Emoji Note)が含まれていれば、その画像を取得して表示します。\n無効にすれば、画像のダウンロードは発生せず代替テキストが表示されるので、そのぶん通信トラフィックを抑えることができます。"))
55 end
56 settings _('選択中') do
57 color _('背景色'), :mumble_selected_bg
58 end
59 settings _('共通') do
60 select _('UIの拡大率'), :ui_scale do
61 option 1, _('等倍')
62 option 1.5, _('1.5倍')
63 option 2, _('2倍')
64 option :auto, _('自動(%<scale>.2f倍)') % {scale: Gdk::Visual.system.screen.resolution / 100}
65 end
66
67 boolean(_('acctのドメイン名をりんすきにする'), :idname_abbr)
68 end
69
70 Plugin.filtering(:retrievers, []).first.select(&:timeline).each do |modelspec|
71 slug = modelspec[:slug]
72 settings(_(modelspec[:name])) do
73 settings(_('デフォルト')) do
74 settings(_('フォント')) do
75 fontcolor _('本文'), [:"#{slug}_basic_font", :mumble_basic_font], [:"#{slug}_basic_color", :mumble_basic_color]
76 fontcolor _('ヘッダ(左)'), [:"#{slug}_basic_left_font", :mumble_basic_left_font], [:"#{slug}_basic_left_color", :mumble_basic_left_color]
77 fontcolor _('ヘッダ(右)'), [:"#{slug}_basic_right_font", :mumble_basic_right_font], [:"#{slug}_basic_right_color", :mumble_basic_right_color]
78 end
79 color _('背景色'), [:"#{slug}_basic_bg", :mumble_basic_bg]
80 end
81
82 if modelspec[:reply]
83 settings(_('自分宛の%{retriever}') % {retriever: modelspec[:name]}) do
84 color _('背景色'), [:"#{slug}_reply_bg", :mumble_reply_bg]
85 end
86 end
87
88 if modelspec[:myself]
89 settings(_('自分の%{retriever}') % {retriever: modelspec[:name]}) do
90 color _('背景色'), [:"#{slug}_self_bg", :mumble_self_bg]
91 end
92 end
93 end
94 end
95
96 settings(_('リプライ先')) do
97 fontcolor _('フォント'), :reply_text_font, :reply_text_color
98 color(_('背景色'), :replyviewer_background_color)
99
100 multiselect _('表示項目'), :reply_present_policy do
101 option(:header, _('ヘッダを表示する'))
102 option(:icon, _('アイコンを表示する')) do
103 select _('アイコンのサイズ'), :reply_icon_size do
104 [12,16,24,32,36,48,UserConfig[:reply_icon_size]].compact.uniq.sort.each do |size|
105 option size, "#{size}px" if size end end end
106 option(:edge, _('枠線を表示する')) do
107 select _('枠線の種類'), :reply_edge, floating: _('影'), solid: _('線'), flat: _('枠線なし') end end
108
109 adjustment _('本文の最大行数'), :reply_text_max_line_count, 1, 10
110
111 select _('クリックされたときの挙動'), :reply_clicked_action do
112 option nil, _('何もしない')
113 option :open, _('開く')
114 option :smartthread, _('会話スレッドを表示') end
115 end
116
117 settings(_('コメント付きシェア')) do
118 fontcolor _('フォント'), :quote_text_font, :quote_text_color
119 color(_('背景色'), :quote_background_color).
120 tooltip(_('コメント付きシェアをすると、下に囲われて表示されるじゃないですか、あれです'))
121
122 multiselect _('表示項目'), :quote_present_policy do
123 option(:header, _('ヘッダを表示する'))
124 option(:icon, _('アイコンを表示する')) do
125 select _('アイコンのサイズ'), :quote_icon_size do
126 [12,16,24,32,36,48,UserConfig[:quote_icon_size]].compact.uniq.sort.each do |size|
127 option size, "#{size}px" if size end end end
128 option(:edge, _('枠線を表示する')) do
129 select _('枠線の種類'), :quote_edge, floating: _('影'), solid: _('線'), flat: _('枠線なし') end end
130
131 adjustment _('本文の最大行数'), :quote_text_max_line_count, 1, 10
132
133 select _('クリックされたときの挙動'), :quote_clicked_action do
134 option nil, _('何もしない')
135 option :open, _('開く')
136 option :smartthread, _('会話スレッドを表示') end
137 end
138
139 settings(_('Mentions')) do
140 boolean(_('リプライを返した投稿にはアイコンを表示'), :show_replied_icon).
141 tooltip(_("リプライを返した投稿のアイコン上に、リプライボタンを隠さずにずっと表示しておきます。"))
142 end
143
144 settings(_('ふぁぼふぁぼ')) do
145 boolean(_('ふぁぼられをリプライの受信として処理する'), :favorited_by_anyone_act_as_reply).
146 tooltip(_("ふぁぼられた投稿が、リプライタブに現れるようになります。"))
147 boolean(_('ふぁぼられた投稿をTL上でageる'), :favorited_by_anyone_age).
148 tooltip(_("投稿がふぁぼられたら、投稿された時刻にかかわらず一番上に上げます"))
149 boolean(_('自分がふぁぼった投稿をTL上でageる'), :favorited_by_myself_age).
150 tooltip(_("自分がふぁぼった投稿を、TLの一番上に上げます"))
151 end
152
153 settings(_('シェア')) do
154 boolean(_('シェアされた投稿をTL上でageる'), :retweeted_by_anyone_age).
155 tooltip(_("投稿がシェアされたら、投稿された時刻にかかわらず一番上に上げます"))
156 boolean(_('自分がシェアした投稿をTL上でageる'), :retweeted_by_myself_age).
157 tooltip(_("自分がシェアした投稿を、TLの一番上に上げます"))
158 end
159
160 settings(_('非公開アカウント')) do
161 boolean(_('非公開アカウントの投稿にはアイコンを表示'), :show_protected_icon).
162 tooltip(_("非公開アカウントの投稿のアイコン上に、シェアできないこと示すアイコンを隠さずにずっと表示しておきます。"))
163 end
164
165 settings(_('承認済みアカウント')) do
166 boolean(_('承認済みアカウントの投稿にはアイコンを表示'), :show_verified_icon).
167 tooltip(_("承認されたアカウントの投稿のアイコンの上に、そのことを示すアイコンを隠さずにずっと表示しておきます。"))
168 end
169
170 settings(_('短縮URL')) do
171 boolean(_('短縮URLを展開して表示'), :shrinkurl_expand).
172 tooltip(_("受信した投稿に短縮URLが含まれていた場合、それを短縮されていない状態に戻してから表示します。"))
173 end
174
175 select _('タブの位置'), :tab_position, 0 => _('上'), 1 => _('下'), 2 => _('左'), 3 => _('右')
176
177 select _('投稿ボックス'), :postbox_visibility, always: _('常に表示する'), none: _('表示しない'), auto: _('1アカウント以上あれば表示')
178
179 select _('アカウント切り替え'), :world_shifter_visibility, always: _('常に表示する'), none: _('表示しない'), auto: _('2アカウント以上あれば表示')
180
181 select(_('URLを開く方法'), :url_open_specified_command) do
182 option false, _("デフォルトブラウザを使う")
183 option true do
184 input _("次のコマンドを使う"), :url_open_command
185 end
186 end
187
188 settings(_('タイムライン')) do
189 adjustment(_('最大表示件数'), :timeline_max, 1, 10000)
190 end
191 end
192 end