summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2014-02-27 08:54:57 +0000
committerJan-Marek Glogowski <glogow@fbihome.de>2014-03-03 10:47:54 +0000
commite72849cd435cc50a744dcbcfb422f5600dd0cce9 (patch)
tree53ad651b78c1d8ced3b26ba65031ec8507d59f41 /vcl/unx
parentab1f5eab4830f00dbbd7c883b98b59975ecd3bb1 (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
Diffstat (limited to 'vcl/unx')
-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 5bad70dc2dbd..a41b0cd14da7 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 @@ bool KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart par
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 @@ 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