summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2014-02-27 08:54:57 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-03-05 08:27:26 -0600
commit6b6398b72401b35dc0d01de70ee2124a0a4072a8 (patch)
tree7afa1768d27fb0ce2164ef41d5675c4f59ff99e8
parente95d5d52c84c073e1878c290031cdde6061fcc7d (diff)
fdo#45935: try hard to paint a frame for menus
Current Oxygen theme doesn't draw frames for menus, but uses shaped and "colored" background images. This workaround paints the window and menu frame for menus. Any frame seems to be better then no frame at all. Change-Id: I4d553ea58cac2729826f8395cb2597fa200187b6 (cherry picked from commit e72849cd435cc50a744dcbcfb422f5600dd0cce9) Reviewed-on: https://gerrit.libreoffice.org/8436 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--vcl/unx/kde4/KDEData.cxx17
-rw-r--r--vcl/unx/kde4/KDESalGraphics.cxx12
2 files changed, 21 insertions, 8 deletions
diff --git a/vcl/unx/kde4/KDEData.cxx b/vcl/unx/kde4/KDEData.cxx
index 196f186a7304..ccbbd9998320 100644
--- a/vcl/unx/kde4/KDEData.cxx
+++ b/vcl/unx/kde4/KDEData.cxx
@@ -17,10 +17,18 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#define Region QtXRegion
+
+#include <QStyle>
+#include <kapplication.h>
+
+#undef Region
+
#include "KDEData.hxx"
#include "KDEXLib.hxx"
+
KDEData::~KDEData()
{
}
@@ -39,6 +47,15 @@ void KDEData::initNWF()
pSVData->maNWFData.mbDockingAreaSeparateTB = true;
// no borders for menu, theming does that
pSVData->maNWFData.mbFlatMenu = true;
+
+ // Styled menus need additional space
+ QStyle *style = kapp->style();
+ pSVData->maNWFData.mnMenuFormatBorderX =
+ style->pixelMetric( QStyle::PM_MenuPanelWidth ) +
+ style->pixelMetric( QStyle::PM_MenuHMargin );
+ pSVData->maNWFData.mnMenuFormatBorderY =
+ style->pixelMetric( QStyle::PM_MenuPanelWidth ) +
+ style->pixelMetric( QStyle::PM_MenuVMargin );
}
void KDEData::deInitNWF()
diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index cf72dcd6aca1..967864fba4a1 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -78,7 +78,7 @@ QRect region2QRect( const Rectangle& rControlRegion )
}
KDESalGraphics::KDESalGraphics() :
- m_image(0)
+ m_image(NULL)
{
}
@@ -130,13 +130,7 @@ sal_Bool KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart
if (type == CTRL_SLIDER && (part == PART_TRACK_HORZ_AREA || part == PART_TRACK_VERT_AREA) )
return true;
- if ( (type == CTRL_PROGRESS) && (part == PART_ENTIRE_CONTROL) ) return true;
-
- return false;
-
- if ( (type == CTRL_TAB_ITEM) && (part == PART_ENTIRE_CONTROL) ) return true;
- if ( (type == CTRL_TAB_PANE) && (part == PART_ENTIRE_CONTROL) ) return true;
- // no CTRL_TAB_BODY for KDE
+ if ( (type == CTRL_PROGRESS) && (part == PART_ENTIRE_CONTROL) ) return true;
return false;
}
@@ -378,8 +372,10 @@ sal_Bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
{
QStyleOptionMenuItem option;
draw( QStyle::PE_PanelMenu, &option, m_image, vclStateValue2StateFlag( nControlState, value ));
+ // Try hard to get any frame!
QStyleOptionFrame frame;
draw( QStyle::PE_FrameMenu, &frame, m_image, vclStateValue2StateFlag( nControlState, value ));
+ draw( QStyle::PE_FrameWindow, &frame, m_image, vclStateValue2StateFlag( nControlState, value ));
lastPopupRect = widgetRect;
}
else