Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add mojave_dark and hilited_corner_radius option #242

Closed
wants to merge 1 commit into from

Conversation

xiehuc
Copy link

@xiehuc xiehuc commented Oct 8, 2018

增加系统暗色主题和高亮圆角

同时修正配置错误 #240

2018-10-08 4 18 40

原系统主题效果:

2018-10-08 4 19 59

系统暗色主题和高亮圆角
Copy link
Member

@lotem lotem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

效果讚
代碼再看看

@@ -207,7 +207,7 @@ preset_color_schemes:
author: LIANG Hai
horizontal: true # 水平排列
inline_preedit: true #单行显示,false双行显示
candidate_format: "%c\u2005%@\u2005" # 编号 %c 和候选词 %@ 前后的空间
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

後加空格似乎是爲了保持與候選註釋的間距

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我看过代码不是的. https://github.com/rime/squirrel/blob/master/SquirrelPanel.m#L375https://github.com/rime/squirrel/blob/master/SquirrelPanel.m#L384

重绘的时候是

2018-10-14 3 18 40

造成右边空间比左边空间大了。

另外一个证据是有些主题后面加了\u2005有些主题后面没有。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

后面那个空格是主题作者需要的。这样做逻辑上并不正确,但在作者常用的情景下,正好能为候选文字和其后的注释之间加入合适的空白,使文字两边的空白视觉上对称。
严谨的做法是在非空注释前面加空白,可能实现没现在这样简便。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

好吧,还有注释的存在。

@@ -57,27 +58,33 @@ - (void) setCornerRadius:(double)cornerRadius {

- (void)drawRect:(NSRect)dirtyRect {
if (self.highlightedStripColor && !NSIsEmptyRect(self.highlightedRect)) {
CGFloat edgeWidth = self.edgeInset.width + 1;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要驗證是否影響原來的無邊框設計。
印象裏由於浮點數誤差,亮塊與窗體邊緣之間會出現細小縫隙。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个我验证过。没有问题。我把这个 +1 放在 70 行了。因为之前计算从来没有涉及+1,这里直接给edge加一下,会造成扩大1像素。

不如放在后面检测的时候,只是用于判断,不放进边框中。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

附: 去掉 hilited_corner_radius 后的效果:
2018-10-14 3 23 13
2018-10-14 3 23 34
2018-10-14 3 23 39

Copy link
Member

@lotem lotem Nov 20, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

会造成扩大1像素

是不是说会影响圆角的绘制?

代码这样处理不错,不过我注意到,过去高亮部分是占满高度(或宽度)的,
上文的截图却留出了一道黑边,视觉上不同于原来的“无边框”效果。
所以再确认一下,这是暗色模式的副作用,还是绘制的高亮区域变小了。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是系统加的黑边,选择白色界面效果如下:

2018-11-20 10 30 25

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#250 :: Dark 模式的黑邊

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

發現這個改動仍會影響原來的無邊框設計。
亮塊與窗體邊緣之間會出現細小縫隙。
詳見 #240 (comment)

@Caldis
Copy link

Caldis commented Nov 9, 2018

效果赞!正好也在研究改成一样的效果
高亮选框圆角找了很久没找到配置项,原来是没有

另外建议左右间距再各加一个空格

@sirlaurie
Copy link

screen shot 2018-11-14 at 18 25 18

我觉得我的也不错

@lotem
Copy link
Member

lotem commented Dec 2, 2018

Merged. Thanks.

@lotem lotem closed this Dec 2, 2018
@alswl
Copy link

alswl commented Dec 11, 2018

效果赞,正在打包中。
PS:我使用的官网配色,代码见 https://github.com/alswl/Rime/blob/master/squirrel.custom.yaml#L44

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants