[reports] eradicate gtkhtml hacks

string of   was used to widen cell to a minimum of 60px. use
min-width style attribute instead.
This commit is contained in:
Christopher Lam 2019-09-29 17:22:34 +08:00
parent 607fd6ff9b
commit 5aa59e0ce1
6 changed files with 37 additions and 56 deletions

View File

@ -478,13 +478,13 @@
(define (get-total-balance-fn account) (define (get-total-balance-fn account)
(gnc:account-get-comm-balance-at-date account reportdate #f)) (gnc:account-get-comm-balance-at-date account reportdate #f))
;; Workaround to force gtkhtml into displaying wide (let ((wide (gnc:make-html-table-cell/markup "text-cell" #f)))
;; enough columns. (gnc:html-table-cell-set-style!
(let ((space (make-list tree-depth "     \ wide "text-cell" 'attribute '("style" "min-width:60px"))
          "))) (let ((space (make-list tree-depth wide)))
(gnc:html-table-append-row! left-table space) (gnc:html-table-append-row! left-table space)
(unless report-form? (unless report-form?
(gnc:html-table-append-row! right-table space))) (gnc:html-table-append-row! right-table space))))
(gnc:report-percent-done 80) (gnc:report-percent-done 80)
(when label-assets? (when label-assets?

View File

@ -675,17 +675,13 @@
) )
) )
;; Workaround to force gtkhtml into displaying wide (let ((wide (gnc:make-html-table-cell/markup "text-cell" #f)))
;; enough columns. (gnc:html-table-cell-set-style!
(let ((space wide "text-cell" 'attribute '("style" "min-width:60px"))
(make-list tree-depth "     \ (let ((space (make-list tree-depth wide)))
     \ (gnc:html-table-append-row! left-table space)
     ") (unless report-form?
)) (gnc:html-table-append-row! right-table space))))
(gnc:html-table-append-row! left-table space)
(if (not report-form?)
(gnc:html-table-append-row! right-table space))
)
(gnc:report-percent-done 80) (gnc:report-percent-done 80)
(if label-assets? (add-subtotal-line left-table (_ "Assets") #f #f)) (if label-assets? (add-subtotal-line left-table (_ "Assets") #f #f))

View File

@ -618,16 +618,11 @@
) )
) )
;; Workaround to force gtkhtml into displaying wide (let ((wide (gnc:make-html-table-cell/markup "text-cell" #f)))
;; enough columns. (gnc:html-table-cell-set-style!
(let ((space wide "text-cell" 'attribute '("style" "min-width:60px"))
(make-list tree-depth "     \ (gnc:html-table-append-row! inc-table (make-list tree-depth wide))
     \ (gnc:html-table-append-row! exp-table (make-list tree-depth wide)))
     ")
))
(gnc:html-table-append-row! inc-table space)
(gnc:html-table-append-row! exp-table space))
(gnc:report-percent-done 80) (gnc:report-percent-done 80)
(if label-revenue? (if label-revenue?

View File

@ -562,14 +562,10 @@
(gnc:report-percent-done 30) (gnc:report-percent-done 30)
;; Workaround to force gtkhtml into displaying wide (let ((wide (gnc:make-html-table-cell/markup "text-cell" #f)))
;; enough columns. (gnc:html-table-cell-set-style!
(gnc:html-table-append-row! wide "text-cell" 'attribute '("style" "min-width:60px"))
build-table (gnc:html-table-append-row! build-table (make-list 2 wide)))
(make-list 2 "     \
     \
     ")
)
(gnc:report-percent-done 80) (gnc:report-percent-done 80)

View File

@ -571,18 +571,13 @@
) )
) )
;; Workaround to force gtkhtml into displaying wide (let ((wide (gnc:make-html-table-cell/markup "text-cell" #f)))
;; enough columns. (gnc:html-table-cell-set-style!
(let ((space wide "text-cell" 'attribute '("style" "min-width:60px"))
(make-list tree-depth "     \ (gnc:html-table-append-row! inc-table (make-list tree-depth wide))
     \ (gnc:html-table-append-row! exp-table (make-list tree-depth wide))
     ") (gnc:html-table-append-row! tra-table (make-list tree-depth wide)))
))
(gnc:html-table-append-row! inc-table space)
(gnc:html-table-append-row! exp-table space)
(gnc:html-table-append-row! tra-table space))
(gnc:report-percent-done 80) (gnc:report-percent-done 80)
(if label-revenue? (if label-revenue?
(add-subtotal-line inc-table (_ "Revenues") #f #f)) (add-subtotal-line inc-table (_ "Revenues") #f #f))

View File

@ -559,15 +559,14 @@
(let* ((env (gnc:html-acct-table-get-row-env acct-table 0))) (let* ((env (gnc:html-acct-table-get-row-env acct-table 0)))
(set! account-cols (get-val env 'account-cols))) (set! account-cols (get-val env 'account-cols)))
;; Workaround to force gtkhtml into displaying wide (let ((wide (gnc:make-html-table-cell/markup "text-cell" #f))
;; enough columns. (ncols (+ account-cols (if (eq? report-variant 'work-sheet) 10 2))))
(let ((space (gnc:html-table-cell-set-style!
(make-list wide "text-cell" 'attribute '("style" "min-width:60px"))
(+ account-cols (let ((space (make-list ncols wide)))
(if (eq? report-variant 'work-sheet) 10 2)) (gnc:html-table-append-row! build-table space)
"               "))) (set! header-rows (1+ header-rows))))
(gnc:html-table-append-row! build-table space)
(set! header-rows (+ header-rows 1)))
;; add the double-column headers if required ;; add the double-column headers if required
(if (eq? report-variant 'work-sheet) (if (eq? report-variant 'work-sheet)
(let* ((headings (let* ((headings