]> git.lyx.org Git - features.git/commit
Fix broken layout of the citation dialog (#10019)
authorGuillaume Munch <gm@lyx.org>
Wed, 16 Mar 2016 21:47:32 +0000 (21:47 +0000)
committerGuillaume Munch <gm@lyx.org>
Mon, 4 Apr 2016 15:58:16 +0000 (17:58 +0200)
commitb5a2f1c7e5caf6f79b6894b562769a5513b7b13f
treee4579ad5ae0e647d3dadc88098082e9bc7e1f3b1
parent7e33fd7faccc815b34bf4ea598762c624b0a867a
Fix broken layout of the citation dialog (#10019)

7b1107d7 introduced the following inconveniences which are regressions to 2.1:

* The citation dialog can open with vertical scroll bars in the options

* The citation dialog can open with horizontal scroll bars, especially if the
  translated text is longer than the original text (e.g. in FR)

* Resizing the dialog is inconvenient because it increases the gap between the
  options. This is unlike before when the dialog could let us see more of the
  reference list when enlarging.

This is because the QToolbox that the above commit introduced is not natively
aware of the sizes of its page sub-widgets. The widget is not conceived for this
use, where the space is scarce.

Geometry values provided in the ui file (automatically computed by qtcreator I
suppose) somehow gave the illusion that it worked, but relying on such values is
not portable : it does not take into account the specific theme, font sizes and
localization. This explains why it failed on my side and will probably fail in
other settings too.

Luckily, there is a simple way to make QToolbox suitable for the current use,
which is to add the "missing link" which computes its size based on the minimal
sizes of its pages. The result looks very nice and intuitive. It solves all the
aforementioned issues.
src/frontends/qt4/GuiCitation.cpp
src/frontends/qt4/ui/CitationUi.ui