cui/source/options/treeopt.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 91477bc82259bb98a92280061e70d777a963acf5
Author:     Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
AuthorDate: Thu Feb 27 23:05:53 2025 +0100
Commit:     Adolfo Jayme Barrientos <fit...@ubuntu.com>
CommitDate: Thu Mar 6 11:06:13 2025 +0100

    tdf#134791 Clamp options dialog height to 80% of screen size
    
    to make buttons accessible on smaller screens.
    
    Change-Id: If43edfeb97ad710c69c0ea8780a9af6ee336a5c1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182341
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de>
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    (cherry picked from commit c60ca3582598c7b9b9b33c288edbd76207f5b14d)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182576
    Reviewed-by: Adolfo Jayme Barrientos <fit...@ubuntu.com>

diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 90f08e9fbe04..70281c847f12 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -473,6 +473,10 @@ OfaTreeOptionsDialog::OfaTreeOptionsDialog(weld::Window* 
pParent, bool fromExten
     , eRestartReason(svtools::RESTART_REASON_NONE)
 {
     Size aSize(xTreeLB->get_approximate_digit_width() * 100, 
xTreeLB->get_height_rows(30));
+    AbsoluteScreenPixelRectangle aScreen
+        = 
Application::GetScreenPosSizePixel(Application::GetDisplayBuiltInScreen());
+    // clamp height to max of 80% of screen height to make buttons accessible 
on smaller screens
+    aSize.setHeight(std::min(static_cast<tools::Long>(aScreen.GetHeight() * 
0.8), aSize.Height()));
     xTabBox->set_size_request(aSize.Width(), aSize.Height());
     xTreeLB->set_size_request(xTreeLB->get_approximate_digit_width() * 35, 
aSize.Height());
 

Reply via email to