uranusjr / Qelly

Beautiful cross-platform BBS client.
61 stars 14 forks source link

隨視窗調整字型大小 #45

Open uranusjr opened 11 years ago

uranusjr commented 11 years ago

一個做法是放一個 setting toggle fixed mode/dynamic mode,然後在 View 裡面放一個 cell width/height getter 的 wrapper。如果是 fixed mode 就用現在的方法,dynamic mode 就是偵測目前視窗大小來換算。在 resizeEvent 裡偵測如果是 dynamic mode 就觸發 redraw。

仔細想像似乎是沒有想像中難,因為 cellWidthcellHeight 本來就有 cache,只要用 Controller::updateAll 就搞定了。