| @@ -848,6 +848,21 @@ |
| 848 | ;; width that stops short of it. | 848 | ;; width that stops short of it. |
| 849 | (def ^:private users-width 180) | 849 | (def ^:private users-width 180) |
| 850 | | 850 | |
| | 851 | +;; What the rows under the conversation need left to them: the jump button's |
| | 852 | +;; row, the separator, the compose bar and the air around it. The columns of |
| | 853 | +;; the row reserve it, and so nothing inside them has to — a `:scroll` that |
| | 854 | +;; subtracted it again inside a column already stopped short would take the |
| | 855 | +;; same points off the list twice. |
| | 856 | +;; |
| | 857 | +;; Plus the reply banner's row when there is one, and the pasted picture when |
| | 858 | +;; there is one. Those rows do move the compose bar, and should: each appears |
| | 859 | +;; because the reader just asked for something — unlike the jump button, which |
| | 860 | +;; appears on its own and must not shift what is under it. |
| | 861 | +(defn- below-messages [] |
| | 862 | + (+ 124 |
| | 863 | + (if @s/replying-to 34 0) |
| | 864 | + (if @s/attachment 76 0))) |
| | 865 | + |
| 851 | (defn- messages-width | 866 | (defn- messages-width |
| 852 | "How wide the message list may be with the people panel beside it. | 867 | "How wide the message list may be with the people panel beside it. |
| 853 | | 868 | |
| @@ -882,11 +897,11 @@ |
| 882 | show, and says so rather than showing an empty column." | 897 | show, and says so rather than showing an empty column." |
| 883 | [name] | 898 | [name] |
| 884 | (let [people (s/member-list name)] | 899 | (let [people (s/member-list name)] |
| 885 | - [:vbox {:key :users :width-request users-width :fill-height true :spacing 8} | 900 | + [:vbox {:key :users :width-request users-width :fill-height true |
| | 901 | + :reserve (below-messages) :spacing 8} |
| 886 | [:title-2 {:label (str "People " (count people))}] | 902 | [:title-2 {:label (str "People " (count people))}] |
| 887 | [:scroll {:scroll-key (str "users-" name) | 903 | [:scroll {:scroll-key (str "users-" name) |
| 888 | - :orientation :vertical | 904 | + :orientation :vertical} |
| 889 | - :reserve 124} | | |
| 890 | (if (seq people) | 905 | (if (seq people) |
| 891 | (for [p people] [member-row p]) | 906 | (for [p people] [member-row p]) |
| 892 | [:dim-label {:label "Nobody listed yet."}])]])) | 907 | [:dim-label {:label "Nobody listed yet."}])]])) |
| @@ -947,24 +962,20 @@ |
| 947 | ;; it every time the panel was toggled. | 962 | ;; it every time the panel was toggled. |
| 948 | [:hbox {:spacing 8 :wrap false} | 963 | [:hbox {:spacing 8 :wrap false} |
| 949 | [:vbox {:key :messages :fill-height true | 964 | [:vbox {:key :messages :fill-height true |
| | 965 | + :reserve (below-messages) |
| 950 | :width-request (if show-users? (messages-width) 0)} | 966 | :width-request (if show-users? (messages-width) 0)} |
| 951 | [:scroll {:scroll-key "chat-messages" | 967 | [:scroll {:scroll-key "chat-messages" |
| 952 | :orientation :vertical | 968 | :orientation :vertical |
| 953 | - ;; Plus the reply banner's row when there is one, and the | | |
| 954 | - ;; pasted picture when there is one. Those rows do move the | | |
| 955 | - ;; compose bar, and should: each appears because the reader just | | |
| 956 | - ;; asked for something — unlike the jump button, which appears | | |
| 957 | - ;; on its own and must not shift what is under it. | | |
| 958 | - :reserve (+ 124 | | |
| 959 | - (if @s/replying-to 34 0) | | |
| 960 | - (if @s/attachment 76 0)) | | |
| 961 | :stick-to-bottom true | 969 | :stick-to-bottom true |
| 962 | :scroll-to-bottom @s/jump-tick | 970 | :scroll-to-bottom @s/jump-tick |
| 963 | :on-change #(reset! s/at-present? (= "end" %))} | 971 | :on-change #(reset! s/at-present? (= "end" %))} |
| 964 | (if (seq (:messages buffer)) | 972 | (if (seq (:messages buffer)) |
| 965 | (message-rows (:messages buffer)) | 973 | (message-rows (:messages buffer)) |
| 966 | [:dim-label {:label "Nothing here yet."}])]] | 974 | [:dim-label {:label "Nothing here yet."}])]] |
| 967 | - [:vbox {:key :people-pane :fill-height true} | 975 | + ;; The wrapper takes no height of its own: the panel inside it is the |
| | 976 | + ;; column, and a fill-height wrapper around it would claim the strip the |
| | 977 | + ;; compose bar sits in whether or not the panel was showing. |
| | 978 | + [:vbox {:key :people-pane} |
| 968 | (when show-users? [users-panel name])]] | 979 | (when show-users? [users-panel name])]] |
| 969 | ;; Only while it is needed, and directly above the compose bar: the way | 980 | ;; Only while it is needed, and directly above the compose bar: the way |
| 970 | ;; back to the present belongs next to the thing that puts you there. | 981 | ;; back to the present belongs next to the thing that puts you there. |