vcl/source/window/menu.cxx |   14 ++++----------
 vcl/unx/gtk3/gtkinst.cxx   |    4 ++--
 2 files changed, 6 insertions(+), 12 deletions(-)

New commits:
commit 7d9bc58315f4d94c63a19d1d9b900e452c03a7ca
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Dec 1 20:42:47 2021 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Dec 2 22:46:55 2021 +0100

    undo "allow vcl gen menus to have non-square images"
    
    This reverts commit 06f36cc7ca8fc056dd8cf4d8cdbe682f9a003cef
    
    ended up not using this so don't need the extra complexity
    
    Change-Id: I64a2d6f620cc864a75523be6612c5cf2086f7a00
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126211
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 96797979558c..4a497b84b02c 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1421,8 +1421,6 @@ void Menu::ImplRemoveDel( ImplMenuDelData& rDel )
     }
 }
 
-constexpr int ImageBorder = 4;
-
 Size Menu::ImplCalcSize( vcl::Window* pWin )
 {
     // | Check/Radio/Image| Text| Accel/Popup|
@@ -1489,8 +1487,8 @@ Size Menu::ImplCalcSize( vcl::Window* pWin )
             {
                 Size aImgSz = pData->aImage.GetSizePixel();
 
-                aImgSz.AdjustHeight(ImageBorder); // add a border for native 
marks
-                aImgSz.AdjustWidth(ImageBorder); // add a border for native 
marks
+                aImgSz.AdjustHeight(4 ); // add a border for native marks
+                aImgSz.AdjustWidth(4 ); // add a border for native marks
                 if ( aImgSz.Width() > aMaxImgSz.Width() )
                     aMaxImgSz.setWidth( aImgSz.Width() );
                 if ( aImgSz.Height() > aMaxImgSz.Height() )
@@ -1922,16 +1920,12 @@ void Menu::ImplPaint(vcl::RenderContext& 
rRenderContext, Size const & rSize,
                 // Image:
                 if (!bLayout && !IsMenuBar() && ((pData->eType == 
MenuItemType::IMAGE) || (pData->eType == MenuItemType::STRINGIMAGE)))
                 {
-                    Image aImage = pData->aImage;
-
-                    auto nImgWidth = aImage.GetSizePixel().Width() + 
ImageBorder;
-                    if (nImgWidth > aOuterCheckRect.GetWidth())
-                        aOuterCheckRect.setWidth(nImgWidth);
-
                     // Don't render an image for a check thing
                     if (pData->bChecked)
                         ImplPaintCheckBackground(rRenderContext, *pWindow, 
aOuterCheckRect, pThisItemOnly && bHighlighted);
 
+                    Image aImage = pData->aImage;
+
                     aTmpPos = aOuterCheckRect.TopLeft();
                     aTmpPos.AdjustX((aOuterCheckRect.GetWidth() - 
aImage.GetSizePixel().Width()) / 2 );
                     aTmpPos.AdjustY((aOuterCheckRect.GetHeight() - 
aImage.GetSizePixel().Height()) / 2 );
commit 3b83f9398893477ad7b45fc4076403b3583aab56
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Dec 1 20:32:30 2021 +0000
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Thu Dec 2 22:46:38 2021 +0100

    Related: tdf#145901 use x11 popover replacement for all non-menubutton cases
    
    replacement from inside real popover under x11 as in autofilter case
    doesn't work.
    
    Change-Id: Ie4ba95645a8094732b9bad9829426e77375d63ad
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126208
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index d808d1e478c4..c993e16fc4ce 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -22084,7 +22084,7 @@ public:
         //under wayland a Popover will work to "escape" the parent dialog, not
         //so under X, so come up with this hack to use a raw GtkWindow
         GdkDisplay *pDisplay = gtk_widget_get_display(GTK_WIDGET(m_pPopover));
-        if (DLSYM_GDK_IS_X11_DISPLAY(pDisplay) && 
gtk_popover_get_constrain_to(m_pPopover) == GTK_POPOVER_CONSTRAINT_NONE)
+        if (DLSYM_GDK_IS_X11_DISPLAY(pDisplay))
         {
             m_pMenuHack = GTK_WINDOW(gtk_window_new(GTK_WINDOW_POPUP));
             gtk_window_set_type_hint(m_pMenuHack, GDK_WINDOW_TYPE_HINT_COMBO);
@@ -22136,7 +22136,7 @@ public:
         //under wayland a Popover will work to "escape" the parent dialog, not
         //so under X, so come up with this hack to use a raw GtkWindow
         GdkDisplay *pDisplay = gtk_widget_get_display(GTK_WIDGET(m_pPopover));
-        if (DLSYM_GDK_IS_X11_DISPLAY(pDisplay) && 
gtk_popover_get_constrain_to(m_pPopover) == GTK_POPOVER_CONSTRAINT_NONE)
+        if (DLSYM_GDK_IS_X11_DISPLAY(pDisplay))
         {
             if (!m_bMenuPoppedUp)
             {

Reply via email to