-
Notifications
You must be signed in to change notification settings - Fork 414
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
UI Improvements (macOS deployment target = 10.15+, up to 14.4) #756
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Float font size * No line-break within short candidate and comment * Highlighted candidate background shadow * Non-highlighted candidate background color * Optional mutual exclusive color filling * Option to disable sticky panel size
…ich is used in NSString. (cherry picked from commit a533b41)
groverlynn
force-pushed
the
UI
branch
7 times, most recently
from
February 14, 2024 05:05
750cd77
to
3309c0b
Compare
groverlynn
force-pushed
the
UI
branch
8 times, most recently
from
February 18, 2024 09:45
83e3f35
to
27e82fa
Compare
Closed
groverlynn
force-pushed
the
UI
branch
2 times, most recently
from
February 26, 2024 06:47
71e87cd
to
c4946da
Compare
不支持12.7.4. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
包括下述UI改進:
NSTextView
),直立(upright)的寬字符和側臥(sideways)的窄字符均能對齊基線。Emoji在橫式和直式下均不會產生基線跳躍。(MacOS 12及以後的版本採用新的textkit 2
API,對部分罕用字符的支援度高於MacOS 11及以前的系統使用的textkit
。)linear
)排列模式下只在選項之前或之後換行/列,確保同一選項不分屬兩行/列,除非單一選項長度超過上限。修改行間距(line-spacing)實現方式以避免出現高亮多邊形摺疊、並且橫式各行上下居中/直式各欄左右居中。accent
)顏色。1234567890
。其中第十項改用0
以反應實際按鍵。直式模式下全寬數字保持直立,更利閱讀。修改後選項標籤部分確保等寬,無需設置專門字型。同時,標籤的缺省字型則改爲數字等寬(monospaced digit)的系統字型。當然,用戶仍可以自選字型、自定選項標籤字符。自選字型優先使用數字等寬(monospaced)或字母數字半寬(half-width)(若字型支援)。height
)和左右邊界的邊框寬度(width
)。linear
)模式位於末行行尾,堆疊(stacked
)模式獨佔末行),用戶可以知曉當前是否爲第一頁(尤其在回翻時),以免不慎繼續使用,
向前翻頁觸發,
上屏。翻頁提示符亦是翻頁鍵,支援滑鼠和觸控板直接點選翻頁,terminal等APP攔截鍵盤方向鍵時也可以點選面板上按鈕。選項開關:style/show_paging
。translucency
修改爲程度,取值爲0到1之間,0爲不透明,1爲完全透明(與alpha相反/互補)。無需另外設置半透明的背景色(back_color
和preedit_back_color
)。註:背景顏色的alpha
通道、輸入面板的alpha
值、輸入面板的translucency
值互相獨立且效果疊加。因半透明效果會混合系統的淺色或暗黑模式,所以輸入面板的配色也必須使用相應的淺色或深色,否則會呈現並非半透明的效果。如果選用的背景色與淺色/暗黑模式衝突,會自動替換所有顏色爲其亮度(Lab*色彩空間之luminance
)上的補色。shift+Fn+delete
)。開啓翻頁提示(show_paing
)時支援滑鼠和觸控板主鍵/單指點選翻頁提示來翻頁,次鍵/雙指分別相當於Home
和End
。主鍵/單指點選輸入編碼區的⌫退格,次鍵/雙指點選相當於esc
。back_image
,默認路徑為~/Library/Rime
),此時半透明(磨砂)參數translucency
代表背景色(back_color
和preedit_back_color
)遮擋背景圖片的程度,0爲背景色徹底遮擋背景圖片,1爲無背景色/只顯示背景圖片 。linear
的子模式:表格式排列tabled
。表格模式中,候選項盡可能地居左對齊,高亮區域覆蓋候選項所在的整個單元格。line_length
(橫排時爲候選框每行寬度,直排時爲候選框每行高度,單位爲point
)。當取值爲正數時,文字框長度即固定不變,選項不足一行時留空補足該長度(tabled
表格式排版時,以單元格為單位向下取整,單元格寬度為2/4/6/8…個漢字寬)。另外,line兩端額外留有半個漢字寬的padding(不計入line_length
中),避免文字被圓角切割。①
)選項中的由右至左書寫字符導致整個選項書寫方向改爲由右至左的bug。修正後選項整體保持由左至右的書寫方向,由右至左書寫的字符串則由右至左嵌套其中。markdown
或html<tag>
語法對候選項套用加粗(**
或__
)、斜體(*
或_
)、下劃線(<u>
)、刪除線(~~
)、上標(^
)、下標(~
)等樣式,以及ruby注音(Unicode範式:U+FFF9
文字U+FFFA
ㄨㄣˊ ㄗˋU+FFFB
,注音部分以空格斷字;三個定位符號可使用UTF8編碼輸入,比如U+FFF9
即是\xEF\xBF\xB9
)。相關的設定項為candidate_format
和comment_format
。color_scheme
和color_scheme_dark
,或使用color_scheme: native
,或啓用半透明磨砂效果/translucency
為正數)。switches
可控制樣式style
(會覆蓋當前color_scheme
的相應設定)。既可以是單獨控制樣式的switch
,也可以附屬於其他switch
之上。相關的設定項為方案的style/<option_name>
。典型應用場景:根據繁簡選擇相應字型。假定
switches
中有一組繁簡轉換選項options: [ zh_TW, zh_HK, zh_Hans ]
,則style
中設定如左:上述所有UI改善均無需提高最低系統要求,保持最低支援macOS 10.15(最低支援MacOS 10.6,需配合librime 1.8.5-)。一圖以蔽之:
背景圖片
固定行長(本例為200 pt)
tabled
表格式排列所有依賴combining marks的合成字符均能夠正確顯示(註:多數合成字母和數學符號有專門的碼位,所以已被unicode官方建議不要使用,例如不建議使用U+0061U+0304 | ā,而應使用U+0101 | ā)。
此外,這個PR沒有 #749 新引入的諸多bug:
remember_size
之後,進一步確保輸入面板左上角(豎排右上角)錨定,最大程度杜絕輸入面板不停跳躍的毛病。